OSDN Git Service

[Refactor] #37353 型の置換(C_MAKE)。 / Type replacement(C_MAKE).
[hengband/hengband.git] / src / main-dos.c
index 6291095..cf21a9a 100644 (file)
@@ -1,4 +1,4 @@
-/* File: main-dos.c */
+/* File: main-dos.c */
 
 /*
  * Copyright (c) 1997 Ben Harrison, Robert Ruehlmann, and others
@@ -300,7 +300,7 @@ static void Term_init_dos(term *t);
 static void Term_nuke_dos(term *t);
 static void term_data_link(term_data *td);
 static void dos_dump_screen(void);
-static void dos_quit_hook(cptr str);
+static void dos_quit_hook(concptr str);
 static bool init_windows(void);
 errr init_dos(void);
 #ifdef USE_SOUND
@@ -310,11 +310,7 @@ static void play_song(void);
 #endif /* USE_SOUND */
 #ifdef USE_GRAPHICS
 static bool init_graphics(void);
-# ifdef USE_TRANSPARENCY
 static errr Term_pict_dos(int x, int y, int n, const byte *ap, const char *cp, const byte *tap, const char *tcp);
-# else /* USE_TRANSPARENCY */
-static errr Term_pict_dos(int x, int y, int n, const byte *ap, const char *cp);
-# endif /* USE_TRANSPARENCY */
 #endif /* USE_GRAPHICS */
 
 
@@ -616,7 +612,7 @@ static void Term_xtra_dos_clear(void)
        {
                /* Draw the Term black */
                rectfill(screen,
-                       x1, y1, x1 + w1 - 1, y1 + h1 - 1,
+                       x1, y1, x1 + w1 - 1, y1 + h1 - 1,
                        COLOR_OFFSET + TERM_DARK);
        }
 }
@@ -689,7 +685,7 @@ static errr Term_xtra_dos(int n, int v)
                                        /* Get a *new* song at random */
                                        while (1)
                                        {
-                                               n = randint(song_number);
+                                               n = randint1(song_number);
                                                if (n != current_song) break;
                                        }
                                        current_song = n;
@@ -1097,7 +1093,7 @@ static errr Term_wipe_dos(int x, int y, int n)
        {
                /* Draw a black block */
                rectfill(screen, x1, y1, x1 + w1 - 1, y1 + h1 - 1,
-                       COLOR_OFFSET + TERM_DARK);
+                       COLOR_OFFSET + TERM_DARK);
        }
 
        /* Success */
@@ -1147,7 +1143,7 @@ static errr Term_text_dos(int x, int y, int n, byte a, const char *cp)
 
                /* Dump the text */
                textout(screen, td->font, text, x1, y1,
-                       COLOR_OFFSET + (a & 0x0F));
+                       COLOR_OFFSET + (a & 0x0F));
        }
        /* Stretch needed */
        else
@@ -1163,7 +1159,7 @@ static errr Term_text_dos(int x, int y, int n, byte a, const char *cp)
 
                        /* Dump some text */
                        textout(screen, td->font, text, x1, y1,
-                               COLOR_OFFSET + (a & 0x0F));
+                               COLOR_OFFSET + (a & 0x0F));
 
                        /* Advance */
                        x1 += td->tile_wid;
@@ -1186,11 +1182,7 @@ static errr Term_text_dos(int x, int y, int n, byte a, const char *cp)
  * "ap[i]" and "cp[i]" values, but we must map the resulting value
  * onto the legal bitmap size, which is normally 32x32.  XXX XXX XXX
  */
-#ifdef USE_TRANSPARENCY
 static errr Term_pict_dos(int x, int y, int n, const byte *ap, const char *cp, const byte *tap, const char *tcp)
-#else /* USE_TRANSPARENCY */
-static errr Term_pict_dos(int x, int y, int n, const byte *ap, const char *cp)
-#endif /* USE_TRANSPARENCY */
 {
        term_data *td = (term_data*)(Term->data);
 
@@ -1200,13 +1192,8 @@ static errr Term_pict_dos(int x, int y, int n, const byte *ap, const char *cp)
 
        int x1, y1;
        int x2, y2;
-
-# ifdef USE_TRANSPARENCY
-
        int x3, y3;
 
-# endif /* USE_TRANSPARENCY */
-
        /* Size */
        w = td->tile_wid;
        h = td->tile_hgt;
@@ -1222,7 +1209,6 @@ static errr Term_pict_dos(int x, int y, int n, const byte *ap, const char *cp)
                x2 = (cp[i] & 0x7F) * w;
                y2 = (ap[i] & 0x7F) * h;
 
-# ifdef USE_TRANSPARENCY
                x3 = (tcp[i] & 0x7F) * w;
                y3 = (tap[i] & 0x7F) * h;
 
@@ -1232,13 +1218,6 @@ static errr Term_pict_dos(int x, int y, int n, const byte *ap, const char *cp)
                /* Blit the tile to the screen */
                masked_blit(td->tiles, screen, x2, y2, x1, y1, w, h);
 
-# else /* USE_TRANSPARENCY */
-
-               /* Blit the tile to the screen */
-               blit(td->tiles, screen, x2, y2, x1, y1, w, h);
-
-# endif /* USE_TRANSPARENCY */
-
                /* Advance (window) */
                x1 += w;
        }
