shithub: choc

Download patch

ref: 631baaaa1a91181ed96030ad4d965133228df535
parent: 85b1dacd10a913c4988fa62251c4553e8d19ca98
author: Simon Howard <[email protected]>
date: Wed Feb 6 18:42:29 EST 2008

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

--- a/src/i_video.c
+++ b/src/i_video.c
@@ -1201,6 +1201,7 @@
 
     //!
     // @category video
+    // @arg <x>
     //
     // Specify the screen width, in pixels.
     //
@@ -1214,6 +1215,7 @@
 
     //!
     // @category video
+    // @arg <y>
     //
     // Specify the screen height, in pixels.
     //
@@ -1223,6 +1225,26 @@
     if (i > 0)
     {
         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;
+        }
     }
 
     //!