From c94c63110eb5f1f680f0b19f1996dd2a24a5a5ae Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 7 Oct 2023 23:03:40 +0200 Subject: [PATCH] added a third batch of GetChars call to FStrings. --- src/common/audio/music/i_music.cpp | 6 +- src/common/audio/sound/i_sound.cpp | 2 +- src/common/engine/i_net.cpp | 4 +- src/common/engine/stringtable.h | 1 + src/common/rendering/gl/gl_renderbuffers.cpp | 4 +- src/common/rendering/gl/gl_shader.cpp | 10 +- src/common/rendering/gl/gl_shaderprogram.cpp | 10 +- .../hwrenderer/data/hw_shaderpatcher.cpp | 2 +- .../hw_postprocessshader_ccmds.cpp | 6 +- src/common/scripting/core/imports.cpp | 4 +- src/common/startscreen/endoom.cpp | 2 +- src/common/textures/gametexture.cpp | 4 +- .../libsmackerdec/src/FileStream.cpp | 2 +- src/common/utility/engineerrors.cpp | 2 +- src/console/c_notifybuffer.cpp | 4 +- src/d_netinfo.cpp | 18 +-- src/events.cpp | 2 +- src/g_dumpinfo.cpp | 2 +- src/g_game.cpp | 60 +++++----- src/g_level.cpp | 106 +++++++++--------- src/g_statusbar/hudmessages.cpp | 18 +-- src/gameconfigfile.cpp | 4 +- src/gamedata/g_mapinfo.cpp | 34 +++--- src/gamedata/g_skill.cpp | 6 +- src/gamedata/gi.cpp | 4 +- src/intermission/intermission.cpp | 18 +-- src/intermission/intermission_parse.cpp | 4 +- src/maploader/edata.cpp | 4 +- src/maploader/glnodes.cpp | 14 +-- src/menu/doommenu.cpp | 58 +++++----- src/r_data/gldefs.cpp | 18 +-- 31 files changed, 216 insertions(+), 217 deletions(-) diff --git a/src/common/audio/music/i_music.cpp b/src/common/audio/music/i_music.cpp index b3f0a3d0d50..9f61651029a 100644 --- a/src/common/audio/music/i_music.cpp +++ b/src/common/audio/music/i_music.cpp @@ -312,8 +312,8 @@ static ZMusic_MidiSource GetMIDISource(const char *fn) FString src = fn; if (src.Compare("*") == 0) src = mus_playing.name; - auto lump = fileSystem.CheckNumForName(src, ns_music); - if (lump < 0) lump = fileSystem.CheckNumForFullName(src); + auto lump = fileSystem.CheckNumForName(src.GetChars(), ns_music); + if (lump < 0) lump = fileSystem.CheckNumForFullName(src.GetChars()); if (lump < 0) { Printf("Cannot find MIDI lump %s.\n", src.GetChars()); @@ -391,7 +391,7 @@ UNSAFE_CCMD (writewave) Printf("MIDI dump of %s failed: %s\n",argv[1], ZMusic_GetLastError()); } - S_ChangeMusic(savedsong.name, savedsong.baseorder, savedsong.loop, true); + S_ChangeMusic(savedsong.name.GetChars(), savedsong.baseorder, savedsong.loop, true); } else { diff --git a/src/common/audio/sound/i_sound.cpp b/src/common/audio/sound/i_sound.cpp index 5f9fdda189e..dda757e8d78 100644 --- a/src/common/audio/sound/i_sound.cpp +++ b/src/common/audio/sound/i_sound.cpp @@ -248,7 +248,7 @@ class NullSoundRenderer : public SoundRenderer void I_InitSound () { - FModule_SetProgDir(progdir); + FModule_SetProgDir(progdir.GetChars()); /* Get command line options: */ nosound = !!Args->CheckParm ("-nosound"); nosfx = !!Args->CheckParm ("-nosfx"); diff --git a/src/common/engine/i_net.cpp b/src/common/engine/i_net.cpp index 07dc7fdd9b4..65dc60cb1a5 100644 --- a/src/common/engine/i_net.cpp +++ b/src/common/engine/i_net.cpp @@ -419,12 +419,12 @@ void BuildAddress (sockaddr_in *address, const char *name) if (!isnamed) { - address->sin_addr.s_addr = inet_addr (target); + address->sin_addr.s_addr = inet_addr (target.GetChars()); Printf ("Node number %d, address %s\n", doomcom.numnodes, target.GetChars()); } else { - hostentry = gethostbyname (target); + hostentry = gethostbyname (target.GetChars()); if (!hostentry) I_FatalError ("gethostbyname: couldn't find %s\n%s", target.GetChars(), neterror()); address->sin_addr.s_addr = *(int *)hostentry->h_addr_list[0]; diff --git a/src/common/engine/stringtable.h b/src/common/engine/stringtable.h index 6850f8832ee..57827aa04bb 100644 --- a/src/common/engine/stringtable.h +++ b/src/common/engine/stringtable.h @@ -97,6 +97,7 @@ class FStringTable bool MatchDefaultString(const char *name, const char *content) const; const char *GetString(const char *name, uint32_t *langtable, int gender = -1) const; const char *operator() (const char *name) const; // Never returns NULL + const char* operator() (const FString& name) const { return operator()(name.GetChars()); } const char *operator[] (const char *name) const { return GetString(name, nullptr); diff --git a/src/common/rendering/gl/gl_renderbuffers.cpp b/src/common/rendering/gl/gl_renderbuffers.cpp index 4f49cdce3c5..3ce335d7a6d 100644 --- a/src/common/rendering/gl/gl_renderbuffers.cpp +++ b/src/common/rendering/gl/gl_renderbuffers.cpp @@ -836,8 +836,8 @@ FShaderProgram *GLPPRenderState::GetGLShader(PPShader *shader) prolog = UniformBlockDecl::Create("Uniforms", shader->Uniforms, POSTPROCESS_BINDINGPOINT); prolog += shader->Defines; - glshader->Compile(FShaderProgram::Vertex, shader->VertexShader, "", shader->Version); - glshader->Compile(FShaderProgram::Fragment, shader->FragmentShader, prolog, shader->Version); + glshader->Compile(FShaderProgram::Vertex, shader->VertexShader.GetChars(), "", shader->Version); + glshader->Compile(FShaderProgram::Fragment, shader->FragmentShader.GetChars(), prolog.GetChars(), shader->Version); glshader->Link(shader->FragmentShader.GetChars()); if (!shader->Uniforms.empty()) glshader->SetUniformBufferLocation(POSTPROCESS_BINDINGPOINT, "Uniforms"); diff --git a/src/common/rendering/gl/gl_shader.cpp b/src/common/rendering/gl/gl_shader.cpp index afa05b86301..7340236abd9 100644 --- a/src/common/rendering/gl/gl_shader.cpp +++ b/src/common/rendering/gl/gl_shader.cpp @@ -109,7 +109,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; } @@ -125,7 +125,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]; @@ -166,7 +166,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(); @@ -837,9 +837,9 @@ bool FShaderCollection::CompileNextShader() } else if (mCompileState == 2) { - FString name = ExtractFileBase(usershaders[i].shader); + FString name = ExtractFileBase(usershaders[i].shader.GetChars()); FString defines = defaultshaders[usershaders[i].shaderType].Defines + usershaders[i].defines; - FShader *shc = Compile(name, usershaders[i].shader, defaultshaders[usershaders[i].shaderType].lightfunc, defines, true, mPassType); + FShader *shc = Compile(name.GetChars(), usershaders[i].shader.GetChars(), defaultshaders[usershaders[i].shaderType].lightfunc, defines.GetChars(), true, mPassType); mMaterialShaders.Push(shc); mCompileIndex++; if (mCompileIndex >= (int)usershaders.Size()) diff --git a/src/common/rendering/gl/gl_shaderprogram.cpp b/src/common/rendering/gl/gl_shaderprogram.cpp index feca86aa89a..d5e8dd3210f 100644 --- a/src/common/rendering/gl/gl_shaderprogram.cpp +++ b/src/common/rendering/gl/gl_shaderprogram.cpp @@ -107,7 +107,7 @@ void FShaderProgram::CompileShader(ShaderType type) const auto &handle = mShaders[type]; - FGLDebug::LabelObject(GL_SHADER, handle, mShaderNames[type]); + FGLDebug::LabelObject(GL_SHADER, handle, mShaderNames[type].GetChars()); const FString &patchedCode = mShaderSources[type]; int lengths[1] = { (int)patchedCode.Len() }; @@ -186,7 +186,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); @@ -300,8 +300,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/pp/screenquad.vp", prolog, 330); - mShader->Compile(FShaderProgram::Fragment, vtx_shader_name, prolog, 330); + mShader->Compile(FShaderProgram::Vertex, "shaders/pp/screenquad.vp", prolog.GetChars(), 330); + mShader->Compile(FShaderProgram::Fragment, vtx_shader_name, prolog.GetChars(), 330); mShader->Link(program_name); mShader->SetUniformBufferLocation(Uniforms.BindingPoint(), "Uniforms"); Uniforms.Init(); @@ -355,7 +355,7 @@ void FShadowMapShader::Bind() mShader.reset(new FShaderProgram()); mShader->Compile(FShaderProgram::Vertex, "shaders/pp/screenquad.vp", "", 430); - mShader->Compile(FShaderProgram::Fragment, "shaders/pp/shadowmap.fp", prolog, 430); + mShader->Compile(FShaderProgram::Fragment, "shaders/pp/shadowmap.fp", prolog.GetChars(), 430); mShader->Link("shaders/glsl/shadowmap"); mShader->SetUniformBufferLocation(Uniforms.BindingPoint(), "Uniforms"); Uniforms.Init(); diff --git a/src/common/rendering/hwrenderer/data/hw_shaderpatcher.cpp b/src/common/rendering/hwrenderer/data/hw_shaderpatcher.cpp index 2b391d18572..9049e5090ee 100644 --- a/src/common/rendering/hwrenderer/data/hw_shaderpatcher.cpp +++ b/src/common/rendering/hwrenderer/data/hw_shaderpatcher.cpp @@ -188,7 +188,7 @@ FString RemoveSamplerBindings(FString code, TArray> &sam FString type = NextGlslToken(chars, len, pos); FString identifier = NextGlslToken(chars, len, pos); - isSamplerUniformName = uniform.Compare("uniform") == 0 && isShaderType(type); + isSamplerUniformName = uniform.Compare("uniform") == 0 && isShaderType(type.GetChars()); if (isSamplerUniformName) { samplerstobind.Push(std::make_pair(identifier, val)); diff --git a/src/common/rendering/hwrenderer/postprocessing/hw_postprocessshader_ccmds.cpp b/src/common/rendering/hwrenderer/postprocessing/hw_postprocessshader_ccmds.cpp index 4608b9ce960..7ab93b3ec57 100644 --- a/src/common/rendering/hwrenderer/postprocessing/hw_postprocessshader_ccmds.cpp +++ b/src/common/rendering/hwrenderer/postprocessing/hw_postprocessshader_ccmds.cpp @@ -39,7 +39,7 @@ CCMD (shaderenable) for (unsigned int i = 0; i < PostProcessShaders.Size(); i++) { PostProcessShader &shader = PostProcessShaders[i]; - if (strcmp(shader.Name, shaderName) == 0) + if (shader.Name.Compare(shaderName) == 0) { if (value != -1) shader.Enabled = value; @@ -70,7 +70,7 @@ CCMD (shaderuniform) for (unsigned int i = 0; i < PostProcessShaders.Size(); i++) { PostProcessShader &shader = PostProcessShaders[i]; - if (strcmp(shader.Name, shaderName) == 0) + if (shader.Name.Compare(shaderName) == 0) { if (argv.argc() > 3) { @@ -116,7 +116,7 @@ CCMD(listuniforms) for (unsigned int i = 0; i < PostProcessShaders.Size(); i++) { PostProcessShader &shader = PostProcessShaders[i]; - if (strcmp(shader.Name, shaderName) == 0) + if (shader.Name.Compare(shaderName) == 0) { Printf("Shader '%s' uniforms:\n", shaderName); diff --git a/src/common/scripting/core/imports.cpp b/src/common/scripting/core/imports.cpp index 3006462cd89..eed84980a9f 100644 --- a/src/common/scripting/core/imports.cpp +++ b/src/common/scripting/core/imports.cpp @@ -198,8 +198,8 @@ void InitImports() { assert(afunc->VMPointer != NULL); *(afunc->VMPointer) = new VMNativeFunction(afunc->Function, afunc->FuncName); - (*(afunc->VMPointer))->QualifiedName = ClassDataAllocator.Strdup(FStringf("%s.%s", afunc->ClassName + 1, afunc->FuncName)); - (*(afunc->VMPointer))->PrintableName = ClassDataAllocator.Strdup(FStringf("%s.%s [Native]", afunc->ClassName+1, afunc->FuncName)); + (*(afunc->VMPointer))->QualifiedName = ClassDataAllocator.Strdup(FStringf("%s.%s", afunc->ClassName + 1, afunc->FuncName).GetChars()); + (*(afunc->VMPointer))->PrintableName = ClassDataAllocator.Strdup(FStringf("%s.%s [Native]", afunc->ClassName+1, afunc->FuncName).GetChars()); (*(afunc->VMPointer))->DirectNativeCall = afunc->DirectNative; AFTable.Push(*afunc); }); diff --git a/src/common/startscreen/endoom.cpp b/src/common/startscreen/endoom.cpp index 0fff948c0d8..4a7565dbc6b 100644 --- a/src/common/startscreen/endoom.cpp +++ b/src/common/startscreen/endoom.cpp @@ -153,7 +153,7 @@ int RunEndoom() return 0; } - int endoom_lump = fileSystem.CheckNumForFullName (endoomName, true); + int endoom_lump = fileSystem.CheckNumForFullName (endoomName.GetChars(), true); if (endoom_lump < 0 || fileSystem.FileLength (endoom_lump) != 4000) { diff --git a/src/common/textures/gametexture.cpp b/src/common/textures/gametexture.cpp index 2c873d15f00..755f48b49e3 100644 --- a/src/common/textures/gametexture.cpp +++ b/src/common/textures/gametexture.cpp @@ -182,7 +182,7 @@ void FGameTexture::AddAutoMaterials() if (this->*(layer.pointer) == nullptr) // only if no explicit assignment had been done. { FStringf lookup("%s%s%s", layer.path, fullname ? "" : "auto/", searchname.GetChars()); - auto lump = fileSystem.CheckNumForFullName(lookup, false, FileSys::ns_global, true); + auto lump = fileSystem.CheckNumForFullName(lookup.GetChars(), false, FileSys::ns_global, true); if (lump != -1) { auto bmtex = TexMan.FindGameTexture(fileSystem.GetFileFullName(lump), ETextureType::Any, FTextureManager::TEXMAN_TryAny); @@ -199,7 +199,7 @@ void FGameTexture::AddAutoMaterials() if (!this->Layers || this->Layers.get()->*(layer.pointer) == nullptr) // only if no explicit assignment had been done. { FStringf lookup("%s%s%s", layer.path, fullname ? "" : "auto/", searchname.GetChars()); - auto lump = fileSystem.CheckNumForFullName(lookup, false, FileSys::ns_global, true); + auto lump = fileSystem.CheckNumForFullName(lookup.GetChars(), false, FileSys::ns_global, true); if (lump != -1) { auto bmtex = TexMan.FindGameTexture(fileSystem.GetFileFullName(lump), ETextureType::Any, FTextureManager::TEXMAN_TryAny); diff --git a/src/common/thirdparty/libsmackerdec/src/FileStream.cpp b/src/common/thirdparty/libsmackerdec/src/FileStream.cpp index 454143ff100..f7845136b51 100644 --- a/src/common/thirdparty/libsmackerdec/src/FileStream.cpp +++ b/src/common/thirdparty/libsmackerdec/src/FileStream.cpp @@ -28,7 +28,7 @@ bool FileStream::Open(const char *fileName) { FString fixedname = fileName; FixPathSeperator(fixedname); - file = fileSystem.OpenFileReader(fixedname); + file = fileSystem.OpenFileReader(fixedname.GetChars()); if (!file.isOpen()) { // log error diff --git a/src/common/utility/engineerrors.cpp b/src/common/utility/engineerrors.cpp index 4d012581923..41485778a28 100644 --- a/src/common/utility/engineerrors.cpp +++ b/src/common/utility/engineerrors.cpp @@ -60,7 +60,7 @@ void I_DebugPrintf(const char *fmt,...) va_end(args); - auto wstr = WideString(s); + auto wstr = WideString(s.GetChars()); OutputDebugStringW(wstr.c_str()); } } diff --git a/src/console/c_notifybuffer.cpp b/src/console/c_notifybuffer.cpp index d25b320e432..4c394c376a7 100644 --- a/src/console/c_notifybuffer.cpp +++ b/src/console/c_notifybuffer.cpp @@ -146,7 +146,7 @@ void FNotifyBuffer::Draw() int scale = active_con_scaletext(twod, generic_ui); if (!center) - DrawText(twod, font, color, 0, line, notify.Text, + DrawText(twod, font, color, 0, line, notify.Text.GetChars(), DTA_VirtualWidth, twod->GetWidth() / scale, DTA_VirtualHeight, twod->GetHeight() / scale, DTA_KeepRatio, true, @@ -154,7 +154,7 @@ void FNotifyBuffer::Draw() else DrawText(twod, font, color, (twod->GetWidth() - font->StringWidth (notify.Text) * scale) / 2 / scale, - line, notify.Text, + line, notify.Text.GetChars(), DTA_VirtualWidth, twod->GetWidth() / scale, DTA_VirtualHeight, twod->GetHeight() / scale, DTA_KeepRatio, true, diff --git a/src/d_netinfo.cpp b/src/d_netinfo.cpp index 0db1c94e6e8..51c6e0dc028 100644 --- a/src/d_netinfo.cpp +++ b/src/d_netinfo.cpp @@ -161,7 +161,7 @@ int D_PlayerClassToInt (const char *classname) { auto type = PlayerClasses[i].Type; - if (type->GetDisplayName().IsNotEmpty() && stricmp(type->GetDisplayName(), classname) == 0) + if (type->GetDisplayName().IsNotEmpty() && type->GetDisplayName().CompareNoCase(classname) == 0) { return i; } @@ -786,7 +786,7 @@ FString D_GetUserInfoStrings(int pnum, bool compact) break; case NAME_Skin: - result.AppendFormat("\\%s", D_EscapeUserInfo(Skins[info->GetSkin()].Name).GetChars()); + result.AppendFormat("\\%s", D_EscapeUserInfo(Skins[info->GetSkin()].Name.GetChars()).GetChars()); break; default: @@ -870,15 +870,15 @@ void D_ReadUserInfoStrings (int pnum, uint8_t **stream, bool update) switch (keyname.GetIndex()) { case NAME_Gender: - info->GenderChanged(value); + info->GenderChanged(value.GetChars()); break; case NAME_PlayerClass: - info->PlayerClassChanged(value); + info->PlayerClassChanged(value.GetChars()); break; case NAME_Skin: - info->SkinChanged(value, players[pnum].CurrentPlayerClass); + info->SkinChanged(value.GetChars(), players[pnum].CurrentPlayerClass); if (players[pnum].mo != NULL) { if (players[pnum].cls != NULL && @@ -895,11 +895,11 @@ void D_ReadUserInfoStrings (int pnum, uint8_t **stream, bool update) break; case NAME_Team: - UpdateTeam(pnum, atoi(value), update); + UpdateTeam(pnum, atoi(value.GetChars()), update); break; case NAME_Color: - info->ColorChanged(value); + info->ColorChanged(value.GetChars()); break; default: @@ -956,7 +956,7 @@ void WriteUserInfo(FSerializer &arc, userinfo_t &info) switch (pair->Key.GetIndex()) { case NAME_Skin: - string = Skins[info.GetSkin()].Name; + string = Skins[info.GetSkin()].Name.GetChars(); break; case NAME_PlayerClass: @@ -969,7 +969,7 @@ void WriteUserInfo(FSerializer &arc, userinfo_t &info) string = val.String; break; } - arc.StringPtr(name, string); + arc.StringPtr(name.GetChars(), string); } arc.EndObject(); } diff --git a/src/events.cpp b/src/events.cpp index d179ac50afa..3fe1cef311b 100755 --- a/src/events.cpp +++ b/src/events.cpp @@ -166,7 +166,7 @@ bool EventManager::SendNetworkEvent(FString name, int arg1, int arg2, int arg3, return false; Net_WriteByte(DEM_NETEVENT); - Net_WriteString(name); + Net_WriteString(name.GetChars()); Net_WriteByte(3); Net_WriteLong(arg1); Net_WriteLong(arg2); diff --git a/src/g_dumpinfo.cpp b/src/g_dumpinfo.cpp index 96951df6fb9..768733d440d 100644 --- a/src/g_dumpinfo.cpp +++ b/src/g_dumpinfo.cpp @@ -366,7 +366,7 @@ CCMD(listmaps) for (unsigned i = 0; i < wadlevelinfos.Size(); i++) { level_info_t *info = &wadlevelinfos[i]; - MapData *map = P_OpenMapData(info->MapName, true); + MapData *map = P_OpenMapData(info->MapName.GetChars(), true); if (map != NULL) { diff --git a/src/g_game.cpp b/src/g_game.cpp index ba3b8ea4b8d..6d891a2e48c 100644 --- a/src/g_game.cpp +++ b/src/g_game.cpp @@ -770,8 +770,8 @@ void G_BuildTiccmd (ticcmd_t *cmd) { sendsave = false; Net_WriteByte (DEM_SAVEGAME); - Net_WriteString (savegamefile); - Net_WriteString (savedescription); + Net_WriteString (savegamefile.GetChars()); + Net_WriteString (savedescription.GetChars()); savegamefile = ""; } if (SendItemUse == (const AActor *)1) @@ -1142,8 +1142,8 @@ void G_Ticker () { case ga_recordgame: G_CheckDemoStatus(); - G_RecordDemo(newdemoname); - G_BeginRecording(newdemomap); + G_RecordDemo(newdemoname.GetChars()); + G_BeginRecording(newdemomap.GetChars()); [[fallthrough]]; case ga_newgame2: // Silence GCC (see above) case ga_newgame: @@ -1155,7 +1155,7 @@ void G_Ticker () G_DoLoadGame (); break; case ga_savegame: - G_DoSaveGame (true, false, savegamefile, savedescription); + G_DoSaveGame (true, false, savegamefile, savedescription.GetChars()); gameaction = ga_nothing; savegamefile = ""; savedescription = ""; @@ -1177,7 +1177,7 @@ void G_Ticker () G_DoWorldDone (); break; case ga_screenshot: - M_ScreenShot (shotfile); + M_ScreenShot (shotfile.GetChars()); shotfile = ""; gameaction = ga_nothing; break; @@ -1732,7 +1732,7 @@ void FLevelLocals::DoReborn (int playernum, bool freshbot) { // Reload the level from scratch bool indemo = demoplayback; BackupSaveName = ""; - G_InitNew (MapName, false); + G_InitNew (MapName.GetChars(), false); demoplayback = indemo; } } @@ -1893,9 +1893,9 @@ bool G_CheckSaveGameWads (FSerializer &arc, bool printwarn) FString text; arc("Game WAD", text); - CheckSingleWad (text, printRequires, printwarn); + CheckSingleWad (text.GetChars(), printRequires, printwarn); arc("Map WAD", text); - CheckSingleWad (text, printRequires, printwarn); + CheckSingleWad (text.GetChars(), printRequires, printwarn); if (printRequires) { @@ -2035,7 +2035,7 @@ void G_DoLoadGame () message.Substitute("%e", FStringf("%d", SAVEVER)); } message.Substitute("%d", FStringf("%d", SaveVersion)); - LoadGameError(message); + LoadGameError(message.GetChars()); return; } @@ -2107,7 +2107,7 @@ void G_DoLoadGame () // load a base level bool demoplaybacksave = demoplayback; - G_InitNew(map, false); + G_InitNew(map.GetChars(), false); demoplayback = demoplaybacksave; savegamerestore = false; @@ -2129,7 +2129,7 @@ void G_DoLoadGame () { FString modelFilePath = smf.Left(smf.LastIndexOf("/")+1); FString modelFileName = smf.Right(smf.Len() - smf.Left(smf.LastIndexOf("/") + 1).Len()); - FindModel(modelFilePath, modelFileName); + FindModel(modelFilePath.GetChars(), modelFileName.GetChars()); } // At this point, the GC threshold is likely a lot higher than the @@ -2173,8 +2173,8 @@ void G_SaveGame (const char *filename, const char *description) CCMD(opensaves) { FString name = G_GetSavegamesFolder(); - CreatePath(name); - I_OpenShellFolder(name); + CreatePath(name.GetChars()); + I_OpenShellFolder(name.GetChars()); } CVAR (Int, autosavenum, 0, CVAR_NOSET|CVAR_ARCHIVE|CVAR_GLOBALCONFIG) @@ -2212,7 +2212,7 @@ void G_DoAutoSave () num.Int = nextautosave; autosavenum->ForceSet (num, CVAR_Int); - file = G_BuildSaveName(FStringf("auto%02d", nextautosave)); + file = G_BuildSaveName(FStringf("auto%02d", nextautosave).GetChars()); // The hint flag is only relevant on the primary level. if (!(primaryLevel->flags2 & LEVEL2_NOAUTOSAVEHINT)) @@ -2227,7 +2227,7 @@ void G_DoAutoSave () readableTime = myasctime (); description.Format("Autosave %s", readableTime); - G_DoSaveGame (false, false, file, description); + G_DoSaveGame (false, false, file, description.GetChars()); } void G_DoQuickSave () @@ -2251,11 +2251,11 @@ void G_DoQuickSave () num.Int = lastquicksave; quicksavenum->ForceSet (num, CVAR_Int); - file = G_BuildSaveName(FStringf("quick%02d", lastquicksave)); + file = G_BuildSaveName(FStringf("quick%02d", lastquicksave).GetChars()); readableTime = myasctime (); description.Format("Quicksave %s", readableTime); - G_DoSaveGame (true, true, file, description); + G_DoSaveGame (true, true, file, description.GetChars()); } @@ -2281,7 +2281,7 @@ static void PutSaveComment (FSerializer &arc) FString comment = myasctime(); - arc.AddString("Creation Time", comment); + arc.AddString("Creation Time", comment.GetChars()); // Get level name comment.Format("%s - %s\n", primaryLevel->MapName.GetChars(), primaryLevel->LevelName.GetChars()); @@ -2292,7 +2292,7 @@ static void PutSaveComment (FSerializer &arc) comment.AppendFormat("%s: %02d:%02d:%02d", time, levelTime/3600, (levelTime%3600)/60, levelTime%60); // Write out the comment - arc.AddString("Comment", comment); + arc.AddString("Comment", comment.GetChars()); } static void PutSavePic (FileWriter *file, int width, int height) @@ -2370,7 +2370,7 @@ void G_DoSaveGame (bool okForQuicksave, bool forceQuicksave, FString filename, c // put some basic info into the PNG so that this isn't lost when the image gets extracted. M_AppendPNGText(&savepic, "Software", buf); M_AppendPNGText(&savepic, "Title", description); - M_AppendPNGText(&savepic, "Current Map", primaryLevel->MapName); + M_AppendPNGText(&savepic, "Current Map", primaryLevel->MapName.GetChars()); M_FinishPNG(&savepic); int ver = SAVEVER; @@ -2378,7 +2378,7 @@ void G_DoSaveGame (bool okForQuicksave, bool forceQuicksave, FString filename, c .AddString("Engine", GAMESIG) ("Save Version", ver) .AddString("Title", description) - .AddString("Current Map", primaryLevel->MapName); + .AddString("Current Map", primaryLevel->MapName.GetChars()); PutSaveWads (savegameinfo); @@ -2423,10 +2423,10 @@ void G_DoSaveGame (bool okForQuicksave, bool forceQuicksave, FString filename, c bool succeeded = false; - if (WriteZip(filename, savegame_content.Data(), savegame_content.Size())) + if (WriteZip(filename.GetChars(), savegame_content.Data(), savegame_content.Size())) { // Check whether the file is ok by trying to open it. - FResourceFile *test = FResourceFile::OpenResourceFile(filename, true); + FResourceFile *test = FResourceFile::OpenResourceFile(filename.GetChars(), true); if (test != nullptr) { delete test; @@ -2595,7 +2595,7 @@ void G_BeginRecording (const char *startmap) if (startmap == NULL) { - startmap = primaryLevel->MapName; + startmap = primaryLevel->MapName.GetChars(); } demo_p = demobuffer; @@ -2861,7 +2861,7 @@ void G_DoPlayDemo (void) gameaction = ga_nothing; // [RH] Allow for demos not loaded as lumps - demolump = fileSystem.CheckNumForFullName (defdemoname, true); + demolump = fileSystem.CheckNumForFullName (defdemoname.GetChars(), true); if (demolump >= 0) { int demolen = fileSystem.FileLength (demolump); @@ -2873,7 +2873,7 @@ void G_DoPlayDemo (void) FixPathSeperator (defdemoname); DefaultExtension (defdemoname, ".lmp"); FileReader fr; - if (!fr.OpenFile(defdemoname)) + if (!fr.OpenFile(defdemoname.GetChars())) { I_Error("Unable to open demo '%s'", defdemoname.GetChars()); } @@ -2920,7 +2920,7 @@ void G_DoPlayDemo (void) demonew = true; if (mapname.Len() != 0) { - G_InitNew (mapname, false); + G_InitNew (mapname.GetChars(), false); } else if (primaryLevel->sectors.Size() == 0) { @@ -3048,14 +3048,14 @@ bool G_CheckDemoStatus (void) formlen = demobuffer + 4; WriteLong (int(demo_p - demobuffer - 8), &formlen); - auto fw = FileWriter::Open(demoname); + auto fw = FileWriter::Open(demoname.GetChars()); bool saved = false; if (fw != nullptr) { const size_t size = demo_p - demobuffer; saved = fw->Write(demobuffer, size) == size; delete fw; - if (!saved) remove(demoname); + if (!saved) remove(demoname.GetChars()); } M_Free (demobuffer); demorecording = false; diff --git a/src/g_level.cpp b/src/g_level.cpp index 474f85a38d7..953980386a8 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -238,7 +238,7 @@ bool CreateCutscene(CutsceneDef* cs, DObject* runner, level_info_t* map) return true; // play nothing but return as being validated if (cs->function.IsNotEmpty()) { - CallCreateMapFunction(cs->function, runner, map); + CallCreateMapFunction(cs->function.GetChars(), runner, map); return true; } else if (cs->video.IsNotEmpty()) @@ -270,7 +270,7 @@ void G_DeferedInitNew (const char *mapname, int newskill) void G_DeferedInitNew (FNewGameStartup *gs) { - if (gs->hasPlayerClass) playerclass = gs->PlayerClass; + if (gs->hasPlayerClass) playerclass = gs->PlayerClass.GetChars(); d_mapname = AllEpisodes[gs->Episode].mEpisodeMap; d_skill = gs->Skill; CheckWarpTransMap (d_mapname, true); @@ -418,7 +418,7 @@ UNSAFE_CCMD (open) { d_mapname = "file:"; d_mapname += argv[1]; - if (!P_CheckMapData(d_mapname)) + if (!P_CheckMapData(d_mapname.GetChars())) { Printf ("No map %s\n", d_mapname.GetChars()); } @@ -515,7 +515,7 @@ void G_DoNewGame (void) { gameskill = d_skill; } - G_InitNew (d_mapname, false); + G_InitNew (d_mapname.GetChars(), false); gameaction = ga_nothing; } @@ -574,8 +574,8 @@ void G_InitNew (const char *mapname, bool bTitleLevel) auto redirectmap = FindLevelInfo(mapname); if (redirectmap->RedirectCVAR != NAME_None) redirectmap = redirectmap->CheckLevelRedirect(); - if (redirectmap && redirectmap->MapName.GetChars()[0]) - mapname = redirectmap->MapName; + if (redirectmap && redirectmap->MapName.IsNotEmpty()) + mapname = redirectmap->MapName.GetChars(); } G_VerifySkill(); @@ -738,7 +738,7 @@ void FLevelLocals::ChangeLevel(const char *levelname, int position, int inflags, { FString reallevelname = levelname; CheckWarpTransMap(reallevelname, true); - nextinfo = FindLevelInfo (reallevelname, false); + nextinfo = FindLevelInfo (reallevelname.GetChars(), false); if (nextinfo != NULL) { level_info_t *nextredir = nextinfo->CheckLevelRedirect(); @@ -803,7 +803,7 @@ void FLevelLocals::ChangeLevel(const char *levelname, int position, int inflags, staticEventManager.WorldUnloaded(nextlevel); unloading = false; - STAT_ChangeLevel(nextlevel, this); + STAT_ChangeLevel(nextlevel.GetChars(), this); if (thiscluster && (thiscluster->flags & CLUSTER_HUB)) { @@ -850,7 +850,7 @@ DEFINE_ACTION_FUNCTION(FLevelLocals, ChangeLevel) PARAM_INT(position); PARAM_INT(inflags); PARAM_INT(nextSkill); - self->ChangeLevel(levelname, position, inflags, nextSkill); + self->ChangeLevel(levelname.GetChars(), position, inflags, nextSkill); return 0; } @@ -861,13 +861,13 @@ DEFINE_ACTION_FUNCTION(FLevelLocals, ChangeLevel) const char *FLevelLocals::GetSecretExitMap() { - const char *nextmap = NextMap; + const char *nextmap = NextMap.GetChars(); if (NextSecretMap.Len() > 0) { - if (NextSecretMap.Compare("enDSeQ", 6) == 0 || P_CheckMapData(NextSecretMap)) + if (NextSecretMap.Compare("enDSeQ", 6) == 0 || P_CheckMapData(NextSecretMap.GetChars())) { - nextmap = NextSecretMap; + nextmap = NextSecretMap.GetChars(); } } return nextmap; @@ -882,7 +882,7 @@ const char *FLevelLocals::GetSecretExitMap() void FLevelLocals::ExitLevel (int position, bool keepFacing) { flags3 |= LEVEL3_EXITNORMALUSED; - ChangeLevel(NextMap, position, keepFacing ? CHANGELEVEL_KEEPFACING : 0); + ChangeLevel(NextMap.GetChars(), position, keepFacing ? CHANGELEVEL_KEEPFACING : 0); } static void LevelLocals_ExitLevel(FLevelLocals *self, int position, bool keepFacing) @@ -935,7 +935,7 @@ DIntermissionController* FLevelLocals::CreateIntermission() thiscluster = FindClusterInfo (cluster); - bool endgame = strncmp (nextlevel, "enDSeQ", 6) == 0; + bool endgame = strncmp (nextlevel.GetChars(), "enDSeQ", 6) == 0; if (endgame) { FName endsequence = ENamedName(strtoll(nextlevel.GetChars()+6, NULL, 16)); @@ -956,11 +956,11 @@ DIntermissionController* FLevelLocals::CreateIntermission() auto ext = info->ExitMapTexts.CheckKey(flags3 & LEVEL3_EXITSECRETUSED ? NAME_Secret : NAME_Normal); if (ext != nullptr && (ext->mDefined & FExitText::DEF_TEXT)) { - controller = F_StartFinale(ext->mDefined & FExitText::DEF_MUSIC ? ext->mMusic : gameinfo.finaleMusic, + controller = F_StartFinale(ext->mDefined & FExitText::DEF_MUSIC ? ext->mMusic.GetChars() : gameinfo.finaleMusic.GetChars(), ext->mDefined & FExitText::DEF_MUSIC ? ext->mOrder : gameinfo.finaleOrder, -1, 0, - ext->mDefined & FExitText::DEF_BACKDROP ? ext->mBackdrop : gameinfo.FinaleFlat, - ext->mText, + ext->mDefined & FExitText::DEF_BACKDROP ? ext->mBackdrop.GetChars() : gameinfo.FinaleFlat.GetChars(), + ext->mText.GetChars(), false, ext->mDefined & FExitText::DEF_PIC, ext->mDefined & FExitText::DEF_LOOKUP, @@ -968,9 +968,9 @@ DIntermissionController* FLevelLocals::CreateIntermission() } else if (!(info->flags2 & LEVEL2_NOCLUSTERTEXT)) { - controller = F_StartFinale(thiscluster->MessageMusic, thiscluster->musicorder, + controller = F_StartFinale(thiscluster->MessageMusic.GetChars(), thiscluster->musicorder, thiscluster->cdtrack, thiscluster->cdid, - thiscluster->FinaleFlat, thiscluster->ExitText, + thiscluster->FinaleFlat.GetChars(), thiscluster->ExitText.GetChars(), thiscluster->flags & CLUSTER_EXITTEXTINLUMP, thiscluster->flags & CLUSTER_FINALEPIC, thiscluster->flags & CLUSTER_LOOKUPEXITTEXT, @@ -989,11 +989,11 @@ DIntermissionController* FLevelLocals::CreateIntermission() { if ((ext->mDefined & FExitText::DEF_TEXT)) { - controller = F_StartFinale(ext->mDefined & FExitText::DEF_MUSIC ? ext->mMusic : gameinfo.finaleMusic, + controller = F_StartFinale(ext->mDefined & FExitText::DEF_MUSIC ? ext->mMusic.GetChars() : gameinfo.finaleMusic.GetChars(), ext->mDefined & FExitText::DEF_MUSIC ? ext->mOrder : gameinfo.finaleOrder, -1, 0, - ext->mDefined & FExitText::DEF_BACKDROP ? ext->mBackdrop : gameinfo.FinaleFlat, - ext->mText, + ext->mDefined & FExitText::DEF_BACKDROP ? ext->mBackdrop.GetChars() : gameinfo.FinaleFlat.GetChars(), + ext->mText.GetChars(), false, ext->mDefined & FExitText::DEF_PIC, ext->mDefined & FExitText::DEF_LOOKUP, @@ -1002,7 +1002,7 @@ DIntermissionController* FLevelLocals::CreateIntermission() return controller; } - nextcluster = FindClusterInfo (FindLevelInfo (nextlevel)->cluster); + nextcluster = FindClusterInfo (FindLevelInfo (nextlevel.GetChars())->cluster); if (nextcluster->cluster != cluster && !(info->flags2 & LEVEL2_NOCLUSTERTEXT)) { @@ -1010,9 +1010,9 @@ DIntermissionController* FLevelLocals::CreateIntermission() // than the current one and we're not in deathmatch. if (nextcluster->EnterText.IsNotEmpty()) { - controller = F_StartFinale (nextcluster->MessageMusic, nextcluster->musicorder, + controller = F_StartFinale (nextcluster->MessageMusic.GetChars(), nextcluster->musicorder, nextcluster->cdtrack, nextcluster->cdid, - nextcluster->FinaleFlat, nextcluster->EnterText, + nextcluster->FinaleFlat.GetChars(), nextcluster->EnterText.GetChars(), nextcluster->flags & CLUSTER_ENTERTEXTINLUMP, nextcluster->flags & CLUSTER_FINALEPIC, nextcluster->flags & CLUSTER_LOOKUPENTERTEXT, @@ -1020,9 +1020,9 @@ DIntermissionController* FLevelLocals::CreateIntermission() } else if (thiscluster->ExitText.IsNotEmpty()) { - controller = F_StartFinale (thiscluster->MessageMusic, thiscluster->musicorder, + controller = F_StartFinale (thiscluster->MessageMusic.GetChars(), thiscluster->musicorder, thiscluster->cdtrack, nextcluster->cdid, - thiscluster->FinaleFlat, thiscluster->ExitText, + thiscluster->FinaleFlat.GetChars(), thiscluster->ExitText.GetChars(), thiscluster->flags & CLUSTER_EXITTEXTINLUMP, thiscluster->flags & CLUSTER_FINALEPIC, thiscluster->flags & CLUSTER_LOOKUPEXITTEXT, @@ -1128,9 +1128,9 @@ void G_DoCompleted (void) statusScreen = WI_Start (&staticWmInfo); } - bool endgame = strncmp(nextlevel, "enDSeQ", 6) == 0; + bool endgame = strncmp(nextlevel.GetChars(), "enDSeQ", 6) == 0; intermissionScreen = primaryLevel->CreateIntermission(); - auto nextinfo = !playinter || endgame? nullptr : FindLevelInfo(nextlevel, false); + auto nextinfo = !playinter || endgame? nullptr : FindLevelInfo(nextlevel.GetChars(), false); RunIntermission(primaryLevel->info, nextinfo, intermissionScreen, statusScreen, [=](bool) { if (!endgame) primaryLevel->WorldDone(); @@ -1155,7 +1155,7 @@ bool FLevelLocals::DoCompleted (FString nextlevel, wbstartstruct_t &wminfo) uint32_t langtable[2] = {}; wminfo.finished_ep = cluster - 1; - wminfo.LName0 = TexMan.CheckForTexture(info->PName, ETextureType::MiscPatch); + wminfo.LName0 = TexMan.CheckForTexture(info->PName.GetChars(), ETextureType::MiscPatch); wminfo.thisname = info->LookupLevelName(&langtable[0]); // re-get the name so we have more info about its origin. if (!wminfo.LName0.isValid() || !(info->flags3 & LEVEL3_HIDEAUTHORNAME)) wminfo.thisauthor = info->AuthorName; wminfo.current = MapName; @@ -1171,8 +1171,8 @@ bool FLevelLocals::DoCompleted (FString nextlevel, wbstartstruct_t &wminfo) } else { - level_info_t *nextinfo = FindLevelInfo (nextlevel, false); - if (nextinfo == NULL || strncmp (nextlevel, "enDSeQ", 6) == 0) + level_info_t *nextinfo = FindLevelInfo (nextlevel.GetChars(), false); + if (nextinfo == NULL || strncmp (nextlevel.GetChars(), "enDSeQ", 6) == 0) { wminfo.next = ""; wminfo.LName1.SetInvalid(); @@ -1182,7 +1182,7 @@ bool FLevelLocals::DoCompleted (FString nextlevel, wbstartstruct_t &wminfo) else { wminfo.next = nextinfo->MapName; - wminfo.LName1 = TexMan.CheckForTexture(nextinfo->PName, ETextureType::MiscPatch); + wminfo.LName1 = TexMan.CheckForTexture(nextinfo->PName.GetChars(), ETextureType::MiscPatch); wminfo.nextname = nextinfo->LookupLevelName(&langtable[1]); if (!wminfo.LName1.isValid() || !(nextinfo->flags3 & LEVEL3_HIDEAUTHORNAME)) wminfo.nextauthor = nextinfo->AuthorName; } @@ -1210,7 +1210,7 @@ bool FLevelLocals::DoCompleted (FString nextlevel, wbstartstruct_t &wminfo) CheckWarpTransMap (wminfo.next, true); nextlevel = wminfo.next; - wminfo.next_ep = FindLevelInfo (wminfo.next)->cluster - 1; + wminfo.next_ep = FindLevelInfo (wminfo.next.GetChars())->cluster - 1; wminfo.totalkills = killed_monsters; wminfo.maxkills = total_monsters; wminfo.maxitems = total_items; @@ -1411,7 +1411,7 @@ void FLevelLocals::DoLoadLevel(const FString &nextmapname, int position, bool au // a flat. The data is in the WAD only because // we look for an actual index, instead of simply // setting one. - skyflatnum = TexMan.GetTextureID (gameinfo.SkyFlatName, ETextureType::Flat, FTextureManager::TEXMAN_Overridable); + skyflatnum = TexMan.GetTextureID (gameinfo.SkyFlatName.GetChars(), ETextureType::Flat, FTextureManager::TEXMAN_Overridable); // [RH] Set up details about sky rendering InitSkyMap (this); @@ -1804,19 +1804,19 @@ void FLevelLocals::Init() ImpactDecalCount = 0; frozenstate = 0; - info = FindLevelInfo (MapName); + info = FindLevelInfo (MapName.GetChars()); skyspeed1 = info->skyspeed1; skyspeed2 = info->skyspeed2; - skytexture1 = TexMan.GetTextureID(info->SkyPic1, ETextureType::Wall, FTextureManager::TEXMAN_Overridable | FTextureManager::TEXMAN_ReturnFirst); - skytexture2 = TexMan.GetTextureID(info->SkyPic2, ETextureType::Wall, FTextureManager::TEXMAN_Overridable | FTextureManager::TEXMAN_ReturnFirst); + skytexture1 = TexMan.GetTextureID(info->SkyPic1.GetChars(), ETextureType::Wall, FTextureManager::TEXMAN_Overridable | FTextureManager::TEXMAN_ReturnFirst); + skytexture2 = TexMan.GetTextureID(info->SkyPic2.GetChars(), ETextureType::Wall, FTextureManager::TEXMAN_Overridable | FTextureManager::TEXMAN_ReturnFirst); fadeto = info->fadeto; cdtrack = info->cdtrack; cdid = info->cdid; FromSnapshot = false; if (fadeto == 0) { - if (strnicmp (info->FadeTable, "COLORMAP", 8) != 0) + if (strnicmp (info->FadeTable.GetChars(), "COLORMAP", 8) != 0) { flags |= LEVEL_HASFADETABLE; } @@ -1962,7 +1962,7 @@ void G_WriteVisited(FSerializer &arc) { if (wi.flags & LEVEL_VISITED) { - arc.AddString(nullptr, wi.MapName); + arc.AddString(nullptr, wi.MapName.GetChars()); } } arc.EndArray(); @@ -1980,9 +1980,8 @@ void G_WriteVisited(FSerializer &arc) { if (playeringame[i]) { - FString key; - key.Format("%d", i); - arc(key, players[i].cls); + FStringf key("%d", i); + arc(key.GetChars(), players[i].cls); } } arc.EndObject(); @@ -2012,7 +2011,7 @@ void G_ReadSnapshots(FResourceFile *resf) { ptrdiff_t maplen = ptr - name; FString mapname(name, (size_t)maplen); - i = FindLevelInfo(mapname); + i = FindLevelInfo(mapname.GetChars()); if (i != nullptr) { i->Snapshot = resl->GetRawData(); @@ -2045,7 +2044,7 @@ void G_ReadVisited(FSerializer &arc) { FString str; arc(nullptr, str); - auto i = FindLevelInfo(str); + auto i = FindLevelInfo(str.GetChars()); if (i != nullptr) i->flags |= LEVEL_VISITED; } arc.EndArray(); @@ -2057,9 +2056,8 @@ void G_ReadVisited(FSerializer &arc) { for (int i = 0; i < MAXPLAYERS; ++i) { - FString key; - key.Format("%d", i); - arc(key, players[i].cls); + FStringf key("%d", i); + arc(key.GetChars(), players[i].cls); } arc.EndObject(); } @@ -2091,7 +2089,7 @@ void P_WriteACSDefereds (FSerializer &arc) { if (wi.deferred.Size() > 0) { - arc(wi.MapName, wi.deferred); + arc(wi.MapName.GetChars(), wi.deferred); } } } @@ -2319,9 +2317,9 @@ void FLevelLocals::SetInterMusic(const char *nextmap) { auto mus = info->MapInterMusic.CheckKey(nextmap); if (mus != nullptr) - S_ChangeMusic(mus->first, mus->second); + S_ChangeMusic(mus->first.GetChars(), mus->second); else if (info->InterMusic.IsNotEmpty()) - S_ChangeMusic(info->InterMusic, info->intermusicorder); + S_ChangeMusic(info->InterMusic.GetChars(), info->intermusicorder); else S_ChangeMusic(gameinfo.intermissionMusic.GetChars(), gameinfo.intermissionOrder); } @@ -2330,7 +2328,7 @@ DEFINE_ACTION_FUNCTION(FLevelLocals, SetInterMusic) { PARAM_SELF_STRUCT_PROLOGUE(FLevelLocals); PARAM_STRING(map); - self->SetInterMusic(map); + self->SetInterMusic(map.GetChars()); return 0; } @@ -2437,7 +2435,7 @@ int IsPointInMap(FLevelLocals *Level, double x, double y, double z) void FLevelLocals::SetMusic() { - S_ChangeMusic(Music, musicorder); + S_ChangeMusic(Music.GetChars(), musicorder); } @@ -2464,6 +2462,6 @@ DEFINE_ACTION_FUNCTION(FLevelLocals, GetEpisodeName) // This will need some heuristics to assign a proper episode to each existing level. // Stuff for later. for now this just checks the STAT module for the currently running episode, // which should be fine unless cheating. - ACTION_RETURN_STRING(GStrings.localize(STAT_EpisodeName())); + ACTION_RETURN_STRING(GStrings.localize(STAT_EpisodeName().GetChars())); } diff --git a/src/g_statusbar/hudmessages.cpp b/src/g_statusbar/hudmessages.cpp index c03d3cdd426..c03922505a0 100644 --- a/src/g_statusbar/hudmessages.cpp +++ b/src/g_statusbar/hudmessages.cpp @@ -212,7 +212,7 @@ DHUDMessage::DHUDMessage (FFont *font, const char *text, float x, float y, int h VisibilityFlags = 0; Style = STYLE_Translucent; Alpha = 1.; - ResetText (SourceText); + ResetText (SourceText.GetChars()); } //============================================================================ @@ -478,7 +478,7 @@ void DHUDMessage::DoDraw (int linenum, int x, int y, bool clean, int hudheight) if (hudheight == 0) { int scale = active_con_scaletext(twod); - DrawText(twod, Font, TextColor, x, y, Lines[linenum].Text, + DrawText(twod, Font, TextColor, x, y, Lines[linenum].Text.GetChars(), DTA_VirtualWidth, twod->GetWidth() / scale, DTA_VirtualHeight, twod->GetHeight() / scale, DTA_Alpha, Alpha, @@ -488,7 +488,7 @@ void DHUDMessage::DoDraw (int linenum, int x, int y, bool clean, int hudheight) } else { - DrawText(twod, Font, TextColor, x, y, Lines[linenum].Text, + DrawText(twod, Font, TextColor, x, y, Lines[linenum].Text.GetChars(), DTA_VirtualWidth, HUDWidth, DTA_VirtualHeight, hudheight, DTA_ClipLeft, ClipLeft, @@ -571,7 +571,7 @@ void DHUDMessageFadeOut::DoDraw (int linenum, int x, int y, bool clean, int hudh if (hudheight == 0) { int scale = active_con_scaletext(twod); - DrawText(twod, Font, TextColor, x, y, Lines[linenum].Text, + DrawText(twod, Font, TextColor, x, y, Lines[linenum].Text.GetChars(), DTA_VirtualWidth, twod->GetWidth() / scale, DTA_VirtualHeight, twod->GetHeight() / scale, DTA_Alpha, trans, @@ -581,7 +581,7 @@ void DHUDMessageFadeOut::DoDraw (int linenum, int x, int y, bool clean, int hudh } else { - DrawText(twod, Font, TextColor, x, y, Lines[linenum].Text, + DrawText(twod, Font, TextColor, x, y, Lines[linenum].Text.GetChars(), DTA_VirtualWidth, HUDWidth, DTA_VirtualHeight, hudheight, DTA_ClipLeft, ClipLeft, @@ -660,7 +660,7 @@ void DHUDMessageFadeInOut::DoDraw (int linenum, int x, int y, bool clean, int hu if (hudheight == 0) { int scale = active_con_scaletext(twod); - DrawText(twod, Font, TextColor, x, y, Lines[linenum].Text, + DrawText(twod, Font, TextColor, x, y, Lines[linenum].Text.GetChars(), DTA_VirtualWidth, twod->GetWidth() / scale, DTA_VirtualHeight, twod->GetHeight() / scale, DTA_Alpha, trans, @@ -670,7 +670,7 @@ void DHUDMessageFadeInOut::DoDraw (int linenum, int x, int y, bool clean, int hu } else { - DrawText(twod, Font, TextColor, x, y, Lines[linenum].Text, + DrawText(twod, Font, TextColor, x, y, Lines[linenum].Text.GetChars(), DTA_VirtualWidth, HUDWidth, DTA_VirtualHeight, hudheight, DTA_ClipLeft, ClipLeft, @@ -844,7 +844,7 @@ void DHUDMessageTypeOnFadeOut::DoDraw (int linenum, int x, int y, bool clean, in if (hudheight == 0) { int scale = active_con_scaletext(twod); - DrawText(twod, Font, TextColor, x, y, Lines[linenum].Text, + DrawText(twod, Font, TextColor, x, y, Lines[linenum].Text.GetChars(), DTA_VirtualWidth, twod->GetWidth() / scale, DTA_VirtualHeight, twod->GetHeight() / scale, DTA_KeepRatio, true, @@ -855,7 +855,7 @@ void DHUDMessageTypeOnFadeOut::DoDraw (int linenum, int x, int y, bool clean, in } else { - DrawText(twod, Font, TextColor, x, y, Lines[linenum].Text, + DrawText(twod, Font, TextColor, x, y, Lines[linenum].Text.GetChars(), DTA_VirtualWidth, HUDWidth, DTA_VirtualHeight, hudheight, DTA_ClipLeft, ClipLeft, diff --git a/src/gameconfigfile.cpp b/src/gameconfigfile.cpp index 0b3931e882f..3e4f96c0071 100644 --- a/src/gameconfigfile.cpp +++ b/src/gameconfigfile.cpp @@ -92,14 +92,14 @@ FGameConfigFile::FGameConfigFile () OkayToWrite = false; // Do not allow saving of the config before DoKeySetup() bModSetup = false; pathname = GetConfigPath (true); - ChangePathName (pathname); + ChangePathName (pathname.GetChars()); LoadConfigFile (); // If zdoom.ini was read from the program directory, switch // to the user directory now. If it was read from the user // directory, this effectively does nothing. pathname = GetConfigPath (false); - ChangePathName (pathname); + ChangePathName (pathname.GetChars()); // Set default IWAD search paths if none present if (!SetSection ("IWADSearch.Directories")) diff --git a/src/gamedata/g_mapinfo.cpp b/src/gamedata/g_mapinfo.cpp index ab842582f91..13ca12c9ac3 100644 --- a/src/gamedata/g_mapinfo.cpp +++ b/src/gamedata/g_mapinfo.cpp @@ -321,10 +321,10 @@ FString level_info_t::LookupLevelName(uint32_t *langtable) if (flags & LEVEL_LOOKUPLEVELNAME) { const char *thename; - const char *lookedup = GStrings.GetString(LevelName, langtable); + const char *lookedup = GStrings.GetString(LevelName.GetChars(), langtable); if (lookedup == NULL) { - thename = LevelName; + thename = LevelName.GetChars(); } else { @@ -381,9 +381,9 @@ level_info_t *level_info_t::CheckLevelRedirect () if (playeringame[i] && players[i].mo->FindInventory(type)) { // check for actual presence of the map. - if (P_CheckMapData(RedirectMapName)) + if (P_CheckMapData(RedirectMapName.GetChars())) { - return FindLevelInfo(RedirectMapName); + return FindLevelInfo(RedirectMapName.GetChars()); } break; } @@ -403,14 +403,14 @@ level_info_t *level_info_t::CheckLevelRedirect () if (playeringame[i] && (var = GetCVar(i, RedirectCVAR.GetChars()))) { if (var->ToInt()) - if (P_CheckMapData(RedirectCVARMapName)) - return FindLevelInfo(RedirectCVARMapName); + if (P_CheckMapData(RedirectCVARMapName.GetChars())) + return FindLevelInfo(RedirectCVARMapName.GetChars()); } } } else if (var->ToInt()) - if (P_CheckMapData(RedirectCVARMapName)) - return FindLevelInfo(RedirectCVARMapName); + if (P_CheckMapData(RedirectCVARMapName.GetChars())) + return FindLevelInfo(RedirectCVARMapName.GetChars()); } } return NULL; @@ -830,7 +830,7 @@ void FMapInfoParser::ParseCluster() else { FStringf testlabel("CLUSTERENTER%d", clusterinfo->cluster); - if (GStrings.MatchDefaultString(testlabel, clusterinfo->EnterText)) + if (GStrings.MatchDefaultString(testlabel.GetChars(), clusterinfo->EnterText.GetChars())) { clusterinfo->EnterText = testlabel; clusterinfo->flags |= CLUSTER_LOOKUPENTERTEXT; @@ -845,7 +845,7 @@ void FMapInfoParser::ParseCluster() else { FStringf testlabel("CLUSTEREXIT%d", clusterinfo->cluster); - if (GStrings.MatchDefaultString(testlabel, clusterinfo->ExitText)) + if (GStrings.MatchDefaultString(testlabel.GetChars(), clusterinfo->ExitText.GetChars())) { clusterinfo->ExitText = testlabel; clusterinfo->flags |= CLUSTER_LOOKUPEXITTEXT; @@ -922,7 +922,7 @@ void FMapInfoParser::ParseCluster() // Remap Hexen's CLUS?MSG lumps to the string table, if applicable. The code here only checks what can actually be in an IWAD. if (clusterinfo->flags & CLUSTER_EXITTEXTINLUMP) { - int lump = fileSystem.CheckNumForFullName(clusterinfo->ExitText, true); + int lump = fileSystem.CheckNumForFullName(clusterinfo->ExitText.GetChars(), true); if (lump > 0) { // Check if this comes from either Hexen.wad or Hexdd.wad and if so, map to the string table. @@ -931,7 +931,7 @@ void FMapInfoParser::ParseCluster() if (fn && (!stricmp(fn, "HEXEN.WAD") || !stricmp(fn, "HEXDD.WAD"))) { FStringf key("TXT_%.5s_%s", fn, clusterinfo->ExitText.GetChars()); - if (GStrings.exists(key)) + if (GStrings.exists(key.GetChars())) { clusterinfo->ExitText = key; clusterinfo->flags &= ~CLUSTER_EXITTEXTINLUMP; @@ -2144,7 +2144,7 @@ level_info_t *FMapInfoParser::ParseMapHeader(level_info_t &defaultinfo) // This checks for a string labelled with the MapName and if that is identical to what got parsed here // the string table entry will be used. - if (GStrings.MatchDefaultString(levelinfo->MapName, sc.String)) + if (GStrings.MatchDefaultString(levelinfo->MapName.GetChars(), sc.String)) { levelinfo->flags |= LEVEL_LOOKUPLEVELNAME; levelinfo->LevelName = levelinfo->MapName; @@ -2161,7 +2161,7 @@ level_info_t *FMapInfoParser::ParseMapHeader(level_info_t &defaultinfo) if (fn && (!stricmp(fn, "HEXEN.WAD") || !stricmp(fn, "HEXDD.WAD"))) { FStringf key("TXT_%.5s_%s", fn, levelinfo->MapName.GetChars()); - if (GStrings.exists(key)) + if (GStrings.exists(key.GetChars())) { levelinfo->flags |= LEVEL_LOOKUPLEVELNAME; levelinfo->LevelName = key; @@ -2174,7 +2174,7 @@ level_info_t *FMapInfoParser::ParseMapHeader(level_info_t &defaultinfo) // Set up levelnum now so that you can use Teleport_NewMap specials // to teleport to maps with standard names without needing a levelnum. - levelinfo->levelnum = GetDefaultLevelNum(levelinfo->MapName); + levelinfo->levelnum = GetDefaultLevelNum(levelinfo->MapName.GetChars()); // Does this map have a song defined via SNDINFO's $map command? // Set that as this map's default music if it does. @@ -2295,7 +2295,7 @@ void FMapInfoParser::ParseEpisodeInfo () if (optional && !remove) { - if (!P_CheckMapData(map)) + if (!P_CheckMapData(map.GetChars())) { // If the episode is optional and the map does not exist // just ignore this episode definition. @@ -2585,7 +2585,7 @@ void G_ParseMapInfo (FString basemapinfo) { FMapInfoParser parse; level_info_t defaultinfo; - int baselump = fileSystem.GetNumForFullName(basemapinfo); + int baselump = fileSystem.GetNumForFullName(basemapinfo.GetChars()); if (fileSystem.GetFileContainer(baselump) > 0) { I_FatalError("File %s is overriding core lump %s.", diff --git a/src/gamedata/g_skill.cpp b/src/gamedata/g_skill.cpp index 34dde60e1cf..53b685cd346 100644 --- a/src/gamedata/g_skill.cpp +++ b/src/gamedata/g_skill.cpp @@ -488,15 +488,15 @@ DEFINE_ACTION_FUNCTION(DObject, G_SkillPropertyFloat) const char * G_SkillName() { - const char *name = AllSkills[gameskill].MenuName; + const char *name = AllSkills[gameskill].MenuName.GetChars(); player_t *player = &players[consoleplayer]; - const char *playerclass = player->mo->GetInfo()->DisplayName; + const char *playerclass = player->mo->GetInfo()->DisplayName.GetChars(); if (playerclass != NULL) { FString * pmnm = AllSkills[gameskill].MenuNamesForPlayerClass.CheckKey(playerclass); - if (pmnm != NULL) name = *pmnm; + if (pmnm != NULL) name = pmnm->GetChars(); } if (*name == '$') name = GStrings(name+1); diff --git a/src/gamedata/gi.cpp b/src/gamedata/gi.cpp index 643f63fc379..e907722e97d 100644 --- a/src/gamedata/gi.cpp +++ b/src/gamedata/gi.cpp @@ -212,10 +212,10 @@ const char* GameInfoBorders[] = { \ sc.MustGetToken(TK_StringConst); \ FString color = sc.String; \ - FString colorName = V_GetColorStringByName(color); \ + FString colorName = V_GetColorStringByName(color.GetChars()); \ if(!colorName.IsEmpty()) \ color = colorName; \ - gameinfo.key = V_GetColorFromString(color); \ + gameinfo.key = V_GetColorFromString(color.GetChars()); \ } #define GAMEINFOKEY_BOOL(key, variable) \ diff --git a/src/intermission/intermission.cpp b/src/intermission/intermission.cpp index fdcdd032535..8b5135b99ff 100644 --- a/src/intermission/intermission.cpp +++ b/src/intermission/intermission.cpp @@ -129,7 +129,7 @@ void DrawFullscreenSubtitle(FFont* font, const char *text) y += 10; for (const FBrokenLines &line : lines) { - DrawText(twod, font, CR_UNTRANSLATED, x, y, line.Text, + DrawText(twod, font, CR_UNTRANSLATED, x, y, line.Text.GetChars(), DTA_KeepRatio, true, DTA_VirtualWidth, hudwidth, DTA_VirtualHeight, hudheight, TAG_DONE); y += font->GetHeight(); @@ -146,11 +146,11 @@ void DIntermissionScreen::Init(FIntermissionAction *desc, bool first) { if (!first && desc->mMusic.IsNotEmpty()) { - S_ChangeMusic (desc->mMusic, desc->mMusicOrder, desc->mMusicLooping); + S_ChangeMusic (desc->mMusic.GetChars(), desc->mMusicOrder, desc->mMusicLooping); } mDuration = desc->mDuration; - const char *texname = desc->mBackground; + const char *texname = desc->mBackground.GetChars(); if (*texname == '@') { char *pp; @@ -184,7 +184,7 @@ void DIntermissionScreen::Init(FIntermissionAction *desc, bool first) mOverlays[i].x = desc->mOverlays[i].x; mOverlays[i].y = desc->mOverlays[i].y; mOverlays[i].mCondition = desc->mOverlays[i].mCondition; - mOverlays[i].mPic = TexMan.CheckForTexture(desc->mOverlays[i].mName, ETextureType::MiscPatch); + mOverlays[i].mPic = TexMan.CheckForTexture(desc->mOverlays[i].mName.GetChars(), ETextureType::MiscPatch); } mTicker = 0; mSubtitle = desc->mSubtitle; @@ -201,11 +201,11 @@ void DIntermissionScreen::Start() { if (mMusic.IsEmpty()) { - S_ChangeMusic(gameinfo.finaleMusic, gameinfo.finaleOrder, mMusicLooping); + S_ChangeMusic(gameinfo.finaleMusic.GetChars(), gameinfo.finaleOrder, mMusicLooping); } else { - S_ChangeMusic(mMusic, mMusicOrder, mMusicLooping); + S_ChangeMusic(mMusic.GetChars(), mMusicOrder, mMusicLooping); } } } @@ -261,7 +261,7 @@ void DIntermissionScreen::Drawer () DrawTexture(twod, mOverlays[i].mPic, false, mOverlays[i].x, mOverlays[i].y, DTA_320x200, true, TAG_DONE); } FFont* font = generic_ui ? NewSmallFont : SmallFont; - DrawFullscreenSubtitle(font, mSubtitle); + DrawFullscreenSubtitle(font, mSubtitle.GetChars()); } void DIntermissionScreen::OnDestroy() @@ -488,7 +488,7 @@ void DIntermissionScreenText::Drawer () void DIntermissionScreenCast::Init(FIntermissionAction *desc, bool first) { Super::Init(desc, first); - mName = static_cast(desc)->mName; + mName = static_cast(desc)->mName.GetChars(); mClass = PClass::FindActor(static_cast(desc)->mCastClass); if (mClass != NULL) mDefaults = GetDefaultByType(mClass); else @@ -722,7 +722,7 @@ void DIntermissionScreenScroller::Init(FIntermissionAction *desc, bool first) { Super::Init(desc, first); mFirstPic = mBackground; - mSecondPic = TexMan.CheckForTexture(static_cast(desc)->mSecondPic, ETextureType::MiscPatch); + mSecondPic = TexMan.CheckForTexture(static_cast(desc)->mSecondPic.GetChars(), ETextureType::MiscPatch); mScrollDelay = static_cast(desc)->mScrollDelay; mScrollTime = static_cast(desc)->mScrollTime; mScrollDir = static_cast(desc)->mScrollDir; diff --git a/src/intermission/intermission_parse.cpp b/src/intermission/intermission_parse.cpp index b5a51aab584..4f75c3bcb81 100644 --- a/src/intermission/intermission_parse.cpp +++ b/src/intermission/intermission_parse.cpp @@ -313,7 +313,7 @@ bool FIntermissionActionTextscreen::ParseKey(FScanner &sc) if (fn && (!stricmp(fn, "HEXEN.WAD") || !stricmp(fn, "HEXDD.WAD"))) { FStringf key("TXT_%.5s_%s", fn, sc.String); - if (GStrings.exists(key)) + if (GStrings.exists(key.GetChars())) { mText = "$" + key; done = true; @@ -954,7 +954,7 @@ CCMD(testfinale) return; } - auto controller = F_StartFinale(gameinfo.finaleMusic, gameinfo.finaleOrder, -1, 0, gameinfo.FinaleFlat, text, false, false, true, true); + auto controller = F_StartFinale(gameinfo.finaleMusic.GetChars(), gameinfo.finaleOrder, -1, 0, gameinfo.FinaleFlat.GetChars(), text, false, false, true, true); RunIntermission(nullptr, nullptr, controller, nullptr, [=](bool) { gameaction = ga_nothing; }); } diff --git a/src/maploader/edata.cpp b/src/maploader/edata.cpp index fcf82a10dc9..044fb081159 100644 --- a/src/maploader/edata.cpp +++ b/src/maploader/edata.cpp @@ -520,7 +520,7 @@ void MapLoader::InitED() FScanner sc; if (filename.IsEmpty()) return; - int lump = fileSystem.CheckNumForFullName(filename, true, FileSys::ns_global); + int lump = fileSystem.CheckNumForFullName(filename.GetChars(), true, FileSys::ns_global); if (lump == -1) return; sc.OpenLumpNum(lump); @@ -659,7 +659,7 @@ void MapLoader::LoadMapinfoACSLump() { if (Level->info->acsName.IsNotEmpty()) { - int lump = fileSystem.CheckNumForName(Level->info->acsName); + int lump = fileSystem.CheckNumForName(Level->info->acsName.GetChars()); if (lump >= 0) Level->Behaviors.LoadModule(lump); } } diff --git a/src/maploader/glnodes.cpp b/src/maploader/glnodes.cpp index 63f738ddefd..a17374a6461 100644 --- a/src/maploader/glnodes.cpp +++ b/src/maploader/glnodes.cpp @@ -736,7 +736,7 @@ static int FindGLNodesInWAD(int labellump) glheader.Format("GL_%s", fileSystem.GetFileFullName(labellump)); if (glheader.Len()<=8) { - int gllabel = fileSystem.CheckNumForName(glheader, FileSys::ns_global, wadfile); + int gllabel = fileSystem.CheckNumForName(glheader.GetChars(), FileSys::ns_global, wadfile); if (gllabel >= 0) return gllabel; } else @@ -754,7 +754,7 @@ static int FindGLNodesInWAD(int labellump) if (fileSystem.GetFileContainer(lump)==wadfile) { auto mem = fileSystem.ReadFile(lump); - if (MatchHeader(fileSystem.GetFileFullName(labellump), GetStringFromLump(lump))) return lump; + if (MatchHeader(fileSystem.GetFileFullName(labellump), GetStringFromLump(lump).GetChars())) return lump; } } } @@ -793,7 +793,7 @@ static int FindGLNodesInFile(FResourceFile * f, const char * label) { for(uint32_t i=0;iGetLump(i)->getName(), glheader, 8)) + if (!strnicmp(f->GetLump(i)->getName(), glheader.GetChars(), 8)) { if (mustcheck) { @@ -1004,7 +1004,7 @@ static FString CreateCacheName(MapData *map, bool create) FString lumpname = fileSystem.GetFileFullPath(map->lumpnum).c_str(); auto separator = lumpname.IndexOf(':'); path << '/' << lumpname.Left(separator); - if (create) CreatePath(path); + if (create) CreatePath(path.GetChars()); lumpname.ReplaceChars('/', '%'); lumpname.ReplaceChars(':', '$'); @@ -1125,7 +1125,7 @@ void MapLoader::CreateCachedNodes(MapData *map) memcpy(&compressed[offset - 4], "ZGL3", 4); FString path = CreateCacheName(map, true); - FileWriter *fw = FileWriter::Open(path); + FileWriter *fw = FileWriter::Open(path.GetChars()); if (fw != nullptr) { @@ -1154,7 +1154,7 @@ bool MapLoader::CheckCachedNodes(MapData *map) FString path = CreateCacheName(map, false); FileReader fr; - if (!fr.OpenFile(path)) return false; + if (!fr.OpenFile(path.GetChars())) return false; if (fr.Read(magic, 4) != 4) return false; if (memcmp(magic, "CACH", 4)) return false; @@ -1203,7 +1203,7 @@ UNSAFE_CCMD(clearnodecache) FString path = M_GetCachePath(false); path += "/"; - if (!FileSys::ScanDirectory(list, path, "*", false)) + if (!FileSys::ScanDirectory(list, path.GetChars(), "*", false)) { Printf("Unable to scan node cache directory %s\n", path.GetChars()); return; diff --git a/src/menu/doommenu.cpp b/src/menu/doommenu.cpp index 50857f76ab3..ac73a9b0a20 100644 --- a/src/menu/doommenu.cpp +++ b/src/menu/doommenu.cpp @@ -403,7 +403,7 @@ CCMD (menu_quit) } else EndString = gameinfo.quitmessages[messageindex]; - DMenu *newmenu = CreateMessageBoxMenu(CurrentMenu, EndString, 0, false, NAME_None, []() + DMenu *newmenu = CreateMessageBoxMenu(CurrentMenu, EndString.GetChars(), 0, false, NAME_None, []() { if (!netgame) { @@ -431,7 +431,7 @@ CCMD (menu_quit) void ActivateEndGameMenu() { FString tempstring = GStrings(netgame ? "NETEND" : "ENDGAME"); - DMenu *newmenu = CreateMessageBoxMenu(CurrentMenu, tempstring, 0, false, NAME_None, []() + DMenu *newmenu = CreateMessageBoxMenu(CurrentMenu, tempstring.GetChars(), 0, false, NAME_None, []() { M_ClearMenus(); if (!netgame) @@ -503,7 +503,7 @@ CCMD (quicksave) FString tempstring = GStrings("QSPROMPT"); tempstring.Substitute("%s", savegameManager.quickSaveSlot->SaveTitle.GetChars()); - DMenu *newmenu = CreateMessageBoxMenu(CurrentMenu, tempstring, 0, false, NAME_None, []() + DMenu *newmenu = CreateMessageBoxMenu(CurrentMenu, tempstring.GetChars(), 0, false, NAME_None, []() { G_SaveGame(savegameManager.quickSaveSlot->Filename.GetChars(), savegameManager.quickSaveSlot->SaveTitle.GetChars()); S_Sound(CHAN_VOICE, CHANF_UI, "menu/dismiss", snd_menuvolume, ATTN_NONE); @@ -548,7 +548,7 @@ CCMD (quickload) M_StartControlPanel(true); - DMenu *newmenu = CreateMessageBoxMenu(CurrentMenu, tempstring, 0, false, NAME_None, []() + DMenu *newmenu = CreateMessageBoxMenu(CurrentMenu, tempstring.GetChars(), 0, false, NAME_None, []() { G_LoadGame(savegameManager.quickSaveSlot->Filename.GetChars()); S_Sound(CHAN_VOICE, CHANF_UI, "menu/dismiss", snd_menuvolume, ATTN_NONE); @@ -615,8 +615,8 @@ CCMD(reset2defaults) CCMD(reset2saved) { GameConfig->DoGlobalSetup (); - GameConfig->DoGameSetup (gameinfo.ConfigName); - GameConfig->DoModSetup (gameinfo.ConfigName); + GameConfig->DoGameSetup (gameinfo.ConfigName.GetChars()); + GameConfig->DoModSetup (gameinfo.ConfigName.GetChars()); R_SetViewSize (screenblocks); } @@ -674,8 +674,8 @@ void M_StartupEpisodeMenu(FNewGameStartup *gs) { if (AllEpisodes[i].mPicName.IsNotEmpty()) { - FTextureID tex = GetMenuTexture(AllEpisodes[i].mPicName); - if (AllEpisodes[i].mEpisodeName.IsEmpty() || OkForLocalization(tex, AllEpisodes[i].mEpisodeName)) + FTextureID tex = GetMenuTexture(AllEpisodes[i].mPicName.GetChars()); + if (AllEpisodes[i].mEpisodeName.IsEmpty() || OkForLocalization(tex, AllEpisodes[i].mEpisodeName.GetChars())) continue; } if ((gameinfo.gametype & GAME_DoomStrifeChex) && spacing == 16) spacing = 18; @@ -706,11 +706,11 @@ void M_StartupEpisodeMenu(FNewGameStartup *gs) DMenuItemBase *it = nullptr; if (AllEpisodes[i].mPicName.IsNotEmpty()) { - FTextureID tex = GetMenuTexture(AllEpisodes[i].mPicName); - if (AllEpisodes[i].mEpisodeName.IsEmpty() || OkForLocalization(tex, AllEpisodes[i].mEpisodeName)) + FTextureID tex = GetMenuTexture(AllEpisodes[i].mPicName.GetChars()); + if (AllEpisodes[i].mEpisodeName.IsEmpty() || OkForLocalization(tex, AllEpisodes[i].mEpisodeName.GetChars())) continue; // We do not measure patch based entries. They are assumed to fit } - const char *c = AllEpisodes[i].mEpisodeName; + const char *c = AllEpisodes[i].mEpisodeName.GetChars(); if (*c == '$') c = GStrings(c + 1); int textwidth = ld->mFont->StringWidth(c); int textright = posx + textwidth; @@ -722,14 +722,14 @@ void M_StartupEpisodeMenu(FNewGameStartup *gs) DMenuItemBase *it = nullptr; if (AllEpisodes[i].mPicName.IsNotEmpty()) { - FTextureID tex = GetMenuTexture(AllEpisodes[i].mPicName); - if (AllEpisodes[i].mEpisodeName.IsEmpty() || OkForLocalization(tex, AllEpisodes[i].mEpisodeName)) + FTextureID tex = GetMenuTexture(AllEpisodes[i].mPicName.GetChars()); + if (AllEpisodes[i].mEpisodeName.IsEmpty() || OkForLocalization(tex, AllEpisodes[i].mEpisodeName.GetChars())) it = CreateListMenuItemPatch(posx, posy, spacing, AllEpisodes[i].mShortcut, tex, NAME_Skillmenu, i); } if (it == nullptr) { it = CreateListMenuItemText(posx, posy, spacing, AllEpisodes[i].mShortcut, - AllEpisodes[i].mEpisodeName, ld->mFont, ld->mFontColor, ld->mFontColor2, NAME_Skillmenu, i); + AllEpisodes[i].mEpisodeName.GetChars(), ld->mFont, ld->mFontColor, ld->mFontColor2, NAME_Skillmenu, i); } ld->mItems.Push(it); posy += spacing; @@ -769,7 +769,7 @@ void M_StartupEpisodeMenu(FNewGameStartup *gs) GC::WriteBarrier(od); for(unsigned i = 0; i < AllEpisodes.Size(); i++) { - auto it = CreateOptionMenuItemSubmenu(AllEpisodes[i].mEpisodeName, "Skillmenu", i); + auto it = CreateOptionMenuItemSubmenu(AllEpisodes[i].mEpisodeName.GetChars(), "Skillmenu", i); od->mItems.Push(it); GC::WriteBarrier(od, it); } @@ -813,7 +813,7 @@ static void BuildPlayerclassMenu() { if (!(PlayerClasses[i].Flags & PCF_NOMENU)) { - const char *pname = GetPrintableDisplayName(PlayerClasses[i].Type); + const char *pname = GetPrintableDisplayName(PlayerClasses[i].Type).GetChars(); if (pname != nullptr) { numclassitems++; @@ -850,7 +850,7 @@ static void BuildPlayerclassMenu() { if (!(PlayerClasses[i].Flags & PCF_NOMENU)) { - const char *pname = GetPrintableDisplayName(PlayerClasses[i].Type); + const char *pname = GetPrintableDisplayName(PlayerClasses[i].Type).GetChars(); if (pname != nullptr) { auto it = CreateListMenuItemText(ld->mXpos, ld->mYpos, ld->mLinespacing, *pname, @@ -869,7 +869,7 @@ static void BuildPlayerclassMenu() } if (n == 0) { - const char *pname = GetPrintableDisplayName(PlayerClasses[0].Type); + const char *pname = GetPrintableDisplayName(PlayerClasses[0].Type).GetChars(); if (pname != nullptr) { auto it = CreateListMenuItemText(ld->mXpos, ld->mYpos, ld->mLinespacing, *pname, @@ -910,7 +910,7 @@ static void BuildPlayerclassMenu() { if (!(PlayerClasses[i].Flags & PCF_NOMENU)) { - const char *pname = GetPrintableDisplayName(PlayerClasses[i].Type); + const char *pname = GetPrintableDisplayName(PlayerClasses[i].Type).GetChars(); if (pname != nullptr) { auto it = CreateOptionMenuItemSubmenu(pname, "Episodemenu", i); @@ -1002,12 +1002,12 @@ static void InitKeySections() FKeySection *sect = &KeySections[i]; DMenuItemBase *item = CreateOptionMenuItemStaticText(" "); menu->mItems.Push(item); - item = CreateOptionMenuItemStaticText(sect->mTitle, 1); + item = CreateOptionMenuItemStaticText(sect->mTitle.GetChars(), 1); menu->mItems.Push(item); for (unsigned j = 0; j < sect->mActions.Size(); j++) { FKeyAction *act = §->mActions[j]; - item = CreateOptionMenuItemControl(act->mTitle, act->mAction, &Bindings); + item = CreateOptionMenuItemControl(act->mTitle.GetChars(), act->mAction, &Bindings); menu->mItems.Push(item); } } @@ -1210,8 +1210,8 @@ void M_StartupSkillMenu(FNewGameStartup *gs) { if (MenuSkills[i]->PicName.IsNotEmpty()) { - FTextureID tex = GetMenuTexture(MenuSkills[i]->PicName); - if (MenuSkills[i]->MenuName.IsEmpty() || OkForLocalization(tex, MenuSkills[i]->MenuName)) + FTextureID tex = GetMenuTexture(MenuSkills[i]->PicName.GetChars()); + if (MenuSkills[i]->MenuName.IsEmpty() || OkForLocalization(tex, MenuSkills[i]->MenuName.GetChars())) continue; } if ((gameinfo.gametype & GAME_DoomStrifeChex) && spacing == 16) spacing = 18; @@ -1256,8 +1256,8 @@ void M_StartupSkillMenu(FNewGameStartup *gs) if (skill.PicName.Len() != 0 && pItemText == nullptr) { - FTextureID tex = GetMenuTexture(skill.PicName); - if (skill.MenuName.IsEmpty() || OkForLocalization(tex, skill.MenuName)) + FTextureID tex = GetMenuTexture(skill.PicName.GetChars()); + if (skill.MenuName.IsEmpty() || OkForLocalization(tex, skill.MenuName.GetChars())) continue; } const char *c = pItemText ? pItemText->GetChars() : skill.MenuName.GetChars(); @@ -1285,14 +1285,14 @@ void M_StartupSkillMenu(FNewGameStartup *gs) if (color == CR_UNTRANSLATED) color = ld->mFontColor; if (skill.PicName.Len() != 0 && pItemText == nullptr) { - FTextureID tex = GetMenuTexture(skill.PicName); - if (skill.MenuName.IsEmpty() || OkForLocalization(tex, skill.MenuName)) + FTextureID tex = GetMenuTexture(skill.PicName.GetChars()); + if (skill.MenuName.IsEmpty() || OkForLocalization(tex, skill.MenuName.GetChars())) li = CreateListMenuItemPatch(posx, y, spacing, skill.Shortcut, tex, action, SkillIndices[i]); } if (li == nullptr) { li = CreateListMenuItemText(posx, y, spacing, skill.Shortcut, - pItemText? *pItemText : skill.MenuName, ld->mFont, color,ld->mFontColor2, action, SkillIndices[i]); + pItemText? pItemText->GetChars() : skill.MenuName.GetChars(), ld->mFont, color, ld->mFontColor2, action, SkillIndices[i]); } ld->mItems.Push(li); GC::WriteBarrier(*desc, li); @@ -1350,7 +1350,7 @@ void M_StartupSkillMenu(FNewGameStartup *gs) { pItemText = skill.MenuNamesForPlayerClass.CheckKey(gs->PlayerClass); } - li = CreateOptionMenuItemSubmenu(pItemText? *pItemText : skill.MenuName, action, SkillIndices[i]); + li = CreateOptionMenuItemSubmenu(pItemText? pItemText->GetChars() : skill.MenuName.GetChars(), action, SkillIndices[i]); od->mItems.Push(li); GC::WriteBarrier(od, li); if (!done) diff --git a/src/r_data/gldefs.cpp b/src/r_data/gldefs.cpp index 9718c77ec44..07df23fdbff 100644 --- a/src/r_data/gldefs.cpp +++ b/src/r_data/gldefs.cpp @@ -76,7 +76,7 @@ static void do_uniform_set(float value, ExtraUniformCVARData* data) for (unsigned int i = 0; i < PostProcessShaders.Size(); i++) { PostProcessShader& shader = PostProcessShaders[i]; - if (strcmp(shader.Name, data->Shader) == 0) + if (strcmp(shader.Name.GetChars(), data->Shader.GetChars()) == 0) { data->vec4 = shader.Uniforms[data->Uniform].Values; } @@ -154,7 +154,7 @@ static void ParseVavoomSkybox() sb->SetSize(); if (!error) { - TexMan.AddGameTexture(MakeGameTexture(sb, s, ETextureType::Override)); + TexMan.AddGameTexture(MakeGameTexture(sb, s.GetChars(), ETextureType::Override)); } } } @@ -997,7 +997,7 @@ class GLDefsParser break; case LIGHTTAG_LIGHT: ParseString(sc); - AddLightAssociation(name, frameName, sc.String); + AddLightAssociation(name.GetChars(), frameName.GetChars(), sc.String); break; default: sc.ScriptError("Unknown tag: %s\n", sc.String); @@ -1072,7 +1072,7 @@ class GLDefsParser sc.MustGetString(); FString s = sc.String; - FSkyBox * sb = new FSkyBox(s); + FSkyBox * sb = new FSkyBox(s.GetChars()); if (sc.CheckString("fliptop")) { sb->fliptop = true; @@ -1092,7 +1092,7 @@ class GLDefsParser sc.ScriptError("%s: Skybox definition requires either 3 or 6 faces", s.GetChars()); } sb->SetSize(); - TexMan.AddGameTexture(MakeGameTexture(sb, s, ETextureType::Override)); + TexMan.AddGameTexture(MakeGameTexture(sb, s.GetChars(), ETextureType::Override)); } //=========================================================================== @@ -1588,7 +1588,7 @@ class GLDefsParser } sc.MustGetString(); cvarname = sc.String; - cvar = FindCVar(cvarname, NULL); + cvar = FindCVar(cvarname.GetChars(), NULL); UCVarValue oldval; UCVarValue val; @@ -1606,7 +1606,7 @@ class GLDefsParser { if (!cvar) { - cvar = C_CreateCVar(cvarname, cvartype, cvarflags); + cvar = C_CreateCVar(cvarname.GetChars(), cvartype, cvarflags); } else if (cvar && (((cvar->GetFlags()) & CVAR_MOD) == CVAR_MOD)) { @@ -1626,7 +1626,7 @@ class GLDefsParser { oldval.Float = cvar->GetGenericRep(CVAR_Float).Float; delete cvar; - cvar = C_CreateCVar(cvarname, cvartype, cvarflags); + cvar = C_CreateCVar(cvarname.GetChars(), cvartype, cvarflags); oldextra = (ExtraUniformCVARData*)cvar->GetExtraDataPointer(); } @@ -1904,7 +1904,7 @@ class GLDefsParser if (!sc.GetToken ()) { if (addedcvars) - GameConfig->DoModSetup (gameinfo.ConfigName); + GameConfig->DoModSetup (gameinfo.ConfigName.GetChars()); return; } type = sc.MatchString(CoreKeywords);