X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Finit.c;h=727dcf30be2cfe03197b82bd9d436bf4dfdb808c;hb=c20136c10315df9e66a56f97db11023306032604;hp=c4b787e78f2a189511e34418bada3d03d4359aa0;hpb=fb402760dddcc06205acbcc8123ee99a11536b84;p=rocksndiamonds.git diff --git a/src/init.c b/src/init.c index c4b787e7..727dcf30 100644 --- a/src/init.c +++ b/src/init.c @@ -1966,7 +1966,7 @@ static void InitGraphicCompatibilityInfo(void) // special compatibility handling for "Jue" graphics sets (2007 and 2019) boolean supports_score_info = (menu.draw_xoffset[GAME_MODE_SCOREINFO] != 0); - if (strPrefix(leveldir_current->graphics_set, "jue") && !supports_score_info) + if (strPrefix(artwork.gfx_current_identifier, "jue") && !supports_score_info) { int font_title[] = { @@ -2002,7 +2002,7 @@ static void InitGraphicCompatibilityInfo(void) { for (j = 0; j < 2; j++) { - boolean jue0 = strEqual(leveldir_current->graphics_set, "jue0"); + boolean jue0 = strEqual(artwork.gfx_current_identifier, "jue0"); int font_nr = (j == 0 ? font_text[i] : FONT_ACTIVE(font_text[i])); int font_bitmap_id = font_info[font_nr].special_bitmap_id[mode_old]; int font_yoffset = (jue0 ? 10 : 5); @@ -6183,7 +6183,7 @@ static void InitOverrideArtwork(void) #endif } -static char *getNewArtworkIdentifier(int type) +static char *setNewArtworkIdentifier(int type) { static char *last_leveldir_identifier[3] = { NULL, NULL, NULL }; static char *last_artwork_identifier[3] = { NULL, NULL, NULL }; @@ -6248,6 +6248,7 @@ static char *getNewArtworkIdentifier(int type) // (we cannot compare string pointers here, so copy string content itself) setString(&last_artwork_identifier[type], artwork_current_identifier); + // ---------- set new artwork identifier ---------- *(ARTWORK_CURRENT_IDENTIFIER_PTR(artwork, type)) = artwork_current_identifier; // ---------- do not reload directly after starting ------------------------- @@ -6259,6 +6260,13 @@ static char *getNewArtworkIdentifier(int type) return artwork_new_identifier; } +static void InitArtworkIdentifier(void) +{ + setNewArtworkIdentifier(ARTWORK_TYPE_GRAPHICS); + setNewArtworkIdentifier(ARTWORK_TYPE_SOUNDS); + setNewArtworkIdentifier(ARTWORK_TYPE_MUSIC); +} + void ReloadCustomArtwork(int force_reload) { int last_game_status = game_status; // save current game status @@ -6275,9 +6283,9 @@ void ReloadCustomArtwork(int force_reload) AdjustGraphicsForEMC(); AdjustSoundsForEMC(); - gfx_new_identifier = getNewArtworkIdentifier(ARTWORK_TYPE_GRAPHICS); - snd_new_identifier = getNewArtworkIdentifier(ARTWORK_TYPE_SOUNDS); - mus_new_identifier = getNewArtworkIdentifier(ARTWORK_TYPE_MUSIC); + gfx_new_identifier = setNewArtworkIdentifier(ARTWORK_TYPE_GRAPHICS); + snd_new_identifier = setNewArtworkIdentifier(ARTWORK_TYPE_SOUNDS); + mus_new_identifier = setNewArtworkIdentifier(ARTWORK_TYPE_MUSIC); reload_needed = (gfx_new_identifier != NULL || force_reload_gfx || snd_new_identifier != NULL || force_reload_snd || @@ -6508,6 +6516,9 @@ void OpenAll(void) InitOverrideArtwork(); // needs to know current level directory print_timestamp_time("InitOverrideArtwork"); + InitArtworkIdentifier(); // needs to know current level directory + print_timestamp_time("InitArtworkIdentifier"); + InitImages(); // needs to know current level directory print_timestamp_time("InitImages");