From: Holger Schemel Date: Fri, 11 Mar 2022 11:35:27 +0000 (+0100) Subject: removed reloading artwork set for changed level set if not required X-Git-Tag: 4.3.2.0~88 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=4ca952cb;p=rocksndiamonds.git removed reloading artwork set for changed level set if not required The code that was removed here did the following: Trigger reloading artwork set after a different level set was selected if either the previous or the current level set has custom artwork configured in the file "levelinfo.conf". But this caused an attempt to reload new artwork even if both the previous and current artwork are identical. Now it is only checked if overriding artwork has changed, or if the identifiers of the previous and current artwork have changed. --- diff --git a/src/init.c b/src/init.c index 079ece2f..020b4d1d 100644 --- a/src/init.c +++ b/src/init.c @@ -6021,10 +6021,8 @@ static void InitOverrideArtwork(void) static char *getNewArtworkIdentifier(int type) { - static char *last_leveldir_identifier[3] = { NULL, NULL, NULL }; static char *last_artwork_identifier[3] = { NULL, NULL, NULL }; static boolean last_override_level_artwork[3] = { FALSE, FALSE, FALSE }; - static boolean last_has_level_artwork_set[3] = { FALSE, FALSE, FALSE }; static boolean initialized[3] = { FALSE, FALSE, FALSE }; TreeInfo *artwork_first_node = ARTWORK_FIRST_NODE(artwork, type); boolean setup_override_artwork = GFX_OVERRIDE_ARTWORK(type); @@ -6032,7 +6030,6 @@ static char *getNewArtworkIdentifier(int type) char *leveldir_identifier = leveldir_current->identifier; // !!! setLevelArtworkDir() should be moved to an earlier stage !!! char *leveldir_artwork_set = setLevelArtworkDir(artwork_first_node); - boolean has_level_artwork_set = (leveldir_artwork_set != NULL); char *artwork_current_identifier; char *artwork_new_identifier = NULL; // default: nothing has changed @@ -6060,14 +6057,6 @@ static char *getNewArtworkIdentifier(int type) /* 2nd step: check if it is really needed to reload artwork set ------------------------------------------------------------ */ - // ---------- reload if level set and also artwork set has changed ---------- - if (last_leveldir_identifier[type] != leveldir_identifier && - (last_has_level_artwork_set[type] || has_level_artwork_set)) - artwork_new_identifier = artwork_current_identifier; - - last_leveldir_identifier[type] = leveldir_identifier; - last_has_level_artwork_set[type] = has_level_artwork_set; - // ---------- reload if "override artwork" setting has changed -------------- if (last_override_level_artwork[type] != setup_override_artwork) artwork_new_identifier = artwork_current_identifier;