OSDN Git Service

16x16を選択する追加オプション -a と 8x8の -o を追加。
authormogami <mogami@0568b783-4c39-0410-ac80-bf13821ea2a2>
Wed, 13 Feb 2002 15:41:03 +0000 (15:41 +0000)
committermogami <mogami@0568b783-4c39-0410-ac80-bf13821ea2a2>
Wed, 13 Feb 2002 15:41:03 +0000 (15:41 +0000)
ついでに、スクリプトで $* -- -n1 等と書いているときに
スクリプトに -- -a とかを与えられるように。追加オプションの
区切り -- が複数あらわれてもエラーを出さないようにした。

src/main-x11.c

index 7d6eca3..86bf1e9 100644 (file)
@@ -2970,6 +2970,18 @@ errr init_x11(int argc, char *argv[])
                        smoothRescaling = FALSE;
                        continue;
                }
+
+               if (prefix(argv[i], "-a"))
+               {
+                       arg_graphics = GRAPHICS_ADAM_BOLT;
+                       continue;
+               }
+
+               if (prefix(argv[i], "-o"))
+               {
+                       arg_graphics = GRAPHICS_ORIGINAL;
+                       continue;
+               }
 #endif /* USE_GRAPHICS */
 
                if (prefix(argv[i], "-n"))
@@ -2980,6 +2992,12 @@ errr init_x11(int argc, char *argv[])
                        continue;
                }
 
+               if (prefix(argv[i], "--"))
+               {
+                       /* Ignore */
+                       continue;
+               }
+
                plog_fmt("Ignoring option: %s", argv[i]);
        }
 
@@ -3083,8 +3101,26 @@ errr init_x11(int argc, char *argv[])
 #ifdef USE_GRAPHICS
 
        /* Try graphics */
-       if (arg_graphics)
+       switch (arg_graphics)
        {
+       case GRAPHICS_ORIGINAL:
+               /* Try the "8x8.bmp" file */
+               path_build(filename, 1024, ANGBAND_DIR_XTRA, "graf/8x8.bmp");
+
+               /* Use the "8x8.bmp" file if it exists */
+               if (0 == fd_close(fd_open(filename, O_RDONLY)))
+               {
+                       /* Use graphics */
+                       use_graphics = TRUE;
+
+                       pict_wid = pict_hgt = 8;
+
+                       ANGBAND_GRAF = "old";
+                       break;
+               }
+               /* Fall through */
+
+       case GRAPHICS_ADAM_BOLT:
                /* Try the "16x16.bmp" file */
                path_build(filename, 1024, ANGBAND_DIR_XTRA, "graf/16x16.bmp");
 
@@ -3097,22 +3133,8 @@ errr init_x11(int argc, char *argv[])
                        pict_wid = pict_hgt = 16;
 
                        ANGBAND_GRAF = "new";
-               }
-               else
-               {
-                       /* Try the "8x8.bmp" file */
-                       path_build(filename, 1024, ANGBAND_DIR_XTRA, "graf/8x8.bmp");
-
-                       /* Use the "8x8.bmp" file if it exists */
-                       if (0 == fd_close(fd_open(filename, O_RDONLY)))
-                       {
-                               /* Use graphics */
-                               use_graphics = TRUE;
 
-                               pict_wid = pict_hgt = 8;
-
-                               ANGBAND_GRAF = "old";
-                       }
+                       break;
                }
        }