aboutsummaryrefslogtreecommitdiff
path: root/src/tools/map_extractor
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2023-01-08 21:16:53 +0100
committerShauren <shauren.trinity@gmail.com>2023-01-08 21:16:53 +0100
commitd791afae1dfcfaf592326f787755ca32d629e4d3 (patch)
tree54dc9916ede5800e110a2f0edff91530811fbdb8 /src/tools/map_extractor
parentb6820a706f46f18b9652fcd9806e4bec8805d29d (diff)
Core/Logging: Switch from fmt::sprintf to fmt::format (c++20 standard compatible api)
Diffstat (limited to 'src/tools/map_extractor')
-rw-r--r--src/tools/map_extractor/System.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/tools/map_extractor/System.cpp b/src/tools/map_extractor/System.cpp
index c9ca1b05195..e29869123c4 100644
--- a/src/tools/map_extractor/System.cpp
+++ b/src/tools/map_extractor/System.cpp
@@ -1031,7 +1031,7 @@ bool ConvertADT(uint32 fileDataId, std::string const& mapName, std::string const
{
ChunkedFile adt;
- if (!adt.loadFile(CascStorage, fileDataId, Trinity::StringFormat("Map %s grid [%u,%u]", mapName.c_str(), gx, gy)))
+ if (!adt.loadFile(CascStorage, fileDataId, Trinity::StringFormat("Map {} grid [{},{}]", mapName, gx, gy)))
return false;
return ConvertADT(adt, mapName, outputPath, gx, gy, build, ignoreDeepWater);
@@ -1085,7 +1085,7 @@ void ExtractMaps(uint32 build)
// Loadup map grid data
ChunkedFile wdt;
std::bitset<(WDT_MAP_SIZE) * (WDT_MAP_SIZE)> existingTiles;
- if (wdt.loadFile(CascStorage, map_ids[z].WdtFileDataId, Trinity::StringFormat("WDT for map %u", map_ids[z].Id), false))
+ if (wdt.loadFile(CascStorage, map_ids[z].WdtFileDataId, Trinity::StringFormat("WDT for map {}", map_ids[z].Id), false))
{
FileChunk* mphd = wdt.GetChunk("MPHD");
FileChunk* main = wdt.GetChunk("MAIN");
@@ -1097,7 +1097,7 @@ void ExtractMaps(uint32 build)
if (!(main->As<wdt_MAIN>()->adt_list[y][x].flag & 0x1))
continue;
- outputFileName = Trinity::StringFormat("%s/maps/%04u_%02u_%02u.map", output_path.string().c_str(), map_ids[z].Id, y, x);
+ outputFileName = Trinity::StringFormat("{}/maps/{:04}_{:02}_{:02}.map", output_path.string(), map_ids[z].Id, y, x);
bool ignoreDeepWater = IsDeepWaterIgnored(map_ids[z].Id, y, x);
if (mphd && mphd->As<wdt_MPHD>()->flags & 0x200)
{
@@ -1105,7 +1105,7 @@ void ExtractMaps(uint32 build)
}
else
{
- std::string storagePath = Trinity::StringFormat(R"(World\Maps\%s\%s_%u_%u.adt)", map_ids[z].Directory.c_str(), map_ids[z].Directory.c_str(), x, y);
+ std::string storagePath = Trinity::StringFormat(R"(World\Maps\{}\{}_{}_{}.adt)", map_ids[z].Directory, map_ids[z].Directory, x, y);
existingTiles[y * WDT_MAP_SIZE + x] = ConvertADT(storagePath, map_ids[z].Name, outputFileName, y, x, build, ignoreDeepWater);
}
}
@@ -1116,7 +1116,7 @@ void ExtractMaps(uint32 build)
}
}
- if (FILE* tileList = fopen(Trinity::StringFormat("%s/maps/%04u.tilelist", output_path.string().c_str(), map_ids[z].Id).c_str(), "wb"))
+ if (FILE* tileList = fopen(Trinity::StringFormat("{}/maps/{:04}.tilelist", output_path.string(), map_ids[z].Id).c_str(), "wb"))
{
fwrite(MapMagic.data(), 1, MapMagic.size(), tileList);
fwrite(&MapVersionMagic, 1, sizeof(MapVersionMagic), tileList);
@@ -1307,7 +1307,7 @@ void ExtractCameraFiles()
std::unique_ptr<CASC::File> cameraFile(CascStorage->OpenFile(cameraFileDataId, CASC_LOCALE_NONE));
if (cameraFile)
{
- boost::filesystem::path filePath = outputPath / Trinity::StringFormat("FILE%08X.xxx", cameraFileDataId);
+ boost::filesystem::path filePath = outputPath / Trinity::StringFormat("FILE{:08X}.xxx", cameraFileDataId);
if (!boost::filesystem::exists(filePath))
if (ExtractFile(cameraFile.get(), filePath.string()))