summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Howard2014-10-21 20:48:19 -0400
committerSimon Howard2014-10-21 20:48:19 -0400
commit096b0da08c268da2077585398c7bb3d62453c69f (patch)
treea948a8c120bfefcfcf706a2c8781cc8714d24dbf
parentea3f2823472f3e68d6e0eba7e5acaf8fd4456337 (diff)
parentd88369c62e20083d42befda7e9ec9e1eac61ba71 (diff)
downloadchocolate-doom-096b0da08c268da2077585398c7bb3d62453c69f.tar.gz
chocolate-doom-096b0da08c268da2077585398c7bb3d62453c69f.tar.bz2
chocolate-doom-096b0da08c268da2077585398c7bb3d62453c69f.zip
Merge pull request #447 from chungy/master
allow -geometry to specify fullscreen or windowed modes, like PrBoom
-rw-r--r--src/i_video.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/i_video.c b/src/i_video.c
index b410a096..242f3ac5 100644
--- a/src/i_video.c
+++ b/src/i_video.c
@@ -1691,21 +1691,33 @@ void I_GraphicsCheckCommandLine(void)
//!
// @category video
- // @arg <WxY>
+ // @arg <WxY>[wf]
//
- // Specify the screen mode (when running fullscreen) or the window
- // dimensions (when running in windowed mode).
+ // Specify the dimensions of the window or fullscreen mode. An
+ // optional letter of w or f appended to the dimensions selects
+ // windowed or fullscreen mode.
i = M_CheckParmWithArgs("-geometry", 1);
if (i > 0)
{
- int w, h;
+ int w, h, s;
+ char f;
- if (sscanf(myargv[i + 1], "%ix%i", &w, &h) == 2)
+ s = sscanf(myargv[i + 1], "%ix%i%1c", &w, &h, &f);
+ if (s == 2 || s == 3)
{
screen_width = w;
screen_height = h;
+
+ if (s == 3 && f == 'f')
+ {
+ fullscreen = true;
+ }
+ else if (s == 3 && f == 'w')
+ {
+ fullscreen = false;
+ }
}
}