[client] Add win:maximize to maximize on startup

This commit is contained in:
Jonathan (JJRcop) Rubenstein 2019-05-26 02:30:24 -04:00 committed by Geoffrey McRae
parent 9f33043d17
commit d07aa4b29e
5 changed files with 16 additions and 4 deletions

View File

@ -1 +1 @@
B1-rc1-0-g83c5df2c47+1 B1-rc2-1-g9f33043d17+1

View File

@ -98,6 +98,7 @@ Command line arguments will override any options loaded from the config files.
| win:keepAspect | -r | yes | Maintain the correct aspect ratio | | win:keepAspect | -r | yes | Maintain the correct aspect ratio |
| win:borderless | -d | no | Borderless mode | | win:borderless | -d | no | Borderless mode |
| win:fullScreen | -F | no | Launch in fullscreen borderless mode | | win:fullScreen | -F | no | Launch in fullscreen borderless mode |
| win:maximize | -T | no | Launch window maximized |
| win:fpsLimit | -K | 200 | Frame rate limit (0 = disable - not recommended) | | win:fpsLimit | -K | 200 | Frame rate limit (0 = disable - not recommended) |
| win:showFPS | -k | no | Enable the FPS & UPS display | | win:showFPS | -k | no | Enable the FPS & UPS display |
| win:ignoreQuit | -Q | no | Ignore requests to quit (ie: Alt+F4) | | win:ignoreQuit | -Q | no | Ignore requests to quit (ie: Alt+F4) |

View File

@ -167,6 +167,14 @@ static struct Option options[] =
.type = OPTION_TYPE_BOOL, .type = OPTION_TYPE_BOOL,
.value.x_bool = false, .value.x_bool = false,
}, },
{
.module = "win",
.name = "maximize",
.description = "Launch window maximized",
.shortopt = 'T',
.type = OPTION_TYPE_BOOL,
.value.x_bool = false,
},
{ {
.module = "win", .module = "win",
.name = "fpsLimit", .name = "fpsLimit",
@ -376,6 +384,7 @@ bool config_load(int argc, char * argv[])
params.keepAspect = option_get_bool ("win", "keepAspect" ); params.keepAspect = option_get_bool ("win", "keepAspect" );
params.borderless = option_get_bool ("win", "borderless" ); params.borderless = option_get_bool ("win", "borderless" );
params.fullscreen = option_get_bool ("win", "fullScreen" ); params.fullscreen = option_get_bool ("win", "fullScreen" );
params.maximize = option_get_bool ("win", "maximize" );
params.fpsLimit = option_get_int ("win", "fpsLimit" ); params.fpsLimit = option_get_int ("win", "fpsLimit" );
params.showFPS = option_get_bool ("win", "showFPS" ); params.showFPS = option_get_bool ("win", "showFPS" );
params.ignoreQuit = option_get_bool ("win", "ignoreQuit" ); params.ignoreQuit = option_get_bool ("win", "ignoreQuit" );
@ -550,4 +559,4 @@ static char * optScancodeToString(struct Option * opt)
char * str; char * str;
alloc_sprintf(&str, "%d = %s", opt->value.x_int, SDL_GetScancodeName(opt->value.x_int)); alloc_sprintf(&str, "%d = %s", opt->value.x_int, SDL_GetScancodeName(opt->value.x_int));
return str; return str;
} }

View File

@ -1055,6 +1055,7 @@ int run()
(params.fullscreen ? SDL_WINDOW_FULLSCREEN_DESKTOP : 0) | (params.fullscreen ? SDL_WINDOW_FULLSCREEN_DESKTOP : 0) |
(params.allowResize ? SDL_WINDOW_RESIZABLE : 0) | (params.allowResize ? SDL_WINDOW_RESIZABLE : 0) |
(params.borderless ? SDL_WINDOW_BORDERLESS : 0) | (params.borderless ? SDL_WINDOW_BORDERLESS : 0) |
(params.maximize ? SDL_WINDOW_MAXIMIZED : 0) |
sdlFlags sdlFlags
) )
); );
@ -1337,4 +1338,4 @@ int main(int argc, char * argv[])
config_free(); config_free();
return ret; return ret;
} }

View File

@ -80,6 +80,7 @@ struct AppParams
bool keepAspect; bool keepAspect;
bool borderless; bool borderless;
bool fullscreen; bool fullscreen;
bool maximize;
bool center; bool center;
int x, y; int x, y;
unsigned int w, h; unsigned int w, h;
@ -127,4 +128,4 @@ struct KeybindHandle
// forwards // forwards
extern struct AppState state; extern struct AppState state;
extern struct AppParams params; extern struct AppParams params;