diff --git a/source/blood/src/blood.cpp b/source/blood/src/blood.cpp index b53da7f80..cdc8e29a3 100644 --- a/source/blood/src/blood.cpp +++ b/source/blood/src/blood.cpp @@ -462,6 +462,7 @@ void GameInterface::app_init() uint32_t etime = I_msTime(); Printf(PRINT_NONOTIFY, "Definitions file \"%s\" loaded in %d ms.\n", defsfile, etime - stime); } + TileFiles.SetBackup(); powerupInit(); Printf(PRINT_NONOTIFY, "Loading cosine table\n"); trigInit(); diff --git a/source/core/textures/buildtiles.cpp b/source/core/textures/buildtiles.cpp index 47e8ab1bd..8a4e4cebd 100644 --- a/source/core/textures/buildtiles.cpp +++ b/source/core/textures/buildtiles.cpp @@ -676,6 +676,7 @@ void tileCopy(int tile, int source, int pal, int xoffset, int yoffset, int flags // Clear map specific ART // //========================================================================== +static FString currentMapArt; void artClearMapArt(void) { @@ -685,6 +686,7 @@ void artClearMapArt(void) td.picanm = td.picanmbackup; } TileFiles.SetupReverseTileMap(); + currentMapArt = ""; } //========================================================================== @@ -692,7 +694,6 @@ void artClearMapArt(void) // Load map specficied ART // //========================================================================== -static FString currentMapArt; void artSetupMapArt(const char* filename) { diff --git a/source/core/textures/buildtiles.h b/source/core/textures/buildtiles.h index 454053265..ea9ea72e5 100644 --- a/source/core/textures/buildtiles.h +++ b/source/core/textures/buildtiles.h @@ -299,6 +299,15 @@ struct BuildTiles CloseAll(); } + void SetBackup() + { + for (auto& td : tiledata) + { + td.backup = td.texture; + td.picanmbackup = td.picanm; + } + } + void CloseAll(); void AddTile(int tilenum, FGameTexture* tex, bool permap = false); diff --git a/source/exhumed/src/exhumed.cpp b/source/exhumed/src/exhumed.cpp index 18f7dd4f0..363e95890 100644 --- a/source/exhumed/src/exhumed.cpp +++ b/source/exhumed/src/exhumed.cpp @@ -633,6 +633,7 @@ void GameInterface::app_init() uint32_t etime = I_msTime(); Printf(PRINT_NONOTIFY, "Definitions file \"%s\" loaded in %d ms.\n", defsfile, etime - stime); } + TileFiles.SetBackup(); InitView(); InitFX(); diff --git a/source/games/duke/src/game.cpp b/source/games/duke/src/game.cpp index ae071be8c..eff1d154d 100644 --- a/source/games/duke/src/game.cpp +++ b/source/games/duke/src/game.cpp @@ -243,6 +243,7 @@ static void loaddefs() deftimer.Unclock(); Printf(PRINT_NONOTIFY, "Definitions file \"%s\" loaded in %.3f ms.\n", defsfile, deftimer.TimeMS()); } + TileFiles.SetBackup(); userConfig.AddDefs.reset(); } diff --git a/source/sw/src/game.cpp b/source/sw/src/game.cpp index c1e9406e5..13299f227 100644 --- a/source/sw/src/game.cpp +++ b/source/sw/src/game.cpp @@ -234,7 +234,8 @@ void GameInterface::app_init() LoadCustomInfoFromScript("swcustom.txt"); // Load user customisation information if (!loaddefinitionsfile(G_DefFile())) Printf(PRINT_NONOTIFY, "Definitions file loaded.\n"); - userConfig.AddDefs.reset(); + TileFiles.SetBackup(); + userConfig.AddDefs.reset(); InitFX(); }