diff --git a/src/am_map.cpp b/src/am_map.cpp index 8510eafa19..efd33ae700 100644 --- a/src/am_map.cpp +++ b/src/am_map.cpp @@ -792,9 +792,9 @@ void FMapInfoParser::ParseAMColors(bool overlay) { sc.MustGetToken(TK_StringConst); FString color = sc.String; - FString colorName = V_GetColorStringByName(color); + FString colorName = V_GetColorStringByName(color.GetChars()); if(!colorName.IsEmpty()) color = colorName; - int colorval = V_GetColorFromString(color); + int colorval = V_GetColorFromString(color.GetChars()); cset.c[i].FromRGB(RPART(colorval), GPART(colorval), BPART(colorval)); colorset = true; break; @@ -872,10 +872,10 @@ void AM_StaticInit() CheatKey.Clear(); EasyKey.Clear(); - if (gameinfo.mMapArrow.IsNotEmpty()) AM_ParseArrow(MapArrow, gameinfo.mMapArrow); - if (gameinfo.mCheatMapArrow.IsNotEmpty()) AM_ParseArrow(CheatMapArrow, gameinfo.mCheatMapArrow); - AM_ParseArrow(CheatKey, gameinfo.mCheatKey); - AM_ParseArrow(EasyKey, gameinfo.mEasyKey); + if (gameinfo.mMapArrow.IsNotEmpty()) AM_ParseArrow(MapArrow, gameinfo.mMapArrow.GetChars()); + if (gameinfo.mCheatMapArrow.IsNotEmpty()) AM_ParseArrow(CheatMapArrow, gameinfo.mCheatMapArrow.GetChars()); + AM_ParseArrow(CheatKey, gameinfo.mCheatKey.GetChars()); + AM_ParseArrow(EasyKey, gameinfo.mEasyKey.GetChars()); if (MapArrow.Size() == 0) I_FatalError("No automap arrow defined"); char namebuf[9]; @@ -1360,7 +1360,7 @@ void DAutomap::LevelInit () } else { - mapback = TexMan.CheckForTexture(Level->info->MapBackground, ETextureType::MiscPatch); + mapback = TexMan.CheckForTexture(Level->info->MapBackground.GetChars(), ETextureType::MiscPatch); } clearMarks(); diff --git a/src/common/console/c_bind.cpp b/src/common/console/c_bind.cpp index 57499e68c2..fe794c736d 100644 --- a/src/common/console/c_bind.cpp +++ b/src/common/console/c_bind.cpp @@ -429,14 +429,14 @@ void FKeyBindings::ArchiveBindings(FConfigFile *f, const char *matchcmd) f->ClearKey(ConfigKeyName(i)); } } - else if (matchcmd == nullptr || stricmp(Binds[i], matchcmd) == 0) + else if (matchcmd == nullptr || Binds[i].CompareNoCase(matchcmd) == 0) { if (Binds[i][0] == '\1') { Binds[i] = ""; continue; } - f->SetValueForKey(ConfigKeyName(i), Binds[i]); + f->SetValueForKey(ConfigKeyName(i), Binds[i].GetChars()); if (matchcmd != nullptr) { // If saving a specific command, set a marker so that // it does not get saved in the general binding list. @@ -465,7 +465,7 @@ int FKeyBindings::GetKeysForCommand (const char *cmd, int *first, int *second) while (i < NUM_KEYS && c < 2) { - if (stricmp (cmd, Binds[i]) == 0) + if (stricmp (cmd, Binds[i].GetChars()) == 0) { if (c++ == 0) *first = i; @@ -490,7 +490,7 @@ TArray FKeyBindings::GetKeysForCommand (const char *cmd) while (i < NUM_KEYS) { - if (stricmp (cmd, Binds[i]) == 0) + if (stricmp (cmd, Binds[i].GetChars()) == 0) { result.Push(i); } @@ -511,7 +511,7 @@ void FKeyBindings::UnbindACommand (const char *str) for (i = 0; i < NUM_KEYS; i++) { - if (!stricmp (str, Binds[i])) + if (!stricmp (str, Binds[i].GetChars())) { Binds[i] = ""; } @@ -538,7 +538,7 @@ void FKeyBindings::DefaultBind(const char *keyname, const char *cmd) } for (int i = 0; i < NUM_KEYS; ++i) { - if (!Binds[i].IsEmpty() && stricmp (Binds[i], cmd) == 0) + if (!Binds[i].IsEmpty() && stricmp (Binds[i].GetChars(), cmd) == 0) { // This command is already bound to a key. return; } diff --git a/src/common/console/c_cvars.h b/src/common/console/c_cvars.h index 4d2737ab3d..c560bb1658 100644 --- a/src/common/console/c_cvars.h +++ b/src/common/console/c_cvars.h @@ -412,8 +412,8 @@ public: const char *operator= (const char *stringrep) { UCVarValue val; val.String = const_cast(stringrep); SetGenericRep (val, CVAR_String); return stringrep; } - inline operator const char * () const { return mValue; } - inline const char *operator *() const { return mValue; } + inline operator const char * () const { return mValue.GetChars(); } + inline const char *operator *() const { return mValue.GetChars(); } protected: virtual void DoSet (UCVarValue value, ECVarType type); diff --git a/src/common/engine/stringtable.cpp b/src/common/engine/stringtable.cpp index ef32369422..0774a7a9ba 100644 --- a/src/common/engine/stringtable.cpp +++ b/src/common/engine/stringtable.cpp @@ -165,10 +165,7 @@ bool FStringTable::readMacros(int lumpnum) for (unsigned i = 1; i < data.Size(); i++) { auto macroname = data[i][0]; - auto language = data[i][1]; - if (macroname.IsEmpty() || language.IsEmpty()) continue; - FStringf combined_name("%s/%s", language.GetChars(), macroname.GetChars()); - FName name = combined_name.GetChars(); + FName name = macroname.GetChars(); StringMacro macro; @@ -446,9 +443,8 @@ void FStringTable::InsertString(int lumpnum, int langid, FName label, const FStr break; } FString macroname(te.strings[0].GetChars() + index + 2, endindex - index - 2); - FStringf lookupstr("%s/%s", strlangid, macroname.GetChars()); FStringf replacee("@[%s]", macroname.GetChars()); - FName lookupname(lookupstr.GetChars(), true); + FName lookupname(macroname.GetChars(), true); auto replace = allMacros.CheckKey(lookupname); for (int i = 0; i < 4; i++) { diff --git a/src/common/platform/win32/i_dijoy.cpp b/src/common/platform/win32/i_dijoy.cpp index c22c5492ba..a81fa1a269 100644 --- a/src/common/platform/win32/i_dijoy.cpp +++ b/src/common/platform/win32/i_dijoy.cpp @@ -898,7 +898,7 @@ const char *FDInputJoystick::GetAxisName(int axis) { if (unsigned(axis) < Axes.Size()) { - return Axes[axis].Name; + return Axes[axis].Name.GetChars(); } return "Invalid"; } diff --git a/src/common/platform/win32/i_mainwindow.cpp b/src/common/platform/win32/i_mainwindow.cpp index 4c4f615689..64ddaa5da4 100644 --- a/src/common/platform/win32/i_mainwindow.cpp +++ b/src/common/platform/win32/i_mainwindow.cpp @@ -738,7 +738,7 @@ void MainWindow::FlushBufferedConsoleStuff() { for (unsigned i = 0; i < bufferedConsoleStuff.Size(); i++) { - DoPrintStr(bufferedConsoleStuff[i]); + DoPrintStr(bufferedConsoleStuff[i].GetChars()); } bufferedConsoleStuff.Clear(); } diff --git a/src/common/platform/win32/i_rawps2.cpp b/src/common/platform/win32/i_rawps2.cpp index 8344315809..d406d61ea8 100644 --- a/src/common/platform/win32/i_rawps2.cpp +++ b/src/common/platform/win32/i_rawps2.cpp @@ -1242,8 +1242,8 @@ int FRawPS2Manager::DeviceSort(const void *a, const void *b) if (lex == 0) { // Skip device part of the ID and sort the connection part - const char *ca = strchr(ha->DeviceID, '#'); - const char *cb = strchr(hb->DeviceID, '#'); + const char *ca = strchr(ha->DeviceID.GetChars(), '#'); + const char *cb = strchr(hb->DeviceID.GetChars(), '#'); const char *ea, *eb; // The last bit looks like a controller number. Strip it out to be safe // if this is a multi-controller adapter. diff --git a/src/common/platform/win32/i_specialpaths.cpp b/src/common/platform/win32/i_specialpaths.cpp index 3bfee00ea4..62e1766d47 100644 --- a/src/common/platform/win32/i_specialpaths.cpp +++ b/src/common/platform/win32/i_specialpaths.cpp @@ -91,7 +91,7 @@ bool IsPortable() // A portable INI means that this storage location should also be portable if the file can be written to. FStringf path("%s" GAMENAMELOWERCASE "_portable.ini", progdir.GetChars()); - if (FileExists(path)) + if (FileExists(path.GetChars())) { file = CreateFile(path.WideString().c_str(), GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); @@ -145,7 +145,7 @@ FString M_GetAppDataPath(bool create) path += "/" GAMENAMELOWERCASE; if (create) { - CreatePath(path); + CreatePath(path.GetChars()); } return path; } @@ -167,7 +167,7 @@ FString M_GetCachePath(bool create) path += "/zdoom/cache"; if (create) { - CreatePath(path); + CreatePath(path.GetChars()); } return path; } @@ -217,7 +217,7 @@ FString M_GetOldConfigPath(int& type) } path << GAMENAMELOWERCASE "-" << FString(uname) << ".ini"; type = 0; - if (FileExists(path)) + if (FileExists(path.GetChars())) return path; } @@ -226,7 +226,7 @@ FString M_GetOldConfigPath(int& type) path = GetKnownFolder(CSIDL_APPDATA, FOLDERID_RoamingAppData, true); path += "/" GAME_DIR "/" GAMENAMELOWERCASE ".ini"; type = 1; - if (FileExists(path)) + if (FileExists(path.GetChars())) return path; return ""; @@ -283,9 +283,9 @@ FString M_GetConfigPath(bool for_reading) // Construct a user-specific config name FString path = GetKnownFolder(CSIDL_APPDATA, FOLDERID_Documents, true); path += "/My Games/" GAME_DIR; - CreatePath(path); + CreatePath(path.GetChars()); path += "/" GAMENAMELOWERCASE ".ini"; - if (!for_reading || FileExists(path)) + if (!for_reading || FileExists(path.GetChars())) return path; // No config was found in the accepted locations. @@ -305,7 +305,7 @@ FString M_GetConfigPath(bool for_reading) isportable = true; } } - bool res = MoveFileExW(WideString(oldpath).c_str(), WideString(path).c_str(), MOVEFILE_COPY_ALLOWED); + bool res = MoveFileExW(WideString(oldpath.GetChars()).c_str(), WideString(path.GetChars()).c_str(), MOVEFILE_COPY_ALLOWED); if (res) return path; else return oldpath; // if we cannot move, just use the config where it was. It won't be written back, though and never be used again if a new one gets saved. } @@ -314,7 +314,7 @@ FString M_GetConfigPath(bool for_reading) // If we are reading the config file, check if it exists. If not, fallback to base version. if (for_reading) { - if (!FileExists(path)) + if (!FileExists(path.GetChars())) { path = progdir; path << GAMENAMELOWERCASE ".ini"; @@ -351,7 +351,7 @@ FString M_GetScreenshotsPath() path = GetKnownFolder(CSIDL_MYPICTURES, FOLDERID_Pictures, true); path << "/Screenshots/" GAMENAME "/"; } - CreatePath(path); + CreatePath(path.GetChars()); return path; } @@ -402,7 +402,7 @@ FString M_GetDocumentsPath() // I assume since this isn't a standard folder, it doesn't have a localized name either. path = GetKnownFolder(CSIDL_PERSONAL, FOLDERID_Documents, true); path << "/My Games/" GAMENAME "/"; - CreatePath(path); + CreatePath(path.GetChars()); } return path; } diff --git a/src/common/platform/win32/i_system.cpp b/src/common/platform/win32/i_system.cpp index 0a9843e943..6da33867f0 100644 --- a/src/common/platform/win32/i_system.cpp +++ b/src/common/platform/win32/i_system.cpp @@ -409,9 +409,9 @@ BOOL CALLBACK IWADBoxCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPa ctrl = GetDlgItem(hDlg, IDC_IWADLIST); for (i = 0; i < NumWads; i++) { - const char *filepart = strrchr(WadList[i].Path, '/'); + const char *filepart = strrchr(WadList[i].Path.GetChars(), '/'); if (filepart == NULL) - filepart = WadList[i].Path; + filepart = WadList[i].Path.GetChars(); else filepart++; diff --git a/src/common/rendering/gles/gles_shader.cpp b/src/common/rendering/gles/gles_shader.cpp index 4fffa8b90b..f037e3e4a1 100644 --- a/src/common/rendering/gles/gles_shader.cpp +++ b/src/common/rendering/gles/gles_shader.cpp @@ -119,7 +119,7 @@ static FString CalcProgramBinaryChecksum(const FString &vertex, const FString &f static FString CreateProgramCacheName(bool create) { FString path = M_GetCachePath(create); - if (create) CreatePath(path); + if (create) CreatePath(path.GetChars()); path << "/shadercache.zdsc"; return path; } @@ -135,7 +135,7 @@ static void LoadShaders() { FString path = CreateProgramCacheName(false); FileReader fr; - if (!fr.OpenFile(path)) + if (!fr.OpenFile(path.GetChars())) I_Error("Could not open shader file"); char magic[4]; @@ -176,7 +176,7 @@ static void LoadShaders() static void SaveShaders() { FString path = CreateProgramCacheName(true); - std::unique_ptr fw(FileWriter::Open(path)); + std::unique_ptr fw(FileWriter::Open(path.GetChars())); if (fw) { uint32_t count = (uint32_t)ShaderCache.size(); @@ -234,7 +234,7 @@ bool FShader::Configure(const char* name, const char* vert_prog_lump, const char void FShader::LoadVariant() { //mDefinesBase - Load(mName.GetChars(), mVertProg, mFragProg, mFragProg2, mLightProg, mDefinesBase); + Load(mName.GetChars(), mVertProg.GetChars(), mFragProg.GetChars(), mFragProg2.GetChars(), mLightProg.GetChars(), mDefinesBase.GetChars()); } bool FShader::Load(const char * name, const char * vert_prog_lump_, const char * frag_prog_lump_, const char * proc_prog_lump_, const char * light_fragprog_, const char * defines) @@ -381,11 +381,11 @@ bool FShader::Load(const char * name, const char * vert_prog_lump_, const char * i_data += "#define NPOT_EMULATION\nuniform vec2 uNpotEmulation;\n"; #endif - int vp_lump = fileSystem.CheckNumForFullName(vert_prog_lump, 0); + int vp_lump = fileSystem.CheckNumForFullName(vert_prog_lump.GetChars(), 0); if (vp_lump == -1) I_Error("Unable to load '%s'", vert_prog_lump.GetChars()); auto vp_data = fileSystem.ReadFile(vp_lump); - int fp_lump = fileSystem.CheckNumForFullName(frag_prog_lump, 0); + int fp_lump = fileSystem.CheckNumForFullName(frag_prog_lump.GetChars(), 0); if (fp_lump == -1) I_Error("Unable to load '%s'", frag_prog_lump.GetChars()); auto fp_data = fileSystem.ReadFile(fp_lump); @@ -418,9 +418,9 @@ bool FShader::Load(const char * name, const char * vert_prog_lump_, const char * { fp_comb << "#line 1\n"; - if (*proc_prog_lump != '#') + if (proc_prog_lump[0] != '#') { - int pp_lump = fileSystem.CheckNumForFullName(proc_prog_lump); + int pp_lump = fileSystem.CheckNumForFullName(proc_prog_lump.GetChars()); if (pp_lump == -1) I_Error("Unable to load '%s'", proc_prog_lump.GetChars()); auto ppf = fileSystem.ReadFile(pp_lump); FString pp_data = GetStringFromLump(pp_lump); @@ -485,7 +485,7 @@ bool FShader::Load(const char * name, const char * vert_prog_lump_, const char * if (light_fragprog.Len()) { - int pp_lump = fileSystem.CheckNumForFullName(light_fragprog, 0); + int pp_lump = fileSystem.CheckNumForFullName(light_fragprog.GetChars(), 0); if (pp_lump == -1) I_Error("Unable to load '%s'", light_fragprog.GetChars()); fp_comb << GetStringFromLump(pp_lump) << "\n"; } @@ -722,8 +722,7 @@ bool FShader::Bind(ShaderFlavourData& flavour) //Printf("Shader: %s, %08x %s", mFragProg2.GetChars(), tag, variantConfig.GetChars()); - Load(mName.GetChars(), mVertProg, mFragProg, mFragProg2, mLightProg, mDefinesBase + variantConfig); - + Load(mName.GetChars(), mVertProg.GetChars(), mFragProg.GetChars(), mFragProg2.GetChars(), mLightProg.GetChars(), (mDefinesBase + variantConfig).GetChars()); variants.insert(std::make_pair(tag, cur)); } else diff --git a/src/common/rendering/gles/gles_shaderprogram.cpp b/src/common/rendering/gles/gles_shaderprogram.cpp index 289008c219..a6f0453c28 100644 --- a/src/common/rendering/gles/gles_shaderprogram.cpp +++ b/src/common/rendering/gles/gles_shaderprogram.cpp @@ -165,7 +165,7 @@ void FShaderProgram::Link(const char *name) glUseProgram(mProgram); for (auto &uni : samplerstobind) { - auto index = glGetUniformLocation(mProgram, uni.first); + auto index = glGetUniformLocation(mProgram, uni.first.GetChars()); if (index >= 0) { glUniform1i(index, uni.second); @@ -266,8 +266,8 @@ void FPresentShaderBase::Init(const char * vtx_shader_name, const char * program FString prolog = Uniforms.CreateDeclaration("Uniforms", PresentUniforms::Desc()); mShader.reset(new FShaderProgram()); - mShader->Compile(FShaderProgram::Vertex, "shaders_gles/pp/screenquad.vp", prolog, 330); - mShader->Compile(FShaderProgram::Fragment, vtx_shader_name, prolog, 330); + mShader->Compile(FShaderProgram::Vertex, "shaders_gles/pp/screenquad.vp", prolog.GetChars(), 330); + mShader->Compile(FShaderProgram::Fragment, vtx_shader_name, prolog.GetChars(), 330); mShader->Link(program_name); mShader->Bind(); Uniforms.Init(); diff --git a/src/common/rendering/vulkan/renderer/vk_renderpass.cpp b/src/common/rendering/vulkan/renderer/vk_renderpass.cpp index e445723d09..5917afd116 100644 --- a/src/common/rendering/vulkan/renderer/vk_renderpass.cpp +++ b/src/common/rendering/vulkan/renderer/vk_renderpass.cpp @@ -40,7 +40,7 @@ VkRenderPassManager::VkRenderPassManager(VulkanRenderDevice* fb) : fb(fb) { FString path = M_GetCachePath(true); - CreatePath(path); + CreatePath(path.GetChars()); CacheFilename = path + "/pipelinecache.zdpc"; PipelineCacheBuilder builder; @@ -49,7 +49,7 @@ VkRenderPassManager::VkRenderPassManager(VulkanRenderDevice* fb) : fb(fb) try { FileReader fr; - if (fr.OpenFile(CacheFilename)) + if (fr.OpenFile(CacheFilename.GetChars())) { std::vector data; data.resize(fr.GetLength()); @@ -71,7 +71,7 @@ VkRenderPassManager::~VkRenderPassManager() try { auto data = PipelineCache->GetCacheData(); - std::unique_ptr fw(FileWriter::Open(CacheFilename)); + std::unique_ptr fw(FileWriter::Open(CacheFilename.GetChars())); if (fw) fw->Write(data.data(), data.size()); } diff --git a/src/common/rendering/vulkan/shaders/vk_ppshader.cpp b/src/common/rendering/vulkan/shaders/vk_ppshader.cpp index 3aa6861eb8..dc4ace0f95 100644 --- a/src/common/rendering/vulkan/shaders/vk_ppshader.cpp +++ b/src/common/rendering/vulkan/shaders/vk_ppshader.cpp @@ -67,7 +67,7 @@ void VkPPShader::Reset() FString VkPPShader::LoadShaderCode(const FString &lumpName, const FString &defines, int version) { - int lump = fileSystem.CheckNumForFullName(lumpName); + int lump = fileSystem.CheckNumForFullName(lumpName.GetChars()); if (lump == -1) I_FatalError("Unable to load '%s'", lumpName.GetChars()); auto sp = fileSystem.ReadFile(lump); FString code = GetStringFromLump(lump); diff --git a/src/common/rendering/vulkan/shaders/vk_shader.cpp b/src/common/rendering/vulkan/shaders/vk_shader.cpp index 0140aa6cb6..227b8cca6c 100644 --- a/src/common/rendering/vulkan/shaders/vk_shader.cpp +++ b/src/common/rendering/vulkan/shaders/vk_shader.cpp @@ -73,12 +73,12 @@ bool VkShaderManager::CompileNextShader() { // user shaders - const FString& name = ExtractFileBase(usershaders[i].shader); + const FString& name = ExtractFileBase(usershaders[i].shader.GetChars()); FString defines = defaultshaders[usershaders[i].shaderType].Defines + usershaders[i].defines; VkShaderProgram prog; - prog.vert = LoadVertShader(name, mainvp, defines); - prog.frag = LoadFragShader(name, mainfp, usershaders[i].shader, defaultshaders[usershaders[i].shaderType].lightfunc, defines, true, compilePass == GBUFFER_PASS); + prog.vert = LoadVertShader(name, mainvp, defines.GetChars()); + prog.frag = LoadFragShader(name, mainfp, usershaders[i].shader.GetChars(), defaultshaders[usershaders[i].shaderType].lightfunc, defines.GetChars(), true, compilePass == GBUFFER_PASS); mMaterialShaders[compilePass].push_back(std::move(prog)); compileIndex++; diff --git a/src/common/scripting/backend/codegen.cpp b/src/common/scripting/backend/codegen.cpp index 5bf359e323..08668dd51a 100644 --- a/src/common/scripting/backend/codegen.cpp +++ b/src/common/scripting/backend/codegen.cpp @@ -1394,7 +1394,7 @@ FxExpression *FxColorCast::Resolve(FCompileContext &ctx) } else { - FxExpression *x = new FxConstant(V_GetColor(constval.GetString(), &ScriptPosition), ScriptPosition); + FxExpression *x = new FxConstant(V_GetColor(constval.GetString().GetChars(), &ScriptPosition), ScriptPosition); delete this; return x; } @@ -1474,7 +1474,7 @@ FxExpression *FxSoundCast::Resolve(FCompileContext &ctx) if (basex->isConstant()) { ExpVal constval = static_cast(basex)->GetValue(); - FxExpression *x = new FxConstant(S_FindSound(constval.GetString()), ScriptPosition); + FxExpression *x = new FxConstant(S_FindSound(constval.GetString().GetChars()), ScriptPosition); delete this; return x; } @@ -1552,7 +1552,7 @@ FxExpression *FxFontCast::Resolve(FCompileContext &ctx) else if ((basex->ValueType == TypeString || basex->ValueType == TypeName) && basex->isConstant()) { ExpVal constval = static_cast(basex)->GetValue(); - FFont *font = V_GetFont(constval.GetString()); + FFont *font = V_GetFont(constval.GetString().GetChars()); // Font must exist. Most internal functions working with fonts do not like null pointers. // If checking is needed scripts will have to call Font.GetFont themselves. if (font == nullptr) diff --git a/src/common/utility/cmdlib.cpp b/src/common/utility/cmdlib.cpp index 28cba8fcde..0086d1cd8b 100644 --- a/src/common/utility/cmdlib.cpp +++ b/src/common/utility/cmdlib.cpp @@ -528,7 +528,7 @@ void CreatePath(const char *fn) { FString name(fn); name += '/'; - DoCreatePath(name); + DoCreatePath(name.GetChars()); } else { @@ -805,13 +805,13 @@ FString ExpandEnvVars(const char *searchpathstring) if (length != 0) { FString varname = FString(dollar + 1, length); - if (stricmp(varname, "progdir") == 0) + if (varname.Compare("progdir") == 0) { out += progdir; } else { - char *varvalue = getenv(varname); + char *varvalue = getenv(varname.GetChars()); if ( (varvalue != NULL) && (strlen(varvalue) != 0) ) { out += varvalue; diff --git a/src/common/utility/configfile.cpp b/src/common/utility/configfile.cpp index 52bb4bcae0..cdd4e95197 100644 --- a/src/common/utility/configfile.cpp +++ b/src/common/utility/configfile.cpp @@ -85,7 +85,7 @@ FConfigFile::FConfigFile (const FConfigFile &other) Sections = CurrentSection = NULL; LastSectionPtr = &Sections; CurrentEntry = NULL; - ChangePathName (other.PathName); + ChangePathName (other.PathName.GetChars()); *this = other; OkayToWrite = other.OkayToWrite; FileExisted = other.FileExisted; @@ -134,7 +134,7 @@ FConfigFile &FConfigFile::operator = (const FConfigFile &other) while (fromsection != NULL) { fromentry = fromsection->RootEntry; - tosection = NewConfigSection (fromsection->SectionName); + tosection = NewConfigSection (fromsection->SectionName.GetChars()); while (fromentry != NULL) { NewConfigEntry (tosection, fromentry->Key, fromentry->Value); @@ -602,7 +602,7 @@ void FConfigFile::LoadConfigFile () bool succ; FileExisted = false; - if (!file.OpenFile (PathName)) + if (!file.OpenFile (PathName.GetChars())) { return; } @@ -739,7 +739,7 @@ FConfigFile::FConfigEntry *FConfigFile::ReadMultiLineValue(FileReader *file, FCo // Append this line to the value. value << readbuf; } - return NewConfigEntry(section, key, value); + return NewConfigEntry(section, key, value.GetChars()); } //==================================================================== @@ -787,7 +787,7 @@ bool FConfigFile::WriteConfigFile () const return true; } - FileWriter *file = FileWriter::Open (PathName); + FileWriter *file = FileWriter::Open (PathName.GetChars()); FConfigSection *section; FConfigEntry *entry; diff --git a/src/common/utility/findfile.cpp b/src/common/utility/findfile.cpp index e2c2ee7079..86d7098ec0 100644 --- a/src/common/utility/findfile.cpp +++ b/src/common/utility/findfile.cpp @@ -146,7 +146,7 @@ void D_AddWildFile(std::vector& wadfiles, const char* value, const auto path = ExtractFilePath(value); auto name = ExtractFileBase(value, true); if (path.IsEmpty()) path = "."; - if (FileSys::ScanDirectory(list, path, name, true)) + if (FileSys::ScanDirectory(list, path.GetChars(), name.GetChars(), true)) { for(auto& entry : list) { @@ -178,7 +178,7 @@ void D_AddConfigFiles(std::vector& wadfiles, const char* section, c { // D_AddWildFile resets config's position, so remember it config->GetPosition(pos); - D_AddWildFile(wadfiles, ExpandEnvVars(value), extension, config); + D_AddWildFile(wadfiles, ExpandEnvVars(value).GetChars(), extension, config); // Reset config's position to get next wad config->SetPosition(pos); } @@ -230,7 +230,7 @@ const char* BaseFileSearch(const char* file, const char* ext, bool lookfirstinpr if (lookfirstinprogdir) { BFSwad.Format("%s%s%s", progdir.GetChars(), progdir.Back() == '/' ? "" : "/", file); - if (DirEntryExists(BFSwad)) + if (DirEntryExists(BFSwad.GetChars())) { return BFSwad.GetChars(); } @@ -257,7 +257,7 @@ const char* BaseFileSearch(const char* file, const char* ext, bool lookfirstinpr if (dir.IsNotEmpty()) { BFSwad.Format("%s%s%s", dir.GetChars(), dir.Back() == '/' ? "" : "/", file); - if (DirEntryExists(BFSwad)) + if (DirEntryExists(BFSwad.GetChars())) { return BFSwad.GetChars(); } @@ -271,7 +271,7 @@ const char* BaseFileSearch(const char* file, const char* ext, bool lookfirstinpr { FString tmp = file; DefaultExtension(tmp, ext); - return BaseFileSearch(tmp, nullptr, lookfirstinprogdir, config); + return BaseFileSearch(tmp.GetChars(), nullptr, lookfirstinprogdir, config); } return nullptr; } diff --git a/src/ct_chat.cpp b/src/ct_chat.cpp index 1ced347020..acad5b35af 100644 --- a/src/ct_chat.cpp +++ b/src/ct_chat.cpp @@ -173,7 +173,7 @@ bool CT_Responder (event_t *ev) else if (ev->data1 == 'V' && (ev->data3 & GKM_CTRL)) #endif // __APPLE__ { - CT_PasteChat(I_GetFromClipboard(false)); + CT_PasteChat(I_GetFromClipboard(false).GetChars()); } } else if (ev->subtype == EV_GUI_Char) @@ -291,7 +291,7 @@ void CT_Drawer (void) DrawText(drawer, displayfont, CR_GREEN, 0, y, prompt.GetChars(), DTA_VirtualWidth, screen_width, DTA_VirtualHeight, screen_height, DTA_KeepRatio, true, TAG_DONE); - DrawText(drawer, displayfont, CR_GREY, promptwidth, y, printstr, + DrawText(drawer, displayfont, CR_GREY, promptwidth, y, printstr.GetChars(), DTA_VirtualWidth, screen_width, DTA_VirtualHeight, screen_height, DTA_KeepRatio, true, TAG_DONE); } } diff --git a/src/gamedata/a_keys.cpp b/src/gamedata/a_keys.cpp index e3defc739a..e61880dc2c 100644 --- a/src/gamedata/a_keys.cpp +++ b/src/gamedata/a_keys.cpp @@ -487,7 +487,7 @@ int P_CheckKeys (AActor *owner, int keynum, bool remote, bool quiet) { if (lock->check(owner)) return true; if (quiet) return false; - failtext = remote? lock->RemoteMsg : lock->Message; + failtext = remote? lock->RemoteMsg.GetChars() : lock->Message.GetChars(); failsound = &lock->locksound[0]; numfailsounds = lock->locksound.Size(); } diff --git a/src/gamedata/a_weapons.cpp b/src/gamedata/a_weapons.cpp index fa527d7708..5aa1473860 100644 --- a/src/gamedata/a_weapons.cpp +++ b/src/gamedata/a_weapons.cpp @@ -408,9 +408,9 @@ void FWeaponSlots::LocalSetup(PClassActor *type) { FString sectionclass(WeaponSection); sectionclass << '.' << type->TypeName.GetChars(); - if (RestoreSlots(GameConfig, sectionclass) == 0) + if (RestoreSlots(GameConfig, sectionclass.GetChars()) == 0) { - RestoreSlots(GameConfig, WeaponSection); + RestoreSlots(GameConfig, WeaponSection.GetChars()); } } else @@ -504,7 +504,7 @@ int FWeaponSlots::RestoreSlots(FConfigFile *config, const char *section) int slotsread = 0; section_name += ".Weapons"; - if (!config->SetSection(section_name)) + if (!config->SetSection(section_name.GetChars())) { return 0; } @@ -742,7 +742,7 @@ void P_PlaybackKeyConfWeapons(FWeaponSlots *slots) PlayingKeyConf = slots; for (unsigned int i = 0; i < KeyConfWeapons.Size(); ++i) { - AddCommandString(KeyConfWeapons[i]); + AddCommandString(KeyConfWeapons[i].GetChars()); } PlayingKeyConf = nullptr; } diff --git a/src/gamedata/textures/animations.cpp b/src/gamedata/textures/animations.cpp index 202b5bdb63..c2f903e306 100644 --- a/src/gamedata/textures/animations.cpp +++ b/src/gamedata/textures/animations.cpp @@ -723,9 +723,9 @@ void FTextureAnimator::ParseCameraTexture(FScanner &sc) width = sc.Number; sc.MustGetNumber (); height = sc.Number; - FTextureID picnum = TexMan.CheckForTexture (picname, ETextureType::Flat, texflags); + FTextureID picnum = TexMan.CheckForTexture (picname.GetChars(), ETextureType::Flat, texflags); auto canvas = new FCanvasTexture(width, height); - FGameTexture *viewer = MakeGameTexture(canvas, picname, ETextureType::Wall); + FGameTexture *viewer = MakeGameTexture(canvas, picname.GetChars(), ETextureType::Wall); if (picnum.Exists()) { auto oldtex = TexMan.GameTexture(picnum); @@ -805,7 +805,7 @@ void FTextureAnimator::FixAnimations () bool noremap = false; const char *name; - name = TexMan.GameTexture(anim->BasePic)->GetName(); + name = TexMan.GameTexture(anim->BasePic)->GetName().GetChars(); nodecals = TexMan.GameTexture(anim->BasePic)->allowNoDecals(); for (j = 0; j < anim->NumFrames; ++j) { diff --git a/src/gamedata/textures/buildloader.cpp b/src/gamedata/textures/buildloader.cpp index 2f076e29cb..a3955d6d86 100644 --- a/src/gamedata/textures/buildloader.cpp +++ b/src/gamedata/textures/buildloader.cpp @@ -158,7 +158,7 @@ void AddTiles(const FString& pathprefix, const void* tiles, FRemapTable *remap) if (width <= 0 || height <= 0) continue; FStringf name("%sBTIL%04d", pathprefix.GetChars(), i); - auto tex = MakeGameTexture(new FImageTexture(new FBuildTexture(pathprefix, i, tiledata, remap, width, height, xoffs, yoffs)), name, ETextureType::Override); + auto tex = MakeGameTexture(new FImageTexture(new FBuildTexture(pathprefix, i, tiledata, remap, width, height, xoffs, yoffs)), name.GetChars(), ETextureType::Override); texnum = TexMan.AddGameTexture(tex); tiledata += size; @@ -276,7 +276,7 @@ void InitBuildTiles() // only read from the same source as the palette. // The entire format here is just too volatile to allow liberal mixing. // An .ART set must be treated as one unit. - lumpnum = fileSystem.CheckNumForFullName(artpath, fileSystem.GetFileContainer(i)); + lumpnum = fileSystem.CheckNumForFullName(artpath.GetChars(), fileSystem.GetFileContainer(i)); if (lumpnum < 0) { break; diff --git a/src/playsim/bots/b_game.cpp b/src/playsim/bots/b_game.cpp index a43c83ce03..9cdde72abd 100644 --- a/src/playsim/bots/b_game.cpp +++ b/src/playsim/bots/b_game.cpp @@ -142,7 +142,7 @@ void FCajunMaster::Main(FLevelLocals *Level) { if (t_join == ((wanted_botnum - botnum) * SPAWN_DELAY)) { - if (!SpawnBot (getspawned[spawn_tries])) + if (!SpawnBot (getspawned[spawn_tries].GetChars())) wanted_botnum--; spawn_tries++; } @@ -309,7 +309,7 @@ bool FCajunMaster::SpawnBot (const char *name, int color) { // Keep the bot on the same team when switching levels concat.AppendFormat("\\team\\%d\n", thebot->lastteam); } - Net_WriteString (concat); + Net_WriteString (concat.GetChars()); } Net_WriteByte(thebot->skill.aiming); Net_WriteByte(thebot->skill.perfection); @@ -525,7 +525,7 @@ bool FCajunMaster::LoadBots () DPrintf (DMSG_ERROR, "No " BOTFILENAME ", so no bots\n"); return false; } - if (!sc.OpenFile(tmp)) + if (!sc.OpenFile(tmp.GetChars())) { Printf("Unable to open %s. So no bots\n", tmp.GetChars()); return false; diff --git a/src/rendering/swrenderer/r_swcolormaps.cpp b/src/rendering/swrenderer/r_swcolormaps.cpp index b303712eb7..1ff95c8b31 100644 --- a/src/rendering/swrenderer/r_swcolormaps.cpp +++ b/src/rendering/swrenderer/r_swcolormaps.cpp @@ -515,7 +515,7 @@ CCMD (testfade) { if ( !(colorstring = V_GetColorStringByName (argv[1])).IsEmpty() ) { - color = V_GetColorFromString (colorstring); + color = V_GetColorFromString (colorstring.GetChars()); } else { @@ -549,7 +549,7 @@ CCMD (testcolor) { if ( !(colorstring = V_GetColorStringByName (argv[1])).IsEmpty() ) { - color = V_GetColorFromString (colorstring); + color = V_GetColorFromString (colorstring.GetChars()); } else { diff --git a/src/rendering/swrenderer/r_swrenderer.cpp b/src/rendering/swrenderer/r_swrenderer.cpp index 4c2414db5a..b449baef41 100644 --- a/src/rendering/swrenderer/r_swrenderer.cpp +++ b/src/rendering/swrenderer/r_swrenderer.cpp @@ -273,7 +273,7 @@ void FSoftwareRenderer::SetColormap(FLevelLocals *Level) NormalLight.ChangeFade(Level->fadeto); if (Level->fadeto == 0) { - SetDefaultColormap(Level->info->FadeTable); + SetDefaultColormap(Level->info->FadeTable.GetChars()); } } diff --git a/src/scripting/backend/codegen_doom.cpp b/src/scripting/backend/codegen_doom.cpp index 9f2b37e849..f93422e30b 100644 --- a/src/scripting/backend/codegen_doom.cpp +++ b/src/scripting/backend/codegen_doom.cpp @@ -92,7 +92,7 @@ static FxExpression *CustomTypeCast(FxTypeCast *func, FCompileContext &ctx) delete func; return nullptr; } - FxExpression *x = new FxMultiNameState(s, basex->ScriptPosition); + FxExpression *x = new FxMultiNameState(s.GetChars(), basex->ScriptPosition); x = x->Resolve(ctx); basex = nullptr; delete func; @@ -811,10 +811,10 @@ FxMultiNameState::FxMultiNameState(const char *_statestring, const FScriptPositi if (scopeindex >= 0) { - scopename = FName(statestring, scopeindex, false); + scopename = FName(statestring.GetChars(), scopeindex, false); statestring = statestring.Right((ptrdiff_t)statestring.Len() - scopeindex - 2); } - names = MakeStateNameList(statestring); + names = MakeStateNameList(statestring.GetChars()); names.Insert(0, scopename); scope = checkclass; } diff --git a/src/win32/i_steam.cpp b/src/win32/i_steam.cpp index 5b62ae4354..b066b95728 100644 --- a/src/win32/i_steam.cpp +++ b/src/win32/i_steam.cpp @@ -354,7 +354,7 @@ TArray I_GetSteamPath() return result; } - TArray paths = ParseSteamRegistry(steamPath + "/config/config.vdf"); + TArray paths = ParseSteamRegistry((steamPath + "/config/config.vdf").GetChars()); for(FString &path : paths) {