#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 */
{
/* 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);
}
}
/* Get a *new* song at random */
while (1)
{
- n = randint(song_number);
+ n = randint1(song_number);
if (n != current_song) break;
}
current_song = n;
{
/* Draw a black block */
rectfill(screen, x1, y1, x1 + w1 - 1, y1 + h1 - 1,
- COLOR_OFFSET + TERM_DARK);
+ COLOR_OFFSET + TERM_DARK);
}
/* Success */
/* Dump the text */
textout(screen, td->font, text, x1, y1,
- COLOR_OFFSET + (a & 0x0F));
+ COLOR_OFFSET + (a & 0x0F));
}
/* Stretch needed */
else
/* Dump some text */
textout(screen, td->font, text, x1, y1,
- COLOR_OFFSET + (a & 0x0F));
+ COLOR_OFFSET + (a & 0x0F));
/* Advance */
x1 += td->tile_wid;
* "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);
int x1, y1;
int x2, y2;
-
-# ifdef USE_TRANSPARENCY
-
int x3, y3;
-# endif /* USE_TRANSPARENCY */
-
/* Size */
w = td->tile_wid;
h = td->tile_hgt;
x2 = (cp[i] & 0x7F) * w;
y2 = (ap[i] & 0x7F) * h;
-# ifdef USE_TRANSPARENCY
x3 = (tcp[i] & 0x7F) * w;
y3 = (tap[i] & 0x7F) * h;
/* 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;
}
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);
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"))
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);
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)
*/
ANGBAND_GRAF = get_config_string(section, "graf-mode", "old");
- /* Use transparent blits */
- if (streq(ANGBAND_GRAF, "new"))
- use_transparency = TRUE;
-
/* Select the bitmap pallete */
set_palette_range(tiles_pallete, 0, COLOR_OFFSET - 1, 0);
#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);
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);
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])
#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);
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();