-
Notifications
You must be signed in to change notification settings - Fork 162
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
3.6.0: enhanced gfx mode config #1428
3.6.0: enhanced gfx mode config #1428
Conversation
this sounds like the perfect opportunity to implement the distinction between |
That is true. |
f936434
to
8759352
Compare
Added a distinction between SDL_WINDOW_FULLSCREEN and SDL_WINDOW_FULLSCREEN_DESKTOP to the graphic drivers. In terms of config, I imagine that when user wants "fullscreen desktop" they likely want it to use current desktop setting without changing resolution. So we might save on number of options and use same one for everything:
|
how about fullscreen=native or similar to use the mode automatically that the game wants to run at ? |
I added this because it's only an extra value parsing, although I don't know how much this will be useful, as it seems that people mostly like to run games scaled to the largest resolutions more suitable for contemporary monitors. In regards to the new code, it seems generally working; I think applying legacy config need to be corrected, for compatibility, and winsetup program has to be adjusted. |
i see you've added some code to parse legacy config, which made me think about the plausible scenario that a user might want to use ags 3.5.x and 3.6.x in parallel (for example one engine version might have some issue with a specific game). ags 3.5. will probably not be happy if it encounters config in new format. would it make sense to give a new filename to new-style config ? such as acsetup2.cfg |
Currently I'm not reusing previously existing options, and the way engine reads config it ignores anything it is not interested in. But i guess that changing to a different filename remains an opportunity for the future if there's a bigger config remake (or we want to cleanup config). |
Leave only simple scaling styles that tell how to fill provided window (max integer, stretch to fill, etc). This does not cancel the scaling number in config, that is still valid and will be used to determine window size based on the game size.
Instead have a struct with just Size and Scale, and the actual mode will depend on what is set.
This is to allow users setting up and using explicit configs, rather than guessing what the preference for another may be based on the initial one.
I have one irritating issue left here; since I added "native" value which defines game's resolution, I've been thinking that it could make sense to also use special value to define current desktop resolution for window or exclusive fullscreen mode. Previously I used "desktop" to define the "FULLSCREEN_DESKTOP" mode. Now I wonder if there may be another good name for it, while "desktop" could be used to create desktop-sized exclusive mode or max fitting windowed mode. Or other way around - keep "desktop" for virtual fullscreen, but introduce new word for windowed/exclusive fullscreen mode. In the previous config there was "max" word used for that, but idk if it's convenient: then you'll have "max" for exclusive mode and "desktop" for the borderless window, which kind of look strange imo. |
maybe "stretch", "maxwin", "full" ? |
"borderless" for bordeless fullscreen? |
0013614
to
2b4046a
Compare
So, I did this: "desktop" value is used to define the window resolution, similar to "native", and "full_window" means the borderless window covering whole desktop. I'll leave it at that for now, but since 3.6.0 is still wip, this may change if nicer alternatives are found or this proves to be confusing to users. Note: had to rebase because there were bugs in the master. |
Instead of having several detached options that combined would result in a window size definition, there's now only 1 option (per mode) that contains all possible variants in a single string: * WxH - explicit window size (e.g. "1280x720"); * xS - integer game scaling factor (e.g. "x4"); * desktop - use current system's desktop resolution; ** in windowed mode will try to create largest possible resizing window, while keeping game scaling style (max stretch, proportional stretch or max integer multiplier); * native - use game's native resolution; * full_window - special option for the fullscreen mode, this means a borderless window covering whole desktop; * default - currently we default to (this is also a fallback option in case config parsing went wrong): ** in fullscreen mode to "full_window"; ** in windowed mode to "desktop"; In [graphics] section fullscreen mode is defined by the option "fullscreen" while the windowed mode is defined by the option "window".
2798757
to
fece610
Compare
This is another attempt at improving the way graphics mode is defined in user config. The existing one was made for AGS 3.4.0, and while it allows to freely setup (almost) any mode, there are annoying issues:
screen_def
,screen_width
,screen_height
, less usedmatch_device_ratio
, and if you want to get window of xN size of the game then you also have to put proper number in thegame_scale_win
option.screen_def
isscaling
thenscreen_width
andscreen_height
have to be ignored. Ifscreen_def
isexplicit
then it usesscreen_width
andscreen_height
, but if at the same timegame_scale_*
option is set to the scaling number, then the game may end up shown in a rectangle of smaller size inside the larger window.The new config style is meant to fix these issues. There are three changes:
window
andfullscreen
respectively. Both are read by the engine and used as defaults when the user toggles between the modes at runtime.game_scale_*
options now only define the scaling style (round
,stretch
andproportional
), but no longer define the scaling factor - that is derived from the window size.In [graphics] section fullscreen mode is defined by the option "fullscreen" while the windowed mode is defined by the option "window". These option may have following values:
The example of new config:
TODO:
Note that I called the windowed mode option "window", but that's mostly for backward compatibility with old configs which have "windowed" defining initial mode, that is "windowed=1/0".
But there's also a need to dinstinguish "desktop fullscreen" (a borderless window covering whole desktop) and "exclusive fullscreen" (for systems that support one), so that old option no longer suits us either. This is going to be changed next.