]> granicus.if.org Git - nethack/commitdiff
MSDOS/VESA: Add video_width and video_height
authorRay Chason <ray.chason@protonmail.com>
Sun, 26 Jan 2020 00:00:02 +0000 (19:00 -0500)
committerPasi Kallinen <paxed@alt.org>
Mon, 27 Jan 2020 07:54:58 +0000 (09:54 +0200)
To be used to set the video mode

include/flag.h
src/options.c

index 0cfd3dabc8446b3c60f709e1ffb4dac1b4b0508c..d92bd5dc8350a5b8bc56f7a95a7392652f595145 100644 (file)
@@ -367,6 +367,10 @@ struct instance_flags {
     int wc_map_mode;        /* specify map viewing options, mostly
                              * for backward compatibility */
     int wc_player_selection;    /* method of choosing character */
+#if defined(MSDOS)
+    unsigned wc_video_width;    /* X resolution of screen */
+    unsigned wc_video_height;   /* Y resolution of screen */
+#endif
     boolean wc_splash_screen;   /* display an opening splash screen or not */
     boolean wc_popup_dialog;    /* put queries in pop up dialogs instead of
                                  * in the message window */
index f6f572689b1f35a15a4ee5f76e2a6112bd917613..fb839b54080d7618d4f25e21fea040c35e1bf43a 100644 (file)
@@ -3349,8 +3349,31 @@ boolean tinitial, tfrom_file;
         return retval;
     }
 #endif /* VIDEOSHADES */
-
 #ifdef MSDOS
+    fullname = "video_width";
+    if (match_optname(opts, fullname, 7, TRUE)) {
+        if (duplicate)
+            complain_about_duplicate(opts, 1);
+        if (negated) {
+            bad_negation(fullname, FALSE);
+            return FALSE;
+        }
+        op = string_for_opt(opts, negated);
+        iflags.wc_video_width = strtol(op, NULL, 10);
+        return FALSE;
+    }
+    fullname = "video_height";
+    if (match_optname(opts, fullname, 7, TRUE)) {
+        if (duplicate)
+            complain_about_duplicate(opts, 1);
+        if (negated) {
+            bad_negation(fullname, FALSE);
+            return FALSE;
+        }
+        op = string_for_opt(opts, negated);
+        iflags.wc_video_height = strtol(op, NULL, 10);
+        return FALSE;
+    }
 #ifdef NO_TERMS
     /* video:string -- must be after longer tests */
     fullname = "video";