mirror of
https://github.com/libretro/scummvm.git
synced 2025-04-02 14:51:40 +00:00
BASE: Implemented --window-size command line option
This commit is contained in:
parent
d7ea2efd3a
commit
06794e48c6
2
NEWS.md
2
NEWS.md
@ -32,6 +32,8 @@ For a more comprehensive changelog of the latest experimental code, see:
|
||||
- Display path to scummvm configuration file in GUI -> Options -> Paths.
|
||||
- Added new optional dependency, giflib >= 5.0.0. Used by some version of LBA.
|
||||
- Added HiDPI support to the ScummVM GUI.
|
||||
- Added command line option --window-size for specifying ScummVM window size,
|
||||
applicable only to the OpenGL renderer.
|
||||
|
||||
AGOS:
|
||||
- Added support for the Japanese PC-98 version of Elvira 1.
|
||||
|
@ -104,6 +104,10 @@ static const char HELP_STRING[] =
|
||||
" --stretch-mode=MODE Select stretch mode (center, integral, fit, stretch)\n"
|
||||
" --filtering Force filtered graphics mode\n"
|
||||
" --no-filtering Force unfiltered graphics mode\n"
|
||||
#ifdef USE_OPENGL
|
||||
" --window-size=W,H Set the ScummVM window size to the specified dimensions\n"
|
||||
" (OpenGL only)\n"
|
||||
#endif
|
||||
" --gui-theme=THEME Select GUI theme\n"
|
||||
" --themepath=PATH Path to where GUI themes are stored\n"
|
||||
" --list-themes Display list of all usable GUI themes\n"
|
||||
@ -607,6 +611,25 @@ Common::String parseCommandLine(Common::StringMap &settings, int argc, const cha
|
||||
DO_LONG_OPTION_BOOL("filtering")
|
||||
END_OPTION
|
||||
|
||||
#ifdef USE_OPENGL
|
||||
DO_LONG_OPTION("window-size")
|
||||
Common::StringTokenizer tokenizer(option, ",");
|
||||
if (tokenizer.empty())
|
||||
usage("Invalid window format specified: %s", option);
|
||||
Common::String w = tokenizer.nextToken();
|
||||
if (tokenizer.empty())
|
||||
usage("Invalid window format specified: %s", option);
|
||||
Common::String h = tokenizer.nextToken();
|
||||
|
||||
if (atoi(w.c_str()) == 0 || atoi(h.c_str()) == 0)
|
||||
usage("Invalid window format specified: %s", option);
|
||||
|
||||
settings["last_window_width"] = w;
|
||||
settings["last_window_height"] = h;
|
||||
settings.erase("window_size");
|
||||
END_OPTION
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_EVENTRECORDER
|
||||
DO_LONG_OPTION_INT("disable-display")
|
||||
END_OPTION
|
||||
|
@ -469,6 +469,12 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) {
|
||||
ConfMan.registerDefault("dump_midi", true);
|
||||
}
|
||||
|
||||
#ifdef USE_OPENGL
|
||||
if (settings.contains("last_window_width")) {
|
||||
ConfMan.setInt("last_window_width", atoi(settings["last_window_width"].c_str()));
|
||||
ConfMan.setInt("last_window_height", atoi(settings["last_window_height"].c_str()));
|
||||
}
|
||||
#endif
|
||||
|
||||
// Init the backend. Must take place after all config data (including
|
||||
// the command line params) was read.
|
||||
|
Loading…
x
Reference in New Issue
Block a user