diff options
| author | Shauren <shauren.trinity@gmail.com> | 2023-08-15 20:10:04 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2023-08-15 20:10:04 +0200 |
| commit | aaa6e73c8ca6d60e943cb964605536eb78219db2 (patch) | |
| tree | f5a0187925e646ef071d647efa7a5dac20501813 /src/tools/map_extractor | |
| parent | 825c697a764017349ca94ecfca8f30a8365666c0 (diff) | |
Core/Logging: Switch from fmt::sprintf to fmt::format (c++20 standard compatible api)
(cherry picked from commit d791afae1dfcfaf592326f787755ca32d629e4d3)
Diffstat (limited to 'src/tools/map_extractor')
| -rw-r--r-- | src/tools/map_extractor/System.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/tools/map_extractor/System.cpp b/src/tools/map_extractor/System.cpp index 6b83a7d046d..b92f0d1668a 100644 --- a/src/tools/map_extractor/System.cpp +++ b/src/tools/map_extractor/System.cpp @@ -171,7 +171,7 @@ void HandleArgs(int argc, char * arg[]) uint32 ReadBuild(int locale) { // include build info file also - std::string filename = Trinity::StringFormat("component.wow-%s.txt", langs[locale]); + std::string filename = Trinity::StringFormat("component.wow-{}.txt", langs[locale]); //printf("Read %s file... ", filename.c_str()); MPQFile m(filename.c_str()); @@ -940,7 +940,7 @@ void ExtractMapsFromMpq(uint32 build) printf("Extract %s (%d/%u) \n", map_ids[z].name, z+1, map_count); // Loadup map grid data - mpqMapName = Trinity::StringFormat("World\\Maps\\%s\\%s.wdt", map_ids[z].name, map_ids[z].name); + mpqMapName = Trinity::StringFormat("World\\Maps\\{}\\{}.wdt", map_ids[z].name, map_ids[z].name); WDT_file wdt; if (!wdt.loadFile(mpqMapName, false)) { @@ -955,8 +955,8 @@ void ExtractMapsFromMpq(uint32 build) if (!wdt.main->adt_list[y][x].exist) continue; - mpqFileName = Trinity::StringFormat("World\\Maps\\%s\\%s_%u_%u.adt", map_ids[z].name, map_ids[z].name, x, y); - outputFileName = Trinity::StringFormat("%s/maps/%03u%02u%02u.map", output_path, map_ids[z].id, y, x); + mpqFileName = Trinity::StringFormat("World\\Maps\\{}\\{}_{}_{}.adt", map_ids[z].name, map_ids[z].name, x, y); + outputFileName = Trinity::StringFormat("{}/maps/{:03}{:02}{:02}.map", output_path, map_ids[z].id, y, x); ConvertADT(mpqFileName, outputFileName, y, x, build); } // draw progress bar @@ -1084,7 +1084,7 @@ void ExtractCameraFiles(int locale, bool basicLocale) void LoadLocaleMPQFiles(int const locale) { - std::string fileName = Trinity::StringFormat("%s/Data/%s/locale-%s.MPQ", input_path, langs[locale], langs[locale]); + std::string fileName = Trinity::StringFormat("{}/Data/{}/locale-{}.MPQ", input_path, langs[locale], langs[locale]); new MPQArchive(fileName.c_str()); @@ -1092,9 +1092,9 @@ void LoadLocaleMPQFiles(int const locale) { std::string ext; if (i > 1) - ext = Trinity::StringFormat("-%i", i); + ext = Trinity::StringFormat("-{}", i); - fileName = Trinity::StringFormat("%s/Data/%s/patch-%s%s.MPQ", input_path, langs[locale], langs[locale], ext.c_str()); + fileName = Trinity::StringFormat("{}/Data/{}/patch-{}{}.MPQ", input_path, langs[locale], langs[locale], ext); if (boost::filesystem::exists(fileName)) new MPQArchive(fileName.c_str()); } @@ -1106,7 +1106,7 @@ void LoadCommonMPQFiles() int count = sizeof(CONF_mpq_list)/sizeof(char*); for(int i = 0; i < count; ++i) { - fileName = Trinity::StringFormat("%s/Data/%s", input_path, CONF_mpq_list[i]); + fileName = Trinity::StringFormat("{}/Data/{}", input_path, CONF_mpq_list[i]); if (boost::filesystem::exists(fileName)) new MPQArchive(fileName.c_str()); } @@ -1129,7 +1129,7 @@ int main(int argc, char * arg[]) for (int i = 0; i < LANG_COUNT; i++) { - std::string filename = Trinity::StringFormat("%s/Data/%s/locale-%s.MPQ", input_path, langs[i], langs[i]); + std::string filename = Trinity::StringFormat("{}/Data/{}/locale-{}.MPQ", input_path, langs[i], langs[i]); if (boost::filesystem::exists(filename)) { printf("Detected locale: %s\n", langs[i]); |