@@ -1331,7 +1310,7 @@ static void term_data_link(term_data *td)
 /*
  * Shut down visual system, then fall back into standard "quit()"
  */
-static void dos_quit_hook(cptr str)
+static void dos_quit_hook(concptr str)
 {
        int i;
 
@@ -1411,7 +1390,7 @@ static void dos_dump_screen(void)
        get_palette(pal);
 
        /* Build the filename for the screen-dump */
-       path_build(filename, 1024, ANGBAND_DIR_USER, "dump.bmp");
+       path_build(filename, sizeof(filename), ANGBAND_DIR_USER, "dump.bmp");
 
        /* Save it */
        save_bmp(filename, bmp, pal);
@@ -1675,7 +1654,7 @@ static bool init_windows(void)
                strcpy(buf, get_config_string(section, "font_file", "xm8x13.fnt"));
 
                /* Build the name of the font file */
-               path_build(filename, 1024, xtra_font_dir, buf);
+               path_build(filename, sizeof(filename), xtra_font_dir, buf);
 
                /* Load a "*.fnt" file */
                if (suffix(filename, ".fnt"))
@@ -1743,7 +1722,7 @@ static void init_background(void)
                strcpy(buf, get_config_string("Background", format("Background-%d", i), ""));
 
                /* Build the filename for the background-bitmap */
-               path_build(filename, 1024, xtra_graf_dir, buf);
+               path_build(filename, sizeof(filename), xtra_graf_dir, buf);
 
                /* Try to open the bitmap file */
                background[i] = load_bitmap(filename, background_pallete);
@@ -1800,7 +1779,7 @@ static bool init_graphics(void)
                num_windows = get_config_int(section, "num_windows", 1);
 
                /* Build the name of the bitmap file */
-               path_build(filename, 1024, xtra_graf_dir, name_tiles);
+               path_build(filename, sizeof(filename), xtra_graf_dir, name_tiles);
 
                /* Open the bitmap file */
                if ((tiles = load_bitmap(filename, tiles_pallete)) != NULL)
@@ -1913,7 +1892,7 @@ static bool init_sound(void)
 #endif /* USE_MOD_FILES */
 
                /* Access the new sample */
-               path_build(filename, 1024, xtra_sound_dir, "sound.cfg");
+               path_build(filename, sizeof(filename), xtra_sound_dir, "sound.cfg");
 
                /* Read config info from "lib/xtra/sound/sound.cfg" */
                override_config_file(filename);
@@ -1933,7 +1912,7 @@ static bool init_sound(void)
                        for (j = 0; j < sample_count[i]; j++)
                        {
                                /* Access the new sample */
-                               path_build(filename, 1024, xtra_sound_dir, argv[j]);
+                               path_build(filename, sizeof(filename), xtra_sound_dir, argv[j]);
 
                                /* Load the sample */
                                samples[i][j] = load_sample(filename);
@@ -2000,7 +1979,7 @@ static errr Term_xtra_dos_sound(int v)
        if ((v < 0) || (v >= SOUND_MAX)) return (1);
 
        /* Get a random sample from the available ones */
-       n = rand_int(sample_count[v]);
+       n = randint0(sample_count[v]);
 
        /* Play the sound, catch errors */
        if (samples[v][n])
@@ -2033,7 +2012,7 @@ static void play_song(void)
 #endif /* USE_MOD_FILES */
 
        /* Access the new song */
-       path_build(filename, 1024, xtra_music_dir, music_files[current_song - 1]);
+       path_build(filename, sizeof(filename), xtra_music_dir, music_files[current_song - 1]);
 
        /* Load and play the new song */
        midi_song = load_midi(filename);
@@ -2133,16 +2112,16 @@ errr init_dos(void)
        quit_aux = dos_quit_hook;
 
        /* Build the "graf" path */
-       path_build(xtra_graf_dir, 1024, ANGBAND_DIR_XTRA, "graf");
+       path_build(xtra_graf_dir, sizeof(xtra_graf_dir), ANGBAND_DIR_XTRA, "graf");
 
        /* Build the "font" path */
-       path_build(xtra_font_dir, 1024, ANGBAND_DIR_XTRA, "font");
+       path_build(xtra_font_dir, sizeof(xtra_font_dir), ANGBAND_DIR_XTRA, "font");
 
        /* Build the "sound" path */
-       path_build(xtra_sound_dir, 1024, ANGBAND_DIR_XTRA, "sound");
+       path_build(xtra_sound_dir, sizeof(xtra_sound_dir), ANGBAND_DIR_XTRA, "sound");
 
        /* Build the "music" path */
-       path_build(xtra_music_dir, 1024, ANGBAND_DIR_XTRA, "music");
+       path_build(xtra_music_dir, sizeof(xtra_music_dir), ANGBAND_DIR_XTRA, "music");
 
        /* Initialize the windows */
        init_windows();