- fixed: The tile manager created its backup arrays before loading .def files.

This could let such textures disappear with the new main loop.
This commit is contained in:
Christoph Oelckers 2020-09-02 00:36:49 +02:00
parent 8d63e735d0
commit e5612b82c7
6 changed files with 16 additions and 2 deletions

View file

@ -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();

View file

@ -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)
{

View file

@ -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);

View file

@ -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();

View file

@ -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();
}

View file

@ -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();
}