- make map art work.

This commit is contained in:
Christoph Oelckers 2021-04-14 14:16:09 +02:00
parent b5dbc3cf29
commit bc007d75de

View file

@ -598,13 +598,14 @@ void artClearMapArt(void)
void artSetupMapArt(const char* filename) void artSetupMapArt(const char* filename)
{ {
if (currentMapArt.CompareNoCase(filename)) return; FString lcfilename = StripExtension(filename);
currentMapArt = filename;
artClearMapArt();
FString lcfilename = filename;
lcfilename.MakeLower(); lcfilename.MakeLower();
if (currentMapArt.CompareNoCase(lcfilename) == 0) return;
artClearMapArt();
currentMapArt = lcfilename;
// Re-get from the texture manager if this map's tiles have already been created. // Re-get from the texture manager if this map's tiles have already been created.
if (TileFiles.maptilesadded.Find(lcfilename) < TileFiles.maptilesadded.Size()) if (TileFiles.maptilesadded.Find(lcfilename) < TileFiles.maptilesadded.Size())
{ {
@ -634,7 +635,7 @@ void artSetupMapArt(const char* filename)
for (bssize_t i = 0; i < MAXARTFILES_TOTAL - MAXARTFILES_BASE; i++) for (bssize_t i = 0; i < MAXARTFILES_TOTAL - MAXARTFILES_BASE; i++)
{ {
FStringf fullname("%s_%02d.art", filename, i); FStringf fullname("%s_%02d.art", lcfilename.GetChars(), i);
TileFiles.LoadArtFile(fullname, filename); TileFiles.LoadArtFile(fullname, filename);
} }
} }