From 838825e11f7e4af0947bf9d40061defd4e499017 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Sat, 24 Aug 2002 13:38:48 +0200 Subject: [PATCH] rnd-20020824-1-src --- src/conftime.h | 2 +- src/init.c | 59 ++++++++++++++---------- src/libgame/setup.c | 107 +++++++++++++++++++++++++------------------ src/libgame/setup.h | 2 +- src/libgame/sound.c | 28 +++++------ src/libgame/system.h | 25 +++++----- src/main.h | 4 +- src/network.c | 19 ++++---- src/screens.c | 21 ++++++--- 9 files changed, 153 insertions(+), 114 deletions(-) diff --git a/src/conftime.h b/src/conftime.h index 5cfe6cf0..6ad4d766 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2002-08-13 01:52]" +#define COMPILE_DATE_STRING "[2002-08-24 13:38]" diff --git a/src/init.c b/src/init.c index 0e1fc339..ccf0ef13 100644 --- a/src/init.c +++ b/src/init.c @@ -179,8 +179,8 @@ static void InitMixer() static void InitSound() { /* load custom sounds and music */ - InitReloadSounds(artwork.snd_current->name); - InitReloadMusic(artwork.mus_current->name); + InitReloadSounds(artwork.snd_current->identifier); + InitReloadMusic(artwork.mus_current->identifier); /* initialize sound effect lookup table for element actions */ InitGameSound(); @@ -411,32 +411,41 @@ void InitGfxBackground() void ReloadCustomArtwork() { - static char *leveldir_current_filename = NULL; + static char *leveldir_current_identifier = 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_filename != leveldir_current->filename) +#if 0 + printf("graphics --> '%s' ('%s')\n", + artwork.gfx_current_identifier, artwork.gfx_current->filename); + printf("sounds --> '%s' ('%s')\n", + artwork.snd_current_identifier, artwork.snd_current->filename); + printf("music --> '%s' ('%s')\n", + artwork.mus_current_identifier, artwork.mus_current->filename); +#endif + + if (leveldir_current_identifier != leveldir_current->identifier) { - char *filename_old = leveldir_current_filename; - char *filename_new = leveldir_current->filename; + char *identifier_old = leveldir_current_identifier; + char *identifier_new = leveldir_current->identifier; /* force reload of custom artwork after new level series was selected, but reload only that part of the artwork that really has changed */ - if (getTreeInfoFromFilename(artwork.gfx_first, filename_old) != - getTreeInfoFromFilename(artwork.gfx_first, filename_new)) - artwork.graphics_set_current_name = NULL; - if (getTreeInfoFromFilename(artwork.snd_first, filename_old) != - getTreeInfoFromFilename(artwork.snd_first, filename_new)) - artwork.sounds_set_current_name = NULL; - if (getTreeInfoFromFilename(artwork.mus_first, filename_new) != - getTreeInfoFromFilename(artwork.mus_first, filename_new)) - artwork.music_set_current_name = NULL; - - leveldir_current_filename = leveldir_current->filename; + if (getTreeInfoFromIdentifier(artwork.gfx_first, identifier_old) != + getTreeInfoFromIdentifier(artwork.gfx_first, identifier_new)) + artwork.gfx_current_identifier = NULL; + if (getTreeInfoFromIdentifier(artwork.snd_first, identifier_old) != + getTreeInfoFromIdentifier(artwork.snd_first, identifier_new)) + artwork.snd_current_identifier = NULL; + if (getTreeInfoFromIdentifier(artwork.mus_first, identifier_new) != + getTreeInfoFromIdentifier(artwork.mus_first, identifier_new)) + artwork.mus_current_identifier = NULL; + + leveldir_current_identifier = leveldir_current->identifier; } - if (artwork.graphics_set_current_name != artwork.gfx_current->name || + if (artwork.gfx_current_identifier != artwork.gfx_current->identifier || last_override_level_graphics != setup.override_level_graphics) { int i; @@ -457,25 +466,25 @@ void ReloadCustomArtwork() SetDoorState(DOOR_OPEN_ALL); CloseDoor(DOOR_CLOSE_ALL | DOOR_NO_DELAY); - artwork.graphics_set_current_name = artwork.gfx_current->name; + artwork.gfx_current_identifier = artwork.gfx_current->identifier; last_override_level_graphics = setup.override_level_graphics; } - if (artwork.sounds_set_current_name != artwork.snd_current->name || + if (artwork.snd_current_identifier != artwork.snd_current->identifier || last_override_level_sounds != setup.override_level_sounds) { - InitReloadSounds(artwork.snd_current->name); + InitReloadSounds(artwork.snd_current->identifier); - artwork.sounds_set_current_name = artwork.snd_current->name; + artwork.snd_current_identifier = artwork.snd_current->identifier; last_override_level_sounds = setup.override_level_sounds; } - if (artwork.music_set_current_name != artwork.mus_current->name || + if (artwork.mus_current_identifier != artwork.mus_current->identifier || last_override_level_music != setup.override_level_music) { - InitReloadMusic(artwork.mus_current->name); + InitReloadMusic(artwork.mus_current->identifier); - artwork.music_set_current_name = artwork.mus_current->name; + artwork.mus_current_identifier = artwork.mus_current->identifier; last_override_level_music = setup.override_level_music; } } diff --git a/src/libgame/setup.c b/src/libgame/setup.c index c6450a66..add159b9 100644 --- a/src/libgame/setup.c +++ b/src/libgame/setup.c @@ -631,9 +631,9 @@ TreeInfo *getTreeInfoFromPos(TreeInfo *node, int pos) return node_default; } -TreeInfo *getTreeInfoFromFilenameExt(TreeInfo *node, char *filename) +TreeInfo *getTreeInfoFromIdentifier(TreeInfo *node, char *identifier) { - if (filename == NULL) + if (identifier == NULL) return NULL; while (node) @@ -642,20 +642,14 @@ TreeInfo *getTreeInfoFromFilenameExt(TreeInfo *node, char *filename) { TreeInfo *node_group; - node_group = getTreeInfoFromFilenameExt(node->node_group, filename); + node_group = getTreeInfoFromIdentifier(node->node_group, identifier); if (node_group) return node_group; } else if (!node->parent_link) { - if (strcmp(filename, node->filename) == 0) - return node; - - /* special case when looking for level series artwork: - node->name_short contains level series filename */ - if (strcmp(node->filename, ".") == 0 && - strcmp(filename, node->name_short) == 0) + if (strcmp(identifier, node->identifier) == 0) return node; } @@ -665,11 +659,6 @@ TreeInfo *getTreeInfoFromFilenameExt(TreeInfo *node, char *filename) return NULL; } -TreeInfo *getTreeInfoFromFilename(TreeInfo *ti, char *filename) -{ - return getTreeInfoFromFilenameExt(ti, filename); -} - void dumpTreeInfo(TreeInfo *node, int depth) { int i; @@ -682,7 +671,7 @@ void dumpTreeInfo(TreeInfo *node, int depth) printf(" "); printf("filename == '%s' (%s) [%s] (%d)\n", - node->filename, node->name, node->name_short, node->sort_priority); + node->filename, node->name, node->identifier, node->sort_priority); if (node->node_group != NULL) dumpTreeInfo(node->node_group, depth + 1); @@ -1179,8 +1168,8 @@ void checkSetupFileListIdentifier(struct SetupFileList *setup_file_list, #define TOKEN_STR_HANDICAP_LEVEL "handicap_level" /* level directory info */ -#define LEVELINFO_TOKEN_NAME 0 -#define LEVELINFO_TOKEN_NAME_SHORT 1 +#define LEVELINFO_TOKEN_IDENTIFIER 0 +#define LEVELINFO_TOKEN_NAME 1 #define LEVELINFO_TOKEN_NAME_SORTING 2 #define LEVELINFO_TOKEN_AUTHOR 3 #define LEVELINFO_TOKEN_IMPORTED_FROM 4 @@ -1197,8 +1186,8 @@ static LevelDirTree ldi; static struct TokenInfo levelinfo_tokens[] = { /* level directory info */ + { TYPE_STRING, &ldi.identifier, "identifier" }, { TYPE_STRING, &ldi.name, "name" }, - { TYPE_STRING, &ldi.name_short, "name_short" }, { TYPE_STRING, &ldi.name_sorting, "name_sorting" }, { TYPE_STRING, &ldi.author, "author" }, { TYPE_STRING, &ldi.imported_from, "imported_from" }, @@ -1229,8 +1218,8 @@ static void setTreeInfoToDefaults(TreeInfo *ldi, int type) ldi->filename = NULL; ldi->fullpath = NULL; ldi->basepath = NULL; + ldi->identifier = NULL; ldi->name = getStringCopy(ANONYMOUS_NAME); - ldi->name_short = NULL; ldi->name_sorting = NULL; ldi->author = getStringCopy(ANONYMOUS_NAME); @@ -1275,8 +1264,8 @@ static void setTreeInfoToDefaultsFromParent(TreeInfo *ldi, TreeInfo *parent) ldi->filename = NULL; ldi->fullpath = NULL; ldi->basepath = NULL; + ldi->identifier = NULL; ldi->name = getStringCopy(ANONYMOUS_NAME); - ldi->name_short = NULL; ldi->name_sorting = NULL; ldi->author = getStringCopy(parent->author); ldi->imported_from = getStringCopy(parent->imported_from); @@ -1381,8 +1370,8 @@ static void createParentTreeInfoNode(TreeInfo *node_parent) ti_new->node_parent = node_parent; ti_new->parent_link = TRUE; + ti_new->identifier = getStringCopy(node_parent->identifier); ti_new->name = ".. (parent directory)"; - ti_new->name_short = getStringCopy(ti_new->name); ti_new->name_sorting = getStringCopy(ti_new->name); ti_new->filename = ".."; @@ -1444,8 +1433,8 @@ static boolean LoadLevelInfoFromLevelConf(TreeInfo **node_first, DrawInitText(leveldir_new->name, 150, FC_YELLOW); - if (leveldir_new->name_short == NULL) - leveldir_new->name_short = getStringCopy(leveldir_new->name); + if (leveldir_new->identifier == NULL) + leveldir_new->identifier = getStringCopy(leveldir_new->filename); if (leveldir_new->name_sorting == NULL) leveldir_new->name_sorting = getStringCopy(leveldir_new->name); @@ -1662,8 +1651,8 @@ static boolean LoadArtworkInfoFromArtworkConf(TreeInfo **node_first, DrawInitText(artwork_new->name, 150, FC_YELLOW); #endif - if (artwork_new->name_short == NULL) - artwork_new->name_short = getStringCopy(artwork_new->name); + if (artwork_new->identifier == NULL) + artwork_new->identifier = getStringCopy(artwork_new->filename); if (artwork_new->name_sorting == NULL) artwork_new->name_sorting = getStringCopy(artwork_new->name); @@ -1696,22 +1685,25 @@ static boolean LoadArtworkInfoFromArtworkConf(TreeInfo **node_first, { if (artwork_new->user_defined) { - artwork_new->name = getStringCopy("private"); + artwork_new->identifier = getStringCopy("private"); artwork_new->sort_priority = ARTWORKCLASS_USER; } else { - artwork_new->name = getStringCopy("classic"); + artwork_new->identifier = getStringCopy("classic"); artwork_new->sort_priority = ARTWORKCLASS_CLASSICS; } + /* set to new values after changing ".sort_priority" */ artwork_new->color = ARTWORKCOLOR(artwork_new); artwork_new->class_desc = getLevelClassDescription(artwork_new); } else - artwork_new->name = getStringCopy(artwork_new->filename); + { + artwork_new->identifier = getStringCopy(artwork_new->filename); + } - artwork_new->name_short = getStringCopy(artwork_new->name); + artwork_new->name = getStringCopy(artwork_new->identifier); artwork_new->name_sorting = getStringCopy(artwork_new->name); } @@ -1797,8 +1789,8 @@ static TreeInfo *getDummyArtworkInfo(int type) if (artwork_new->name != NULL) free(artwork_new->name); + artwork_new->identifier = getStringCopy(NOT_AVAILABLE); artwork_new->name = getStringCopy(NOT_AVAILABLE); - artwork_new->name_short = getStringCopy(NOT_AVAILABLE); artwork_new->name_sorting = getStringCopy(NOT_AVAILABLE); return artwork_new; @@ -1838,28 +1830,28 @@ void LoadArtworkInfo() /* before sorting, the first entries will be from the user directory */ artwork.gfx_current = - getTreeInfoFromFilename(artwork.gfx_first, setup.graphics_set); + getTreeInfoFromIdentifier(artwork.gfx_first, setup.graphics_set); if (artwork.gfx_current == NULL) artwork.gfx_current = getFirstValidTreeInfoEntry(artwork.gfx_first); artwork.snd_current = - getTreeInfoFromFilename(artwork.snd_first, setup.sounds_set); + getTreeInfoFromIdentifier(artwork.snd_first, setup.sounds_set); if (artwork.snd_current == NULL) artwork.snd_current = getFirstValidTreeInfoEntry(artwork.snd_first); artwork.mus_current = - getTreeInfoFromFilename(artwork.mus_first, setup.music_set); + getTreeInfoFromIdentifier(artwork.mus_first, setup.music_set); if (artwork.mus_current == NULL) artwork.mus_current = getFirstValidTreeInfoEntry(artwork.mus_first); - 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; + artwork.gfx_current_identifier = artwork.gfx_current->identifier; + artwork.snd_current_identifier = artwork.snd_current->identifier; + artwork.mus_current_identifier = artwork.mus_current->identifier; #if 0 - 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); + printf("graphics set == %s\n\n", artwork.gfx_current_identifier); + printf("sounds set == %s\n\n", artwork.snd_current_identifier); + printf("music set == %s\n\n", artwork.mus_current_identifier); #endif sortTreeInfo(&artwork.gfx_first, compareTreeInfoEntries); @@ -1898,13 +1890,13 @@ void LoadArtworkInfoFromLevelInfo(ArtworkDirTree **artwork_node, if (topnode_last != *artwork_node) { + free((*artwork_node)->identifier); free((*artwork_node)->name); free((*artwork_node)->name_sorting); - free((*artwork_node)->name_short); + (*artwork_node)->identifier = getStringCopy(level_node->filename); (*artwork_node)->name = getStringCopy(level_node->name); (*artwork_node)->name_sorting = getStringCopy(level_node->name); - (*artwork_node)->name_short = getStringCopy(level_node->filename); (*artwork_node)->sort_priority = level_node->sort_priority; (*artwork_node)->color = LEVELCOLOR((*artwork_node)); @@ -1928,6 +1920,31 @@ void LoadLevelArtworkInfo() LoadArtworkInfoFromLevelInfo(&artwork.snd_first, leveldir_first); LoadArtworkInfoFromLevelInfo(&artwork.mus_first, leveldir_first); + /* needed for reloading level artwork not known at ealier stage */ + if (strcmp(artwork.gfx_current_identifier, setup.graphics_set) != 0) + { + artwork.gfx_current = + getTreeInfoFromIdentifier(artwork.gfx_first, setup.graphics_set); + if (artwork.gfx_current == NULL) + artwork.gfx_current = getFirstValidTreeInfoEntry(artwork.gfx_first); + } + + if (strcmp(artwork.snd_current_identifier, setup.sounds_set) != 0) + { + artwork.snd_current = + getTreeInfoFromIdentifier(artwork.snd_first, setup.sounds_set); + if (artwork.snd_current == NULL) + artwork.snd_current = getFirstValidTreeInfoEntry(artwork.snd_first); + } + + if (strcmp(artwork.mus_current_identifier, setup.music_set) != 0) + { + artwork.mus_current = + getTreeInfoFromIdentifier(artwork.mus_first, setup.music_set); + if (artwork.mus_current == NULL) + artwork.mus_current = getFirstValidTreeInfoEntry(artwork.mus_first); + } + sortTreeInfo(&artwork.gfx_first, compareTreeInfoEntries); sortTreeInfo(&artwork.snd_first, compareTreeInfoEntries); sortTreeInfo(&artwork.mus_first, compareTreeInfoEntries); @@ -1968,7 +1985,7 @@ static void SaveUserLevelInfo() getCookie("LEVELINFO"))); for (i=0; istate & SND_CTRL_RELOAD_SOUNDS ? &setup.override_level_sounds : &setup.override_level_music); - if (set_name) - free(set_name); + if (set_identifier) + free(set_identifier); - set_name = checked_malloc(snd_ctrl->data_len); + set_identifier = checked_malloc(snd_ctrl->data_len); if (leveldir_current == NULL) leveldir_current = checked_calloc(sizeof(TreeInfo)); @@ -570,7 +570,7 @@ static void ReadReloadInfoFromPipe(SoundControl *snd_ctrl) if (ti->fullpath != NULL) free(ti->fullpath); - if (read(audio.mixer_pipe[0], set_name, + if (read(audio.mixer_pipe[0], set_identifier, snd_ctrl->data_len) != snd_ctrl->data_len || read(audio.mixer_pipe[0], override_level_artwork, sizeof(boolean)) != sizeof(boolean) || @@ -599,9 +599,9 @@ static void ReadReloadInfoFromPipe(SoundControl *snd_ctrl) Error(ERR_EXIT_SOUND_SERVER, "broken pipe -- no sounds"); if (snd_ctrl->state & SND_CTRL_RELOAD_SOUNDS) - artwork.sounds_set_current_name = set_name; + artwork.snd_current_identifier = set_identifier; else - artwork.music_set_current_name = set_name; + artwork.mus_current_identifier = set_identifier; } #endif /* AUDIO_UNIX_NATIVE */ @@ -2183,25 +2183,25 @@ static void ReloadCustomMusic() LoadCustomMusic(); } -void InitReloadSounds(char *set_name) +void InitReloadSounds(char *set_identifier) { if (!audio.sound_available) return; #if defined(AUDIO_UNIX_NATIVE) - WriteReloadInfoToPipe(set_name, SND_CTRL_RELOAD_SOUNDS); + WriteReloadInfoToPipe(set_identifier, SND_CTRL_RELOAD_SOUNDS); #else ReloadCustomSounds(); #endif } -void InitReloadMusic(char *set_name) +void InitReloadMusic(char *set_identifier) { if (!audio.music_available) return; #if defined(AUDIO_UNIX_NATIVE) - WriteReloadInfoToPipe(set_name, SND_CTRL_RELOAD_MUSIC); + WriteReloadInfoToPipe(set_identifier, SND_CTRL_RELOAD_MUSIC); #else ReloadCustomMusic(); #endif diff --git a/src/libgame/system.h b/src/libgame/system.h index 743a8b9b..68a540b3 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -377,22 +377,25 @@ struct TreeInfo /* fields for "type == TREE_TYPE_LEVEL_DIR" */ - char *filename; /* level series single directory name */ - char *fullpath; /* complete path relative to level directory */ - char *basepath; /* absolute base path of level directory */ - char *name; /* level series name, as displayed on main screen */ - char *name_short; /* optional short name for level selection screen */ - char *name_sorting; /* optional sorting name for correct level sorting */ - char *author; /* level series author name levels without author */ - char *imported_from; /* optional comment for imported level series */ + char *filename; /* tree info sub-directory basename (may be ".") */ + char *fullpath; /* complete path relative to tree base directory */ + char *basepath; /* absolute base path of tree base directory */ + char *identifier; /* identifier string for configuration files */ + char *name; /* tree info name, as displayed in selection menues */ + char *name_sorting; /* optional sorting name for correct name sorting */ + char *author; /* level or artwork author name */ + char *imported_from; /* optional comment for imported levels or artwork */ + int levels; /* number of levels in level series */ int first_level; /* first level number (to allow start with 0 or 1) */ int last_level; /* last level number (automatically calculated) */ int sort_priority; /* sort levels by 'sort_priority' and then by name */ + boolean level_group; /* directory contains more level series directories */ boolean parent_link; /* entry links back to parent directory */ boolean user_defined; /* user defined levels are stored in home directory */ boolean readonly; /* readonly levels can not be changed with editor */ + int color; /* color to use on selection screen for this level */ char *class_desc; /* description of level series class */ int handicap_level; /* number of the lowest unsolved level */ @@ -414,9 +417,9 @@ struct ArtworkInfo MusicDirTree *mus_first; MusicDirTree *mus_current; - char *graphics_set_current_name; - char *sounds_set_current_name; - char *music_set_current_name; + char *gfx_current_identifier; + char *snd_current_identifier; + char *mus_current_identifier; }; diff --git a/src/main.h b/src/main.h index 71cfcdf9..061fa15e 100644 --- a/src/main.h +++ b/src/main.h @@ -1632,8 +1632,8 @@ extern struct SoundEffectInfo sound_effects[]; #define PROGRAM_VERSION_MAJOR 2 #define PROGRAM_VERSION_MINOR 1 -#define PROGRAM_VERSION_PATCH 1 -#define PROGRAM_VERSION_STRING "2.1.1" +#define PROGRAM_VERSION_PATCH 2 +#define PROGRAM_VERSION_STRING "2.1.2" #define PROGRAM_TITLE_STRING "Rocks'n'Diamonds" #define PROGRAM_AUTHOR_STRING "Holger Schemel" diff --git a/src/network.c b/src/network.c index 2b0ac6c2..fba7b48c 100644 --- a/src/network.c +++ b/src/network.c @@ -238,9 +238,9 @@ void SendToServer_StartPlaying() buffer[8] = (unsigned char)((new_random_seed >> 8) & 0xff); buffer[9] = (unsigned char)((new_random_seed >> 0) & 0xff); - strcpy((char *)&buffer[10], leveldir_current->filename); + strcpy((char *)&buffer[10], leveldir_current->identifier); - SendBufferToServer(10 + strlen(leveldir_current->filename) + 1); + SendBufferToServer(10 + strlen(leveldir_current->identifier) + 1); } void SendToServer_PausePlaying() @@ -417,27 +417,28 @@ static void Handle_OP_START_PLAYING() int new_level_nr; int dummy; /* !!! HAS NO MEANING ANYMORE !!! */ unsigned long new_random_seed; - char *new_leveldir_filename; + char *new_leveldir_identifier; new_level_nr = (buffer[2] << 8) + buffer[3]; dummy = (buffer[4] << 8) + buffer[5]; new_random_seed = (buffer[6] << 24) | (buffer[7] << 16) | (buffer[8] << 8) | (buffer[9]); - new_leveldir_filename = (char *)&buffer[10]; + new_leveldir_identifier = (char *)&buffer[10]; - new_leveldir = getTreeInfoFromFilename(leveldir_first,new_leveldir_filename); + new_leveldir = getTreeInfoFromIdentifier(leveldir_first, + new_leveldir_identifier); if (new_leveldir == NULL) { - Error(ERR_WARN, "no such level directory: '%s'", new_leveldir_filename); + Error(ERR_WARN, "no such level identifier: '%s'", new_leveldir_identifier); new_leveldir = leveldir_first; - Error(ERR_WARN, "using default level directory: '%s'", new_leveldir->name); + Error(ERR_WARN, "using default level set: '%s'", new_leveldir->identifier); } printf("OP_START_PLAYING: %d\n", buffer[0]); Error(ERR_NETWORK_CLIENT, - "client %d starts game [level %d from leveldir '%s']\n", - buffer[0], new_level_nr, new_leveldir->name); + "client %d starts game [level %d from level identifier '%s']\n", + buffer[0], new_level_nr, new_leveldir->identifier); leveldir_current = new_leveldir; level_nr = new_level_nr; diff --git a/src/screens.c b/src/screens.c index ac88cbbe..8499f619 100644 --- a/src/screens.c +++ b/src/screens.c @@ -1362,6 +1362,10 @@ void HandleHallOfFame(int mx, int my, int dx, int dy, int button) static struct TokenInfo *setup_info; static int num_setup_info; +static char *graphics_set_name; +static char *sounds_set_name; +static char *music_set_name; + static void execSetupMain() { setup_mode = SETUP_MODE_MAIN; @@ -1391,9 +1395,14 @@ static void execSetupArtwork() /* needed if last screen (setup choice) changed graphics, sounds or music */ ReloadCustomArtwork(); - setup.graphics_set = artwork.gfx_current->name; - setup.sounds_set = artwork.snd_current->name; - setup.music_set = artwork.mus_current->name; + setup.graphics_set = artwork.gfx_current->identifier; + setup.sounds_set = artwork.snd_current->identifier; + setup.music_set = artwork.mus_current->identifier; + + /* needed for displaying artwork name instead of artwork identifier */ + graphics_set_name = artwork.gfx_current->name; + sounds_set_name = artwork.snd_current->name; + music_set_name = artwork.mus_current->name; setup_mode = SETUP_MODE_ARTWORK; DrawSetupScreen(); @@ -1497,11 +1506,11 @@ static struct TokenInfo setup_info_sound[] = static struct TokenInfo setup_info_artwork[] = { { TYPE_ENTER_MENU, execSetupChooseGraphics,"Custom Graphics" }, - { TYPE_STRING, &setup.graphics_set, "" }, + { TYPE_STRING, &graphics_set_name, "" }, { TYPE_ENTER_MENU, execSetupChooseSounds, "Custom Sounds" }, - { TYPE_STRING, &setup.sounds_set, "" }, + { TYPE_STRING, &sounds_set_name, "" }, { TYPE_ENTER_MENU, execSetupChooseMusic, "Custom Music" }, - { TYPE_STRING, &setup.music_set, "" }, + { TYPE_STRING, &music_set_name, "" }, { TYPE_EMPTY, NULL, "" }, { TYPE_STRING, NULL, "Override Level Artwork:"}, { TYPE_YES_NO, &setup.override_level_graphics, "Graphics:" }, -- 2.34.1