From ad6d94b0f58f32b7ed34a4d284b3df85c5068389 Mon Sep 17 00:00:00 2001 From: terminx Date: Sat, 19 Oct 2019 23:43:26 +0000 Subject: [PATCH] Patch from Doom64hunter to address a couple of issues with per-map art git-svn-id: https://svn.eduke32.com/eduke32@8167 1a8010ca-5511-0410-912e-c29ae57300e0 # Conflicts: # source/build/src/tiles.cpp --- source/duke3d/src/savegame.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/source/duke3d/src/savegame.cpp b/source/duke3d/src/savegame.cpp index 4cacde44f..cf7e0f87f 100644 --- a/source/duke3d/src/savegame.cpp +++ b/source/duke3d/src/savegame.cpp @@ -34,6 +34,7 @@ BEGIN_DUKE_NS static OutputFileCounter savecounter; +char previousboardfilename[BMAX_PATH]; // For storing pointers in files. // back_p==0: ptr -> "small int" @@ -463,9 +464,13 @@ int32_t G_LoadPlayer(savebrief_t & sv) else if (g_mapInfo[mapIdx].filename) Bstrcpy(currentboardfilename, g_mapInfo[mapIdx].filename); + if (currentboardfilename[0]) { - artSetupMapArt(currentboardfilename); + // only setup art if map differs from previous + if (!previousboardfilename[0] || previousboardfilename != currentboardfilename) + artSetupMapArt(currentboardfilename); + Bstrcpy(previousboardfilename, currentboardfilename); append_ext_UNSAFE(currentboardfilename, ".mhk"); engineLoadMHK(currentboardfilename); } @@ -662,7 +667,10 @@ int32_t G_LoadPlayer(savebrief_t & sv) if (currentboardfilename[0]) { - artSetupMapArt(currentboardfilename); + // only setup art if map differs from previous + if (!previousboardfilename[0] || Bstrcmp(previousboardfilename, currentboardfilename)) + artSetupMapArt(currentboardfilename); + Bstrcpy(previousboardfilename, currentboardfilename); append_ext_UNSAFE(currentboardfilename, ".mhk"); engineLoadMHK(currentboardfilename); }