Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GTK: hybrid layout support #773

Merged
merged 4 commits into from
Feb 26, 2024
Merged

GTK: hybrid layout support #773

merged 4 commits into from
Feb 26, 2024

Conversation

thesourcehim
Copy link
Contributor

Introducing two additional layout types: "Hybrid (equal height)" and "Hybrid (emphasize vertical)".
Both are basically concatenation of single screen layout and vertical layout.
The first one behaves like in melonDS (I think): single (big) screen and vertical part have equal heights and resulting concatenated rectangle is fit into drawing area.

hybrid_equal

The second one is a bit trickier: vertical part is scaled to occupy all available vertical space (if possible) and placed on the right, then big screen is fit into remaining part. Big screen is aligned at the top of the area if it's the top screen and at the bottom if it's the touch screen.

hybrid_vertical_top

hybrid_vertical_bottom

This type of layout allows vertical part to be as large as possible. It's specifically designed for wide screens.

In both cases 'Swap screens' option controls wich screen is displayed as big screen, it does not affect vertical part. Other options like gap and rotation are respected.

Additionally I optimized drawing function a bit, so recalculation of some parameters only occurs when necessary, not every frame.

@thesourcehim
Copy link
Contributor Author

Requesting review. @rofl0r ?

case ORIENT_HYBRID_EQUAL:
string = "hybrid_equal";
break;
case ORIENT_HYBRID_VERTICAL:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tabs vs spaces

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, yeah, sorry, fixed.

@@ -3484,6 +3688,10 @@ common_gtk_main(GApplication *app, gpointer user_data)
nds_screen.gap_size = config.view_gap ? GAP_SIZE : 0;

nds_screen.swap = config.view_swap;
#ifdef HAVE_LIBAGG
bool hybrid = (nds_screen.orientation == ORIENT_HYBRID_EQUAL) || (nds_screen.orientation == ORIENT_HYBRID_VERTICAL);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

@rofl0r
Copy link
Collaborator

rofl0r commented Feb 26, 2024

cool. i assume you tested this sufficiently ? i deliberately waited a few days after you first opened this, and indeed your subsequent commits proved me right.

@thesourcehim
Copy link
Contributor Author

thesourcehim commented Feb 26, 2024

I tested this with various combinations of layout, rotation, screen gap and swap screens options and with different window sizes (including different horizontal/vertical proportions of the window). After that I tested HUD including edit mode and additional commits were required. For instance, with hybrid layouts 'Swap screens' flag should not be transfered to HUD because it does not affect vertical part and if transfered, HUD parts would jump between screens. Now I tested HUD with all layout types and it looks like display and edit work properly now. If you have other tests in mind I will perform them.

i deliberately waited a few days after you first opened this, and indeed your subsequent commits proved me right.

I forgot to mark this PR is WIP back then, sorry.

@rofl0r rofl0r merged commit 0a6eca6 into TASEmulators:master Feb 26, 2024
9 checks passed
getItemFromBlock pushed a commit to getItemFromBlock/AM64DS_DeSmuME that referenced this pull request Feb 28, 2024
* GTK: hybrid layout support
* Fix HUD with new layouts
* Simplify rotoscaled_hudedit logic a bit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants