foxygit / doom Log in
commit 631baaaa1a91181ed96030ad4d965133228df535
Author:     Simon Howard <fraggle@gmail.com>
AuthorDate: Wed Feb 6 23:42:29 2008 +0000
Commit:     Simon Howard <fraggle@gmail.com>
CommitDate: Wed Feb 6 23:42:29 2008 +0000

    Add -geometry command line parameter to allow the screen size to be
    specified with one combined option.

    Subversion-branch: /trunk/chocolate-doom
    Subversion-revision: 1056
---
 src/i_video.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/src/i_video.c b/src/i_video.c
index f94b7192..98eb41ac 100644
--- a/src/i_video.c
+++ b/src/i_video.c
@@ -1201,6 +1201,7 @@ static void CheckCommandLine(void)

     //!
     // @category video
+    // @arg <x>
     //
     // Specify the screen width, in pixels.
     //
@@ -1214,6 +1215,7 @@ static void CheckCommandLine(void)

     //!
     // @category video
+    // @arg <y>
     //
     // Specify the screen height, in pixels.
     //
@@ -1225,6 +1227,26 @@ static void CheckCommandLine(void)
         screen_height = atoi(myargv[i + 1]);
     }

+    //!
+    // @category video
+    // @arg <WxY>
+    //
+    // Specify the screen mode (when running fullscreen) or the window
+    // dimensions (when running in windowed mode).
+
+    i = M_CheckParm("-geometry");
+
+    if (i > 0)
+    {
+        int w, h;
+
+        if (sscanf(myargv[i + 1], "%ix%i", &w, &h) == 2)
+        {
+            screen_width = w;
+            screen_height = h;
+        }
+    }
+
     //!
     // @category video
     //