-
Notifications
You must be signed in to change notification settings - Fork 552
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
Conversation
Requesting review. @rofl0r ? |
case ORIENT_HYBRID_EQUAL: | ||
string = "hybrid_equal"; | ||
break; | ||
case ORIENT_HYBRID_VERTICAL: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tabs vs spaces
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
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. |
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 forgot to mark this PR is WIP back then, sorry. |
* GTK: hybrid layout support * Fix HUD with new layouts * Simplify rotoscaled_hudedit logic a bit
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.
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.
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.