- fixed compilation

This commit is contained in:
Christoph Oelckers 2020-05-24 22:37:50 +02:00
parent bfd11f9cca
commit 53891004a0
3 changed files with 10 additions and 10 deletions

View file

@ -539,7 +539,7 @@ static int32_t defsparser(scriptfile *script)
break; break;
} }
if (!check_tile("artfile", tile, script, cmdtokptr)) if (!check_tile("artfile", tile, script, cmdtokptr))
TileFiles.LoadArtFile(fn, false, tile); TileFiles.LoadArtFile(fn, nullptr, tile);
} }
break; break;
case T_SETUPTILE: case T_SETUPTILE:

View file

@ -145,7 +145,7 @@ void BuildTiles::AddTile(int tilenum, FTexture* tex, bool permap)
// //
//=========================================================================== //===========================================================================
void BuildTiles::AddTiles (int firsttile, TArray<uint8_t>& RawData, bool permap) void BuildTiles::AddTiles (int firsttile, TArray<uint8_t>& RawData, const char *mapname)
{ {
const uint8_t *tiles = RawData.Data(); const uint8_t *tiles = RawData.Data();
@ -362,7 +362,7 @@ void BuildTiles::MakeCanvas(int tilenum, int width, int height)
// //
//=========================================================================== //===========================================================================
int BuildTiles::LoadArtFile(const char *fn, bool mapart, int firsttile) int BuildTiles::LoadArtFile(const char *fn, const char *mapname, int firsttile)
{ {
auto old = FindFile(fn); auto old = FindFile(fn);
if (old >= ArtFiles.Size()) // Do not process if already loaded. if (old >= ArtFiles.Size()) // Do not process if already loaded.
@ -381,12 +381,12 @@ int BuildTiles::LoadArtFile(const char *fn, bool mapart, int firsttile)
// Only load the data if the header is present // Only load the data if the header is present
if (CountTiles(fn, artptr) > 0) if (CountTiles(fn, artptr) > 0)
{ {
auto& descs = mapart ? PerMapArtFiles : ArtFiles; auto& descs = mapname ? PerMapArtFiles : ArtFiles;
auto file = new BuildArtFile; auto file = new BuildArtFile;
descs.Push(file); descs.Push(file);
file->filename = fn; file->filename = fn;
file->RawData = std::move(artdata); file->RawData = std::move(artdata);
AddTiles(firsttile, file->RawData, mapart); AddTiles(firsttile, file->RawData, mapname);
} }
} }
} }
@ -417,11 +417,11 @@ void BuildTiles::LoadArtSet(const char* filename)
for (int index = 0; index < MAXARTFILES_BASE; index++) for (int index = 0; index < MAXARTFILES_BASE; index++)
{ {
FStringf fn(filename, index); FStringf fn(filename, index);
LoadArtFile(fn, false); LoadArtFile(fn, nullptr);
} }
for (auto& addart : addedArt) for (auto& addart : addedArt)
{ {
LoadArtFile(addart, false); LoadArtFile(addart, nullptr);
} }
} }
@ -664,7 +664,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", filename, i);
TileFiles.LoadArtFile(fullname, true); TileFiles.LoadArtFile(fullname, filename);
} }
TileFiles.SetupReverseTileMap(); TileFiles.SetupReverseTileMap();
} }

View file

@ -293,7 +293,7 @@ struct BuildTiles
void AddTile(int tilenum, FTexture* tex, bool permap = false); void AddTile(int tilenum, FTexture* tex, bool permap = false);
void AddTiles(int firsttile, TArray<uint8_t>& store, bool permap); void AddTiles(int firsttile, TArray<uint8_t>& store, const char *mapname);
void AddFile(BuildArtFile* bfd, bool permap) void AddFile(BuildArtFile* bfd, bool permap)
{ {
@ -304,7 +304,7 @@ struct BuildTiles
{ {
return ArtFiles.FindEx([filename](const BuildArtFile* element) { return filename.CompareNoCase(element->filename) == 0; }); return ArtFiles.FindEx([filename](const BuildArtFile* element) { return filename.CompareNoCase(element->filename) == 0; });
} }
int LoadArtFile(const char* file, bool mapart = false, int firsttile = -1); int LoadArtFile(const char* file, const char *mapname = nullptr, int firsttile = -1);
void CloseAllMapArt(); void CloseAllMapArt();
void LoadArtSet(const char* filename); void LoadArtSet(const char* filename);
void AddArt(TArray<FString>& art) void AddArt(TArray<FString>& art)