From: Holger Schemel Date: Fri, 15 Aug 2003 18:06:00 +0000 (+0200) Subject: rnd-20030815-1-src X-Git-Tag: 3.0.1^2~8 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=30d4bba6b5c11c262a79d442b67defe7eba9bfde;p=rocksndiamonds.git rnd-20030815-1-src --- diff --git a/src/conftime.h b/src/conftime.h index 6a9ce93c..c0029802 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2003-08-09 03:13]" +#define COMPILE_DATE_STRING "[2003-08-15 20:05]" diff --git a/src/game.c b/src/game.c index 7968b389..2f2b0381 100644 --- a/src/game.c +++ b/src/game.c @@ -427,7 +427,7 @@ static unsigned long trigger_events[MAX_NUM_ELEMENTS]; void GetPlayerConfig() { if (!audio.sound_available) - setup.sound = FALSE; + setup.sound_simple = FALSE; if (!audio.loops_available) setup.sound_loops = FALSE; @@ -438,7 +438,7 @@ void GetPlayerConfig() if (!video.fullscreen_available) setup.fullscreen = FALSE; - setup.sound_simple = setup.sound; + setup.sound = (setup.sound_simple || setup.sound_loops || setup.sound_music); SetAudioMode(setup.sound); InitJoysticks(); diff --git a/src/init.c b/src/init.c index ce61ae8b..ddb8ff5f 100644 --- a/src/init.c +++ b/src/init.c @@ -3203,7 +3203,9 @@ void InitLevelArtworkInfo() static void InitImages() { +#if 0 setLevelArtworkDir(artwork.gfx_first); +#endif #if 0 printf("::: InitImages for '%s' ['%s', '%s'] ['%s', '%s']\n", @@ -3227,8 +3229,10 @@ static void InitSound(char *identifier) if (identifier == NULL) identifier = artwork.snd_current->identifier; +#if 0 /* set artwork path to send it to the sound server process */ setLevelArtworkDir(artwork.snd_first); +#endif InitReloadCustomSounds(identifier); ReinitializeSounds(); @@ -3239,8 +3243,10 @@ static void InitMusic(char *identifier) if (identifier == NULL) identifier = artwork.mus_current->identifier; +#if 0 /* set artwork path to send it to the sound server process */ setLevelArtworkDir(artwork.mus_first); +#endif InitReloadCustomMusic(identifier); ReinitializeMusic(); @@ -3279,7 +3285,11 @@ static char *getNewArtworkIdentifier(int type) boolean setup_override_artwork = SETUP_OVERRIDE_ARTWORK(setup, type); char *setup_artwork_set = SETUP_ARTWORK_SET(setup, type); char *leveldir_identifier = leveldir_current->identifier; +#if 1 + char *leveldir_artwork_set = setLevelArtworkDir(artwork_first_node); +#else char *leveldir_artwork_set = LEVELDIR_ARTWORK_SET(leveldir_current, type); +#endif boolean has_level_artwork_set = (leveldir_artwork_set != NULL); char *artwork_current_identifier; char *artwork_new_identifier = NULL; /* default: nothing has changed */ @@ -3288,7 +3298,6 @@ static char *getNewArtworkIdentifier(int type) if (!validLevelSeries(leveldir_current)) return NULL; - /* 1st step: determine artwork set to be activated in descending order: -------------------------------------------------------------------- 1. setup artwork (when configured to override everything else) @@ -3310,6 +3319,16 @@ static char *getNewArtworkIdentifier(int type) /* 2nd step: check if it is really needed to reload artwork set ------------------------------------------------------------ */ +#if 0 + if (type == ARTWORK_TYPE_GRAPHICS) + printf("::: 0: '%s' ['%s', '%s'] ['%s' ('%s')]\n", + artwork_new_identifier, + ARTWORK_CURRENT_IDENTIFIER(artwork, type), + artwork_current_identifier, + leveldir_current->graphics_set, + leveldir_current->identifier); +#endif + /* ---------- reload if level set and also artwork set has changed ------- */ if (leveldir_current_identifier[type] != leveldir_identifier && (last_has_level_artwork_set[type] || has_level_artwork_set)) @@ -3318,12 +3337,22 @@ static char *getNewArtworkIdentifier(int type) leveldir_current_identifier[type] = leveldir_identifier; last_has_level_artwork_set[type] = has_level_artwork_set; +#if 0 + if (type == ARTWORK_TYPE_GRAPHICS) + printf("::: 1: '%s'\n", artwork_new_identifier); +#endif + /* ---------- reload if "override artwork" setting has changed ----------- */ if (last_override_level_artwork[type] != setup_override_artwork) artwork_new_identifier = artwork_current_identifier; last_override_level_artwork[type] = setup_override_artwork; +#if 0 + if (type == ARTWORK_TYPE_GRAPHICS) + printf("::: 2: '%s'\n", artwork_new_identifier); +#endif + /* ---------- reload if current artwork identifier has changed ----------- */ if (strcmp(ARTWORK_CURRENT_IDENTIFIER(artwork, type), artwork_current_identifier) != 0) @@ -3331,6 +3360,11 @@ static char *getNewArtworkIdentifier(int type) *(&(ARTWORK_CURRENT_IDENTIFIER(artwork, type))) = artwork_current_identifier; +#if 0 + if (type == ARTWORK_TYPE_GRAPHICS) + printf("::: 3: '%s'\n", artwork_new_identifier); +#endif + /* ---------- do not reload directly after starting ---------------------- */ if (!initialized[type]) artwork_new_identifier = NULL; @@ -3338,10 +3372,16 @@ static char *getNewArtworkIdentifier(int type) initialized[type] = TRUE; #if 0 - printf("CHECKING OLD/NEW GFX:\n- OLD: %s\n- NEW: %s ['%s', '%s'] ['%s']\n", - artwork.gfx_current_identifier, artwork_current_identifier, - artwork.gfx_current->identifier, leveldir_current->graphics_set, - artwork_new_identifier); + if (type == ARTWORK_TYPE_GRAPHICS) + printf("::: 4: '%s'\n", artwork_new_identifier); +#endif + +#if 0 + if (type == ARTWORK_TYPE_GRAPHICS) + printf("CHECKING OLD/NEW GFX:\n- OLD: %s\n- NEW: %s ['%s', '%s'] ['%s']\n", + artwork.gfx_current_identifier, artwork_current_identifier, + artwork.gfx_current->identifier, leveldir_current->graphics_set, + artwork_new_identifier); #endif return artwork_new_identifier; @@ -3357,16 +3397,22 @@ void ReloadCustomArtwork() if (gfx_new_identifier != NULL) { #if 0 - printf("RELOADING GRAPHICS '%s' -> '%s' ['%s']\n", + printf("RELOADING GRAPHICS '%s' -> '%s' ['%s', '%s']\n", artwork.gfx_current_identifier, gfx_new_identifier, - artwork.gfx_current->identifier); + artwork.gfx_current->identifier, + leveldir_current->graphics_set); #endif ClearRectangle(window, 0, 0, WIN_XSIZE, WIN_YSIZE); InitImages(); +#if 0 + printf("... '%s'\n", + leveldir_current->graphics_set); +#endif + FreeTileClipmasks(); InitTileClipmasks(); diff --git a/src/libgame/misc.c b/src/libgame/misc.c index f6cc110d..70b2a5d6 100644 --- a/src/libgame/misc.c +++ b/src/libgame/misc.c @@ -2165,8 +2165,7 @@ static void LoadArtworkConfigFromFilename(struct ArtworkListInfo *artwork_info, } END_HASH_ITERATION(extra_file_hash, itr) -#if DEBUG - if (dynamic_tokens_found) + if (options.debug && dynamic_tokens_found) { Error(ERR_RETURN_LINE, "-"); Error(ERR_RETURN, "dynamic token(s) found in config file:"); @@ -2182,7 +2181,6 @@ static void LoadArtworkConfigFromFilename(struct ArtworkListInfo *artwork_info, Error(ERR_RETURN_LINE, "-"); } -#endif if (unknown_tokens_found) { diff --git a/src/libgame/setup.c b/src/libgame/setup.c index a99c7a83..f0fbd60f 100644 --- a/src/libgame/setup.c +++ b/src/libgame/setup.c @@ -327,13 +327,13 @@ static char *getSetupArtworkDir(TreeInfo *ti) return artwork_dir; } -void setLevelArtworkDir(TreeInfo *ti) +char *setLevelArtworkDir(TreeInfo *ti) { char **artwork_path_ptr, **artwork_set_ptr; TreeInfo *level_artwork; if (ti == NULL || leveldir_current == NULL) - return; + return NULL; artwork_path_ptr = &(LEVELDIR_ARTWORK_PATH(leveldir_current, ti->type)); artwork_set_ptr = &(LEVELDIR_ARTWORK_SET( leveldir_current, ti->type)); @@ -370,6 +370,8 @@ void setLevelArtworkDir(TreeInfo *ti) free(dir); } + + return *artwork_set_ptr; } inline static char *getLevelArtworkSet(int type) diff --git a/src/libgame/setup.h b/src/libgame/setup.h index 30952c65..5ae3bc4b 100644 --- a/src/libgame/setup.h +++ b/src/libgame/setup.h @@ -185,7 +185,7 @@ typedef struct hashtable SetupFileHash; ARTWORKCLASS_UNDEFINED) -void setLevelArtworkDir(TreeInfo *); +char *setLevelArtworkDir(TreeInfo *); char *getLevelFilename(int); char *getTapeFilename(int); char *getScoreFilename(int); diff --git a/src/screens.c b/src/screens.c index c3b75a31..4637a650 100644 --- a/src/screens.c +++ b/src/screens.c @@ -1830,8 +1830,6 @@ static struct TokenInfo setup_info_graphics[] = static struct TokenInfo setup_info_sound[] = { - { TYPE_SWITCH, &setup.sound, "Sound:", }, - { TYPE_EMPTY, NULL, "" }, { TYPE_SWITCH, &setup.sound_simple, "Simple Sound:" }, { TYPE_SWITCH, &setup.sound_loops, "Sound Loops:" }, { TYPE_SWITCH, &setup.sound_music, "Game Music:" }, @@ -2040,10 +2038,10 @@ static void DrawSetupScreen_Generic() int font_nr = FONT_MENU_1; /* set some entries to "unchangeable" according to other variables */ - 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.fullscreen && !video.fullscreen_available)) + if ((value_ptr == &setup.sound_simple && !audio.sound_available) || + (value_ptr == &setup.sound_loops && !audio.loops_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_STRING)