/* setup file functions */
/* ========================================================================= */
-#define TOKEN_STR_PLAYER_PREFIX "player_"
+#define TOKEN_STR_PLAYER_PREFIX "player_"
/* global setup */
-#define SETUP_TOKEN_PLAYER_NAME 0
-#define SETUP_TOKEN_SOUND 1
-#define SETUP_TOKEN_SOUND_LOOPS 2
-#define SETUP_TOKEN_SOUND_MUSIC 3
-#define SETUP_TOKEN_SOUND_SIMPLE 4
-#define SETUP_TOKEN_TOONS 5
-#define SETUP_TOKEN_SCROLL_DELAY 6
-#define SETUP_TOKEN_SOFT_SCROLLING 7
-#define SETUP_TOKEN_FADING 8
-#define SETUP_TOKEN_AUTORECORD 9
-#define SETUP_TOKEN_QUICK_DOORS 10
-#define SETUP_TOKEN_TEAM_MODE 11
-#define SETUP_TOKEN_HANDICAP 12
-#define SETUP_TOKEN_TIME_LIMIT 13
-#define SETUP_TOKEN_FULLSCREEN 14
-#define SETUP_TOKEN_ASK_ON_ESCAPE 15
-#define SETUP_TOKEN_GRAPHICS_SET 16
-#define SETUP_TOKEN_SOUNDS_SET 17
-#define SETUP_TOKEN_MUSIC_SET 18
-
-#define NUM_GLOBAL_SETUP_TOKENS 19
+#define SETUP_TOKEN_PLAYER_NAME 0
+#define SETUP_TOKEN_SOUND 1
+#define SETUP_TOKEN_SOUND_LOOPS 2
+#define SETUP_TOKEN_SOUND_MUSIC 3
+#define SETUP_TOKEN_SOUND_SIMPLE 4
+#define SETUP_TOKEN_TOONS 5
+#define SETUP_TOKEN_SCROLL_DELAY 6
+#define SETUP_TOKEN_SOFT_SCROLLING 7
+#define SETUP_TOKEN_FADING 8
+#define SETUP_TOKEN_AUTORECORD 9
+#define SETUP_TOKEN_QUICK_DOORS 10
+#define SETUP_TOKEN_TEAM_MODE 11
+#define SETUP_TOKEN_HANDICAP 12
+#define SETUP_TOKEN_TIME_LIMIT 13
+#define SETUP_TOKEN_FULLSCREEN 14
+#define SETUP_TOKEN_ASK_ON_ESCAPE 15
+#define SETUP_TOKEN_GRAPHICS_SET 16
+#define SETUP_TOKEN_SOUNDS_SET 17
+#define SETUP_TOKEN_MUSIC_SET 18
+#define SETUP_TOKEN_OVERRIDE_LEVEL_GRAPHICS 19
+#define SETUP_TOKEN_OVERRIDE_LEVEL_SOUNDS 20
+#define SETUP_TOKEN_OVERRIDE_LEVEL_MUSIC 21
+
+#define NUM_GLOBAL_SETUP_TOKENS 22
/* shortcut setup */
-#define SETUP_TOKEN_SAVE_GAME 0
-#define SETUP_TOKEN_LOAD_GAME 1
-#define SETUP_TOKEN_TOGGLE_PAUSE 2
+#define SETUP_TOKEN_SAVE_GAME 0
+#define SETUP_TOKEN_LOAD_GAME 1
+#define SETUP_TOKEN_TOGGLE_PAUSE 2
-#define NUM_SHORTCUT_SETUP_TOKENS 3
+#define NUM_SHORTCUT_SETUP_TOKENS 3
/* player setup */
-#define SETUP_TOKEN_USE_JOYSTICK 0
-#define SETUP_TOKEN_JOY_DEVICE_NAME 1
-#define SETUP_TOKEN_JOY_XLEFT 2
-#define SETUP_TOKEN_JOY_XMIDDLE 3
-#define SETUP_TOKEN_JOY_XRIGHT 4
-#define SETUP_TOKEN_JOY_YUPPER 5
-#define SETUP_TOKEN_JOY_YMIDDLE 6
-#define SETUP_TOKEN_JOY_YLOWER 7
-#define SETUP_TOKEN_JOY_SNAP 8
-#define SETUP_TOKEN_JOY_BOMB 9
-#define SETUP_TOKEN_KEY_LEFT 10
-#define SETUP_TOKEN_KEY_RIGHT 11
-#define SETUP_TOKEN_KEY_UP 12
-#define SETUP_TOKEN_KEY_DOWN 13
-#define SETUP_TOKEN_KEY_SNAP 14
-#define SETUP_TOKEN_KEY_BOMB 15
-
-#define NUM_PLAYER_SETUP_TOKENS 16
+#define SETUP_TOKEN_USE_JOYSTICK 0
+#define SETUP_TOKEN_JOY_DEVICE_NAME 1
+#define SETUP_TOKEN_JOY_XLEFT 2
+#define SETUP_TOKEN_JOY_XMIDDLE 3
+#define SETUP_TOKEN_JOY_XRIGHT 4
+#define SETUP_TOKEN_JOY_YUPPER 5
+#define SETUP_TOKEN_JOY_YMIDDLE 6
+#define SETUP_TOKEN_JOY_YLOWER 7
+#define SETUP_TOKEN_JOY_SNAP 8
+#define SETUP_TOKEN_JOY_BOMB 9
+#define SETUP_TOKEN_KEY_LEFT 10
+#define SETUP_TOKEN_KEY_RIGHT 11
+#define SETUP_TOKEN_KEY_UP 12
+#define SETUP_TOKEN_KEY_DOWN 13
+#define SETUP_TOKEN_KEY_SNAP 14
+#define SETUP_TOKEN_KEY_BOMB 15
+
+#define NUM_PLAYER_SETUP_TOKENS 16
static struct SetupInfo si;
static struct SetupShortcutInfo ssi;
{ TYPE_STRING, &si.graphics_set, "graphics_set" },
{ TYPE_STRING, &si.sounds_set, "sounds_set" },
{ TYPE_STRING, &si.music_set, "music_set" },
+ { TYPE_SWITCH, &si.override_level_graphics, "override_level_graphics" },
+ { TYPE_SWITCH, &si.override_level_sounds, "override_level_sounds" },
+ { TYPE_SWITCH, &si.override_level_music, "override_level_music" },
};
static struct TokenInfo shortcut_setup_tokens[] =
{
/* shortcut setup */
- { TYPE_KEY_X11, &ssi.save_game, "shortcut.save_game" },
- { TYPE_KEY_X11, &ssi.load_game, "shortcut.load_game" },
- { TYPE_KEY_X11, &ssi.toggle_pause, "shortcut.toggle_pause" }
+ { TYPE_KEY_X11, &ssi.save_game, "shortcut.save_game" },
+ { TYPE_KEY_X11, &ssi.load_game, "shortcut.load_game" },
+ { TYPE_KEY_X11, &ssi.toggle_pause, "shortcut.toggle_pause" }
};
static struct TokenInfo player_setup_tokens[] =
si->graphics_set = getStringCopy(GRAPHICS_SUBDIR);
si->sounds_set = getStringCopy(SOUNDS_SUBDIR);
si->music_set = getStringCopy(MUSIC_SUBDIR);
+ si->override_level_graphics = FALSE;
+ si->override_level_sounds = FALSE;
+ si->override_level_music = FALSE;
si->shortcut.save_game = DEFAULT_KEY_SAVE_GAME;
si->shortcut.load_game = DEFAULT_KEY_LOAD_GAME;
void ReloadCustomArtwork()
{
- if (artwork.graphics_set_current != artwork.gfx_current->name)
+ static char *leveldir_current_name = NULL;
+ static boolean last_override_level_graphics = FALSE;
+ static boolean last_override_level_sounds = FALSE;
+ static boolean last_override_level_music = FALSE;
+
+ if (leveldir_current_name != leveldir_current->name)
+ {
+ /* force reload of custom artwork after new level series was selected */
+ artwork.graphics_set_current_name = NULL;
+ artwork.sounds_set_current_name = NULL;
+ artwork.music_set_current_name = NULL;
+
+ leveldir_current_name = leveldir_current->name;
+ }
+
+ if (artwork.graphics_set_current_name != artwork.gfx_current->name ||
+ last_override_level_graphics != setup.override_level_graphics)
{
int i;
SetDoorState(DOOR_OPEN_1 | DOOR_CLOSE_2);
- artwork.graphics_set_current = artwork.gfx_current->name;
+ artwork.graphics_set_current_name = artwork.gfx_current->name;
+ last_override_level_graphics = setup.override_level_graphics;
}
- if (artwork.sounds_set_current != artwork.snd_current->name)
+ if (artwork.sounds_set_current_name != artwork.snd_current->name ||
+ last_override_level_sounds != setup.override_level_sounds)
{
InitReloadSounds(artwork.snd_current->name);
- artwork.sounds_set_current = artwork.snd_current->name;
+ artwork.sounds_set_current_name = artwork.snd_current->name;
+ last_override_level_sounds = setup.override_level_sounds;
}
- if (artwork.music_set_current != artwork.mus_current->name)
+ if (artwork.music_set_current_name != artwork.mus_current->name ||
+ last_override_level_music != setup.override_level_music)
{
InitReloadMusic(artwork.mus_current->name);
- artwork.music_set_current = artwork.mus_current->name;
+ artwork.music_set_current_name = artwork.mus_current->name;
+ last_override_level_music = setup.override_level_music;
}
}
{
boolean do_busy_waiting = (milliseconds_delay < 5 ? TRUE : FALSE);
+#if 0
#if defined(PLATFORM_MSDOS)
/* don't use select() to perform waiting operations under DOS
environment; always use a busy loop for waiting instead */
do_busy_waiting = TRUE;
+#endif
#endif
if (do_busy_waiting)
{
#if defined(TARGET_SDL)
SDL_Delay(milliseconds_delay);
+#elif defined(TARGET_ALLEGRO)
+ rest(milliseconds_delay);
#else
struct timeval delay;
boolean FileIsMusic(char *basename)
{
+ /* "music" can be a WAV (loop) file or (if compiled with SDL) a MOD file */
+
+ if (FileIsSound(basename))
+ return TRUE;
+
+#if defined(TARGET_SDL)
if (strlen(basename) > 4 &&
(strcmp(&basename[strlen(basename) - 4], ".mod") == 0 ||
strcmp(&basename[strlen(basename) - 4], ".MOD") == 0 ||
strncmp(basename, "mod.", 4) == 0 ||
strncmp(basename, "MOD.", 4) == 0))
return TRUE;
+#endif
return FALSE;
}
basename = getCorrectedImageBasename(basename);
- /* 1st try: look for special artwork in current level series directory */
- filename = getPath3(getCurrentLevelDir(), GRAPHICS_DIRECTORY, basename);
- if (fileExists(filename))
- return filename;
-
- /* 2nd try: look for special artwork in private artwork directory */
- filename = getPath2(getUserGraphicsDir(), basename);
- if (fileExists(filename))
- return filename;
+ if (!setup.override_level_graphics)
+ {
+ /* 1st try: look for special artwork in current level series directory */
+ filename = getPath3(getCurrentLevelDir(), GRAPHICS_DIRECTORY, basename);
+ if (fileExists(filename))
+ return filename;
+ }
- /* 3rd try: look for special artwork in configured artwork directory */
+ /* 2nd try: look for special artwork in configured artwork directory */
filename = getPath2(getSetupArtworkDir(artwork.gfx_current), basename);
if (fileExists(filename))
return filename;
- /* 4th try: look for default artwork in new default artwork directory */
+ /* 3rd try: look for default artwork in new default artwork directory */
filename = getPath2(getDefaultGraphicsDir(GRAPHICS_SUBDIR), basename);
if (fileExists(filename))
return filename;
- /* 5th try: look for default artwork in old default artwork directory */
+ /* 4th try: look for default artwork in old default artwork directory */
filename = getPath2(options.graphics_directory, basename);
if (fileExists(filename))
return filename;
- return NULL; /* cannot find image file */
+ return NULL; /* cannot find specified artwork file anywhere */
}
char *getCustomSoundFilename(char *basename)
if (filename != NULL)
free(filename);
-#if 0
- /* 1st try: look for special artwork in current level series directory */
- filename = getPath3(getCurrentLevelDir(), SOUNDS_DIRECTORY, basename);
- if (fileExists(filename))
- return filename;
-#endif
-
-#if 0
- /* 2nd try: look for special artwork in private artwork directory */
- filename = getPath2(getUserSoundsDir(), basename);
- if (fileExists(filename))
- return filename;
-#endif
+ if (!setup.override_level_sounds)
+ {
+ /* 1st try: look for special artwork in current level series directory */
+ filename = getPath3(getCurrentLevelDir(), SOUNDS_DIRECTORY, basename);
+ if (fileExists(filename))
+ return filename;
+ }
- /* 3rd try: look for special artwork in configured artwork directory */
+ /* 2nd try: look for special artwork in configured artwork directory */
filename = getPath2(getSetupArtworkDir(artwork.snd_current), basename);
if (fileExists(filename))
return filename;
- /* 4th try: look for default artwork in new default artwork directory */
+ /* 3rd try: look for default artwork in new default artwork directory */
filename = getPath2(getDefaultSoundsDir(SOUNDS_SUBDIR), basename);
if (fileExists(filename))
return filename;
- /* 5th try: look for default artwork in old default artwork directory */
+ /* 4th try: look for default artwork in old default artwork directory */
filename = getPath2(options.sounds_directory, basename);
if (fileExists(filename))
return filename;
- return NULL; /* cannot find image file */
+ return NULL; /* cannot find specified artwork file anywhere */
}
char *getCustomSoundConfigFilename()
if (directory != NULL)
free(directory);
- /* 1st try: look for special artwork in current level series directory */
- directory = getPath2(getCurrentLevelDir(), MUSIC_DIRECTORY);
- if (fileExists(directory))
- return directory;
-
- /* 2nd try: look for special artwork in private artwork directory */
- directory = getStringCopy(getUserMusicDir());
- if (fileExists(directory))
- return directory;
+ if (!setup.override_level_music)
+ {
+ /* 1st try: look for special artwork in current level series directory */
+ directory = getPath2(getCurrentLevelDir(), MUSIC_DIRECTORY);
+ if (fileExists(directory))
+ return directory;
+ }
- /* 3rd try: look for special artwork in configured artwork directory */
+ /* 2nd try: look for special artwork in configured artwork directory */
directory = getStringCopy(getSetupArtworkDir(artwork.mus_current));
if (fileExists(directory))
return directory;
- /* 4th try: look for default artwork in new default artwork directory */
+ /* 3rd try: look for default artwork in new default artwork directory */
directory = getStringCopy(getDefaultMusicDir(MUSIC_SUBDIR));
if (fileExists(directory))
return directory;
- /* 5th try: look for default artwork in old default artwork directory */
+ /* 4th try: look for default artwork in old default artwork directory */
directory = getStringCopy(options.music_directory);
if (fileExists(directory))
return directory;
- return NULL; /* cannot find image file */
+ return NULL; /* cannot find specified artwork file anywhere */
}
void InitTapeDirectory(char *level_subdir)
if (artwork.mus_current == NULL)
artwork.mus_current = getFirstValidTreeInfoEntry(artwork.mus_first);
- artwork.graphics_set_current = artwork.gfx_current->name;
- artwork.sounds_set_current = artwork.snd_current->name;
- artwork.music_set_current = artwork.mus_current->name;
+ artwork.graphics_set_current_name = artwork.gfx_current->name;
+ artwork.sounds_set_current_name = artwork.snd_current->name;
+ artwork.music_set_current_name = artwork.mus_current->name;
#if 0
- printf("graphics set == %s\n\n", artwork.graphics_set_current);
- printf("sounds set == %s\n\n", artwork.sounds_set_current);
- printf("music set == %s\n\n", artwork.music_set_current);
+ printf("graphics set == %s\n\n", artwork.graphics_set_current_name);
+ printf("sounds set == %s\n\n", artwork.sounds_set_current_name);
+ printf("music set == %s\n\n", artwork.music_set_current_name);
#endif
sortTreeInfo(&artwork.gfx_first, compareTreeInfoEntries);
{
static char value_string[MAX_LINE_LEN];
+ if (value == NULL)
+ return NULL;
+
switch (type)
{
case TYPE_BOOLEAN:
unsigned long str_size1 = strlen(leveldir_current->fullpath) + 1;
unsigned long str_size2 = strlen(ti->basepath) + 1;
unsigned long str_size3 = strlen(ti->fullpath) + 1;
+ boolean override_level_artwork = (type == SND_CTRL_RELOAD_SOUNDS ?
+ setup.override_level_sounds :
+ setup.override_level_music);
if (IS_CHILD_PROCESS(audio.mixer_pid))
return;
sizeof(snd_ctrl)) < 0 ||
write(audio.mixer_pipe[1], set_name,
snd_ctrl.data_len) < 0 ||
+ write(audio.mixer_pipe[1], &override_level_artwork,
+ sizeof(boolean)) < 0 ||
write(audio.mixer_pipe[1], leveldir_current,
sizeof(TreeInfo)) < 0 ||
write(audio.mixer_pipe[1], ti,
TreeInfo *ti = *ti_ptr;
unsigned long str_size1, str_size2, str_size3;
static char *set_name = NULL;
+ boolean *override_level_artwork = (snd_ctrl->state & SND_CTRL_RELOAD_SOUNDS ?
+ &setup.override_level_sounds :
+ &setup.override_level_music);
if (set_name)
free(set_name);
if (read(audio.mixer_pipe[0], set_name,
snd_ctrl->data_len) != snd_ctrl->data_len ||
+ read(audio.mixer_pipe[0], override_level_artwork,
+ sizeof(boolean)) != sizeof(boolean) ||
read(audio.mixer_pipe[0], leveldir_current,
sizeof(TreeInfo)) != sizeof(TreeInfo) ||
read(audio.mixer_pipe[0], ti,
Error(ERR_EXIT_SOUND_SERVER, "broken pipe -- no sounds");
if (snd_ctrl->state & SND_CTRL_RELOAD_SOUNDS)
- artwork.sounds_set_current = set_name;
+ artwork.sounds_set_current_name = set_name;
else
- artwork.music_set_current = set_name;
+ artwork.music_set_current_name = set_name;
}
#endif /* AUDIO_UNIX_NATIVE */
void LoadCustomMusic(void)
{
static boolean draw_init_text = TRUE; /* only draw at startup */
+ static char *last_music_directory = NULL;
char *music_directory = getCustomMusicDirectory();
DIR *dir;
struct dirent *dir_entry;
if (!audio.sound_available)
return;
+ if (last_music_directory != NULL &&
+ strcmp(last_music_directory, music_directory) == 0)
+ return; /* old and new music directory are the same */
+
+ last_music_directory = music_directory;
+
+ FreeAllMusic();
+
if ((dir = opendir(music_directory)) == NULL)
{
Error(ERR_WARN, "cannot read music directory '%s'", music_directory);
int i;
#if 0
- printf("DEBUG: reloading sounds '%s' ...\n", artwork.sounds_set_current);
+ printf("DEBUG: reloading sounds '%s' ...\n",artwork.sounds_set_current_name);
#endif
LoadSoundsInfo();
static void ReloadCustomMusic()
{
#if 0
- printf("DEBUG: reloading music '%s' ...\n", artwork.music_set_current);
+ printf("DEBUG: reloading music '%s' ...\n", artwork.music_set_current_name);
#endif
+#if 0
+ /* this is done directly in LoadCustomMusic() now */
FreeAllMusic();
+#endif
LoadCustomMusic();
}
char *graphics_set;
char *sounds_set;
char *music_set;
+ boolean override_level_graphics;
+ boolean override_level_sounds;
+ boolean override_level_music;
struct SetupShortcutInfo shortcut;
struct SetupInputInfo input[MAX_PLAYERS];
MusicDirTree *mus_first;
MusicDirTree *mus_current;
- char *graphics_set_current;
- char *sounds_set_current;
- char *music_set_current;
+ char *graphics_set_current_name;
+ char *sounds_set_current_name;
+ char *music_set_current_name;
};
/* screens in the setup menu */
#define SETUP_MODE_MAIN 0
-#define SETUP_MODE_INPUT 1
-#define SETUP_MODE_SHORTCUT 2
-#define SETUP_MODE_GRAPHICS 3
-#define SETUP_MODE_SOUND 4
-#define SETUP_MODE_CHOOSE_GRAPHICS 5
-#define SETUP_MODE_CHOOSE_SOUNDS 6
-#define SETUP_MODE_CHOOSE_MUSIC 7
-
-#define MAX_SETUP_MODES 8
+#define SETUP_MODE_GAME 1
+#define SETUP_MODE_INPUT 2
+#define SETUP_MODE_SHORTCUT 3
+#define SETUP_MODE_GRAPHICS 4
+#define SETUP_MODE_SOUND 5
+#define SETUP_MODE_ARTWORK 6
+#define SETUP_MODE_CHOOSE_GRAPHICS 7
+#define SETUP_MODE_CHOOSE_SOUNDS 8
+#define SETUP_MODE_CHOOSE_MUSIC 9
+
+#define MAX_SETUP_MODES 10
/* for input setup functions */
#define SETUPINPUT_SCREEN_POS_START 0
/* forward declarations of internal functions */
static void HandleScreenGadgets(struct GadgetInfo *);
-static void execExitSetupChooseArtwork(void);
static void HandleSetupScreen_Generic(int, int, int, int, int);
static void HandleSetupScreen_Input(int, int, int, int, int);
static void CustomizeKeyboard(int);
static void CalibrateJoystick(int);
+static void execSetupArtwork(void);
static void HandleChooseTree(int, int, int, int, int, TreeInfo **);
static struct GadgetInfo *screen_gadget[NUM_SCREEN_GADGETS];
}
else if (game_status == SETUP)
{
- execExitSetupChooseArtwork();
+ execSetupArtwork();
}
else
{
if (game_status == SETUP)
{
- execExitSetupChooseArtwork();
+ execSetupArtwork();
}
else
{
DrawSetupScreen();
}
+static void execSetupGame()
+{
+ setup_mode = SETUP_MODE_GAME;
+ DrawSetupScreen();
+}
+
static void execSetupGraphics()
{
setup.graphics_set = artwork.gfx_current->name;
DrawSetupScreen();
}
+static void execSetupArtwork()
+{
+ setup_mode = SETUP_MODE_ARTWORK;
+ DrawSetupScreen();
+}
+
static void execSetupChooseGraphics()
{
setup_mode = SETUP_MODE_CHOOSE_GRAPHICS;
DrawSetupScreen();
}
-static void execExitSetupChooseArtwork()
-{
- if (setup_mode == SETUP_MODE_CHOOSE_GRAPHICS)
- execSetupGraphics();
- else
- execSetupSound();
-}
-
static void execExitSetup()
{
game_status = MAINMENU;
static struct TokenInfo setup_info_main[] =
{
- { TYPE_ENTER_MENU, execSetupGraphics, "Graphics Setup" },
- { TYPE_ENTER_MENU, execSetupSound, "Sound Setup" },
+ { TYPE_ENTER_MENU, execSetupGame, "Game Settings" },
+ { TYPE_ENTER_MENU, execSetupGraphics, "Graphics" },
+ { TYPE_ENTER_MENU, execSetupSound, "Sound & Music" },
+ { TYPE_ENTER_MENU, execSetupArtwork, "Custom Artwork" },
{ TYPE_ENTER_MENU, execSetupInput, "Input Devices" },
{ TYPE_ENTER_MENU, execSetupShortcut, "Key Shortcuts" },
{ TYPE_EMPTY, NULL, "" },
-#if 0
- { TYPE_SWITCH, &setup.double_buffering,"Buffered gfx:" },
- { TYPE_SWITCH, &setup.fading, "Fading:" },
-#endif
- { TYPE_SWITCH, &setup.quick_doors, "Quick Doors:" },
- { TYPE_SWITCH, &setup.ask_on_escape, "Ask on Esc:" },
- { TYPE_SWITCH, &setup.toons, "Toons:" },
- { TYPE_SWITCH, &setup.autorecord, "Auto-Record:" },
+ { TYPE_LEAVE_MENU, execExitSetup, "Exit" },
+ { TYPE_LEAVE_MENU, execSaveAndExitSetup, "Save and exit" },
+ { 0, NULL, NULL }
+};
+
+static struct TokenInfo setup_info_game[] =
+{
{ TYPE_SWITCH, &setup.team_mode, "Team-Mode:" },
{ TYPE_SWITCH, &setup.handicap, "Handicap:" },
{ TYPE_SWITCH, &setup.time_limit, "Timelimit:" },
+ { TYPE_SWITCH, &setup.autorecord, "Auto-Record:" },
{ TYPE_EMPTY, NULL, "" },
- { TYPE_LEAVE_MENU, execExitSetup, "Exit" },
- { TYPE_LEAVE_MENU, execSaveAndExitSetup, "Save and exit" },
+ { TYPE_LEAVE_MENU, execSetupMain, "Exit" },
{ 0, NULL, NULL }
};
static struct TokenInfo setup_info_graphics[] =
{
- { TYPE_ENTER_MENU, execSetupChooseGraphics,"Custom Graphics" },
- { TYPE_STRING, &setup.graphics_set, "" },
- { TYPE_EMPTY, NULL, "" },
{ TYPE_SWITCH, &setup.fullscreen, "Fullscreen:" },
{ TYPE_SWITCH, &setup.scroll_delay, "Scroll Delay:" },
{ TYPE_SWITCH, &setup.soft_scrolling, "Soft Scroll.:" },
+#if 0
+ { TYPE_SWITCH, &setup.double_buffering,"Buffered gfx:" },
+ { TYPE_SWITCH, &setup.fading, "Fading:" },
+#endif
+ { TYPE_SWITCH, &setup.quick_doors, "Quick Doors:" },
+ { TYPE_SWITCH, &setup.toons, "Toons:" },
{ TYPE_EMPTY, NULL, "" },
{ TYPE_LEAVE_MENU, execSetupMain, "Exit" },
{ 0, NULL, NULL }
{ TYPE_SWITCH, &setup.sound_loops, "Sound Loops:" },
{ TYPE_SWITCH, &setup.sound_music, "Game Music:" },
{ TYPE_EMPTY, NULL, "" },
+ { TYPE_LEAVE_MENU, execSetupMain, "Exit" },
+ { 0, NULL, NULL }
+};
+
+static struct TokenInfo setup_info_artwork[] =
+{
+ { TYPE_ENTER_MENU, execSetupChooseGraphics,"Custom Graphics" },
+ { TYPE_STRING, &setup.graphics_set, "" },
{ TYPE_ENTER_MENU, execSetupChooseSounds, "Custom Sounds" },
{ TYPE_STRING, &setup.sounds_set, "" },
{ TYPE_ENTER_MENU, execSetupChooseMusic, "Custom Music" },
{ TYPE_STRING, &setup.music_set, "" },
{ TYPE_EMPTY, NULL, "" },
+ { TYPE_STRING, NULL, "Override Level Artwork:"},
+ { TYPE_YES_NO, &setup.override_level_graphics, "Graphics:" },
+ { TYPE_YES_NO, &setup.override_level_sounds, "Sounds:" },
+ { TYPE_YES_NO, &setup.override_level_music, "Music:" },
+ { TYPE_EMPTY, NULL, "" },
{ TYPE_LEAVE_MENU, execSetupMain, "Exit" },
{ 0, NULL, NULL }
};
{ TYPE_KEYTEXT, NULL, "Toggle Pause:", },
{ TYPE_KEY, &setup.shortcut.toggle_pause, "" },
{ TYPE_EMPTY, NULL, "" },
+ { TYPE_YES_NO, &setup.ask_on_escape, "Ask on Esc:" },
+ { TYPE_EMPTY, NULL, "" },
{ TYPE_LEAVE_MENU, execSetupMain, "Exit" },
{ 0, NULL, NULL }
};
char *value_string = getSetupValue(setup_info[pos].type & ~TYPE_GHOSTED,
setup_info[pos].value);
+ if (value_string == NULL)
+ return;
+
if (setup_info[pos].type & TYPE_KEY)
{
xpos = 3;
setup_info = setup_info_main;
title_string = "Setup";
}
+ else if (setup_mode == SETUP_MODE_GAME)
+ {
+ setup_info = setup_info_game;
+ title_string = "Setup Game";
+ }
else if (setup_mode == SETUP_MODE_GRAPHICS)
{
setup_info = setup_info_graphics;
setup_info = setup_info_sound;
title_string = "Setup Sound";
}
+ else if (setup_mode == SETUP_MODE_ARTWORK)
+ {
+ setup_info = setup_info_artwork;
+ title_string = "Setup Sound";
+ }
else if (setup_mode == SETUP_MODE_SHORTCUT)
{
setup_info = setup_info_shortcut;
if ((value_ptr == &setup.sound && !audio.sound_available) ||
(value_ptr == &setup.sound_loops && !audio.loops_available) ||
(value_ptr == &setup.sound_music && !audio.music_available) ||
- (value_ptr == &setup.sound_music && !audio.music_available) ||
(value_ptr == &setup.fullscreen && !video.fullscreen_available))
setup_info[i].type |= TYPE_GHOSTED;
- if (setup_info[i].type & TYPE_ENTER_OR_LEAVE_MENU)
- font_size = FS_BIG;
+ if (setup_info[i].type & TYPE_STRING)
+ font_size = FS_MEDIUM;
DrawText(SX + 32, SY + ypos * 32, setup_info[i].text, font_size, FC_GREEN);
}
else if (!(setup_info[y].type & TYPE_GHOSTED))
{
-#if 0
- if (setup_info[y].type & TYPE_BOOLEAN_STYLE)
- {
- boolean new_value = !*(boolean *)(setup_info[y].value);
-
- *(boolean *)setup_info[y].value = new_value;
- drawSetupValue(y);
- }
- else if (setup_info[y].type == TYPE_KEYTEXT &&
- setup_info[y + 1].type == TYPE_KEY)
- {
- changeSetupValue(y + 1);
- }
- else if (setup_info[y].type & TYPE_ENTER_OR_LEAVE_MENU)
- {
- void (*menu_callback_function)(void) = setup_info[choice].value;
-
- menu_callback_function();
- }
-#else
if (setup_info[y].type & TYPE_ENTER_OR_LEAVE_MENU)
{
void (*menu_callback_function)(void) = setup_info[choice].value;
if (setup_info[y].type & TYPE_VALUE)
changeSetupValue(y);
}
-#endif
}
}
-#define COMPILE_DATE_STRING "[2002-05-31 17:39]"
+#define COMPILE_DATE_STRING "[2002-06-01 00:23]"
{
if (!(door_state & DOOR_NO_DELAY))
{
+ /* opening door sound has priority over simultaneously closing door */
if (door_state & (DOOR_OPEN_1 | DOOR_OPEN_2))
PlaySoundStereo(SND_MENU_DOOR_OPENING, SOUND_MAX_RIGHT);
- if (door_state & (DOOR_CLOSE_1 | DOOR_CLOSE_2))
+ else if (door_state & (DOOR_CLOSE_1 | DOOR_CLOSE_2))
PlaySoundStereo(SND_MENU_DOOR_CLOSING, SOUND_MAX_RIGHT);
}