diff --git a/source/common/fonts/font.cpp b/source/common/fonts/font.cpp index 063f31077..be02a8b59 100644 --- a/source/common/fonts/font.cpp +++ b/source/common/fonts/font.cpp @@ -106,7 +106,7 @@ FFont::FFont (const char *name, const char *nametemplate, const char *filetempla size_t index; for(index = 0; index < folderdata.size(); index++) { - if (infpath.CompareNoCase(folderdata[i].name) == 0) break; + if (infpath.CompareNoCase(folderdata[index].name) == 0) break; } if (index < folderdata.size()) diff --git a/source/core/defparser.cpp b/source/core/defparser.cpp index ea9eba6f6..e8db92104 100644 --- a/source/core/defparser.cpp +++ b/source/core/defparser.cpp @@ -1979,7 +1979,7 @@ void loaddefinitionsfile(TilesetBuildInfo& info, const char* fn, bool cumulative while ((lump = fileSystem.FindLumpFullName(fn, &lastlump)) >= 0) { if (maingame && fileSystem.GetFileContainer(lump) > fileSystem.GetMaxIwadNum()) break; - Printf(PRINT_NONOTIFY, "Loading \"%s\"\n", fileSystem.GetFileFullPath(lump).GetChars()); + Printf(PRINT_NONOTIFY, "Loading \"%s\"\n", fileSystem.GetFileFullPath(lump).c_str()); deftimer.Clock(); parseit(lump); printtimer(fn); diff --git a/source/core/gamecontrol.cpp b/source/core/gamecontrol.cpp index b1e399646..b67547617 100644 --- a/source/core/gamecontrol.cpp +++ b/source/core/gamecontrol.cpp @@ -145,7 +145,7 @@ FILE* hashfile; InputState inputState; int ShowStartupWindow(TArray &); -TArray GetGameFronUserFiles(); +std::vector GetGameFronUserFiles(); void InitFileSystem(TArray&); void I_SetWindowTitle(const char* caption); void S_ParseSndInfo(); @@ -732,7 +732,7 @@ static TArray SetupGame() int g = 0; for (auto& grp : groups) { - if (grp.FileInfo.gameid.CompareNoCase(str) == 0) + if (grp.FileInfo.gameid.CompareNoCase(str.c_str()) == 0) { userConfig.gamegrp = grp.FileName; groupno = g; diff --git a/source/core/initfs.cpp b/source/core/initfs.cpp index 49ff2f1a4..29372fcfe 100644 --- a/source/core/initfs.cpp +++ b/source/core/initfs.cpp @@ -60,10 +60,10 @@ static const char* validexts[] = { "*.grp", "*.zip", "*.pk3", "*.pk4", "*.7z", " // //========================================================================== -static TArray ParseGameInfo(TArray& pwads, const char* fn, const char* data, int size) +static std::vector ParseGameInfo(std::vector& pwads, const char* fn, const char* data, int size) { FScanner sc; - TArray bases; + std::vector bases; int pos = 0; const char* lastSlash = strrchr(fn, '/'); @@ -78,7 +78,7 @@ static TArray ParseGameInfo(TArray& pwads, const char* fn, con if (!nextKey.CompareNoCase("GAME")) { sc.MustGetString(); - bases.Push(sc.String); + bases.push_back(sc.String); } else if (!nextKey.CompareNoCase("LOAD")) { @@ -149,17 +149,17 @@ static TArray ParseGameInfo(TArray& pwads, const char* fn, con // //========================================================================== -static TArray CheckGameInfo(TArray& pwads) +static std::vector CheckGameInfo(std::vector& pwads) { // scan the list of WADs backwards to find the last one that contains a GAMEINFO lump - for (int i = pwads.Size() - 1; i >= 0; i--) + for (int i = (int)pwads.size() - 1; i >= 0; i--) { bool isdir = false; FResourceFile* resfile; - const char* filename = pwads[i]; + const char* filename = pwads[i].c_str(); // Does this exist? If so, is it a directory? - if (!DirEntryExists(pwads[i], &isdir)) + if (!DirEntryExists(pwads[i].c_str(), &isdir)) { Printf(TEXTCOLOR_RED "Could not find %s\n", filename); continue; @@ -197,7 +197,7 @@ static TArray CheckGameInfo(TArray& pwads) delete resfile; } } - return TArray(); + return std::vector(); } //========================================================================== @@ -206,9 +206,9 @@ static TArray CheckGameInfo(TArray& pwads) // //========================================================================== -TArray GetGameFronUserFiles() +std::vector GetGameFronUserFiles() { - TArray Files; + std::vector Files; if (userConfig.AddFilesPre) for (auto& file : *userConfig.AddFilesPre) { @@ -229,13 +229,13 @@ TArray GetGameFronUserFiles() if (DirEntryExists(fn, &isdir) && isdir) { // Insert the GRPs before this entry itself. - FString lastfn; - Files.Pop(lastfn); + std::string lastfn = std::move(Files.back()); + Files.pop_back(); for (auto ext : validexts) { D_AddDirectory(Files, fn, ext, GameConfig); } - Files.Push(lastfn); + Files.push_back(std::move(lastfn)); } } } @@ -324,7 +324,7 @@ static int FileSystemPrintf(FSMessageLevel level, const char* fmt, ...) void InitFileSystem(TArray& groups) { TArray dependencies; - TArray Files; + std::vector Files; // First comes the engine's own stuff. const char* baseres = BaseFileSearch(ENGINERES_FILE, nullptr, true, GameConfig); @@ -369,7 +369,7 @@ void InitFileSystem(TArray& groups) i--; } fileSystem.SetIwadNum(1); - fileSystem.SetMaxIwadNum(Files.Size() - 1); + fileSystem.SetMaxIwadNum((int)Files.size() - 1); D_AddConfigFiles(Files, "Global.Autoload", "*.grp", GameConfig); @@ -402,13 +402,13 @@ void InitFileSystem(TArray& groups) if (DirEntryExists(fname, &isdir) && isdir) { // Insert the GRPs before this entry itself. - FString lastfn; - Files.Pop(lastfn); + std::string lastfn = std::move(Files.back()); + Files.pop_back(); for (auto ext : validexts) { D_AddDirectory(Files, fname, ext, GameConfig); } - Files.Push(lastfn); + Files.push_back(std::move(lastfn)); } } } diff --git a/source/core/raze_music.cpp b/source/core/raze_music.cpp index 43594c570..7a1f16e2a 100644 --- a/source/core/raze_music.cpp +++ b/source/core/raze_music.cpp @@ -166,7 +166,7 @@ FileReader OpenMusic(const char* musicname) { Printf(TEXTCOLOR_RED "Unable to play music " TEXTCOLOR_WHITE "\"%s\"\n", musicname); } - else if (printmusicinfo) Printf("Playing music from file system %s:%s\n", fileSystem.GetResourceFileFullName(fileSystem.GetFileContainer(lumpnum)), fileSystem.GetFileFullPath(lumpnum).GetChars()); + else if (printmusicinfo) Printf("Playing music from file system %s:%s\n", fileSystem.GetResourceFileFullName(fileSystem.GetFileContainer(lumpnum)), fileSystem.GetFileFullPath(lumpnum).c_str()); } } } diff --git a/source/core/rendering/hw_voxels.cpp b/source/core/rendering/hw_voxels.cpp index 390a62011..89c1d7467 100644 --- a/source/core/rendering/hw_voxels.cpp +++ b/source/core/rendering/hw_voxels.cpp @@ -102,7 +102,7 @@ void LoadVoxelModels() if (voxmodels[i]) voxmodels[i]->scale = voxscale[i]; else - Printf("Unable to load voxel from %s\n", fileSystem.GetFileFullPath(lumpnum).GetChars()); + Printf("Unable to load voxel from %s\n", fileSystem.GetFileFullPath(lumpnum).c_str()); } else { diff --git a/source/core/zcompile.cpp b/source/core/zcompile.cpp index ab262fd65..59a8fe33c 100644 --- a/source/core/zcompile.cpp +++ b/source/core/zcompile.cpp @@ -65,12 +65,12 @@ void ParseScripts() if (FScriptPosition::ErrorCounter > 0) { // Abort if the compiler produced any errors. Also do not compile further lumps, because they very likely miss some stuff. - I_Error("%d errors, %d warnings while compiling %s", FScriptPosition::ErrorCounter, FScriptPosition::WarnCounter, fileSystem.GetFileFullPath(lump).GetChars()); + I_Error("%d errors, %d warnings while compiling %s", FScriptPosition::ErrorCounter, FScriptPosition::WarnCounter, fileSystem.GetFileFullPath(lump).c_str()); } else if (FScriptPosition::WarnCounter > 0) { // If we got warnings, but no errors, print the information but continue. - Printf(TEXTCOLOR_ORANGE "%d warnings while compiling %s\n", FScriptPosition::WarnCounter, fileSystem.GetFileFullPath(lump).GetChars()); + Printf(TEXTCOLOR_ORANGE "%d warnings while compiling %s\n", FScriptPosition::WarnCounter, fileSystem.GetFileFullPath(lump).c_str()); } }