added even more explicit GetChars() calls.

This commit is contained in:
Christoph Oelckers 2023-10-03 15:55:08 +02:00
parent 1717ff47b2
commit 48ba63c022
42 changed files with 230 additions and 214 deletions

View file

@ -1249,7 +1249,7 @@ public:
FCanvas* GetTextureCanvas(const FString& texturename) FCanvas* GetTextureCanvas(const FString& texturename)
{ {
FTextureID textureid = TexMan.CheckForTexture(texturename, ETextureType::Wall, FTextureManager::TEXMAN_Overridable); FTextureID textureid = TexMan.CheckForTexture(texturename.GetChars(), ETextureType::Wall, FTextureManager::TEXMAN_Overridable);
if (textureid.isValid()) if (textureid.isValid())
{ {
// Only proceed if the texture is a canvas texture. // Only proceed if the texture is a canvas texture.

View file

@ -316,7 +316,7 @@ FileReader FLumpPatchSetReader::OpenFile(const char *name)
FString path; FString path;
if (IsAbsPath(name)) return FileReader(); // no absolute paths in the lump directory. if (IsAbsPath(name)) return FileReader(); // no absolute paths in the lump directory.
path = mBasePath + name; path = mBasePath + name;
auto index = fileSystem.CheckNumForFullName(path); auto index = fileSystem.CheckNumForFullName(path.GetChars());
if (index < 0) return FileReader(); if (index < 0) return FileReader();
return fileSystem.ReopenFileReader(index); return fileSystem.ReopenFileReader(index);
} }
@ -426,7 +426,7 @@ void FSoundFontManager::CollectSoundfonts()
if (soundfonts.Size() == 0) if (soundfonts.Size() == 0)
{ {
ProcessOneFile(NicePath("$PROGDIR/soundfonts/" GAMENAMELOWERCASE ".sf2")); ProcessOneFile(NicePath("$PROGDIR/soundfonts/" GAMENAMELOWERCASE ".sf2").GetChars());
} }
} }

View file

@ -426,4 +426,9 @@ inline FSoundID S_FindSound(const char* name)
return soundEngine->FindSound(name); return soundEngine->FindSound(name);
} }
inline FSoundID S_FindSound(const FString& name)
{
return soundEngine->FindSound(name.GetChars());
}
int SoundEnabled(); int SoundEnabled();

View file

@ -295,7 +295,7 @@ void C_DeinitConsole ()
while (cmd != NULL) while (cmd != NULL)
{ {
GameAtExit *next = cmd->Next; GameAtExit *next = cmd->Next;
AddCommandString (cmd->Command); AddCommandString (cmd->Command.GetChars());
delete cmd; delete cmd;
cmd = next; cmd = next;
} }
@ -661,11 +661,11 @@ void C_DrawConsole ()
{ {
if (textScale == 1) if (textScale == 1)
{ {
DrawText(twod, CurrentConsoleFont, CR_TAN, LEFTMARGIN, offset + lines * CurrentConsoleFont->GetHeight(), p->Text, TAG_DONE); DrawText(twod, CurrentConsoleFont, CR_TAN, LEFTMARGIN, offset + lines * CurrentConsoleFont->GetHeight(), p->Text.GetChars(), TAG_DONE);
} }
else else
{ {
DrawText(twod, CurrentConsoleFont, CR_TAN, LEFTMARGIN, offset + lines * CurrentConsoleFont->GetHeight(), p->Text, DrawText(twod, CurrentConsoleFont, CR_TAN, LEFTMARGIN, offset + lines * CurrentConsoleFont->GetHeight(), p->Text.GetChars(),
DTA_VirtualWidth, twod->GetWidth() / textScale, DTA_VirtualWidth, twod->GetWidth() / textScale,
DTA_VirtualHeight, twod->GetHeight() / textScale, DTA_VirtualHeight, twod->GetHeight() / textScale,
DTA_KeepRatio, true, TAG_DONE); DTA_KeepRatio, true, TAG_DONE);
@ -1012,7 +1012,7 @@ static bool C_HandleKey (event_t *ev, FCommandBuffer &buffer)
} }
HistPos = NULL; HistPos = NULL;
buffer.SetString(""); buffer.SetString("");
AddCommandString(bufferText); AddCommandString(bufferText.GetChars());
TabbedLast = false; TabbedLast = false;
TabbedList = false; TabbedList = false;
break; break;
@ -1060,7 +1060,7 @@ static bool C_HandleKey (event_t *ev, FCommandBuffer &buffer)
{ // copy to clipboard { // copy to clipboard
if (buffer.TextLength() > 0) if (buffer.TextLength() > 0)
{ {
I_PutInClipboard(buffer.GetText()); I_PutInClipboard(buffer.GetText().GetChars());
} }
} }
else else

View file

@ -209,12 +209,12 @@ FBaseCVar::~FBaseCVar ()
{ {
FBaseCVar *var, *prev; FBaseCVar *var, *prev;
var = FindCVar (VarName, &prev); var = FindCVar (VarName.GetChars(), &prev);
if (var == this) if (var == this)
{ {
cvarMap.Remove(var->VarName); cvarMap.Remove(var->VarName);
C_RemoveTabCommand(VarName); C_RemoveTabCommand(VarName.GetChars());
} }
} }
} }
@ -864,27 +864,27 @@ ECVarType FStringCVar::GetRealType () const
UCVarValue FStringCVar::GetGenericRep (ECVarType type) const UCVarValue FStringCVar::GetGenericRep (ECVarType type) const
{ {
return FromString (mValue, type); return FromString (mValue.GetChars(), type);
} }
UCVarValue FStringCVar::GetFavoriteRep (ECVarType *type) const UCVarValue FStringCVar::GetFavoriteRep (ECVarType *type) const
{ {
UCVarValue ret; UCVarValue ret;
*type = CVAR_String; *type = CVAR_String;
ret.String = mValue; ret.String = mValue.GetChars();
return ret; return ret;
} }
UCVarValue FStringCVar::GetGenericRepDefault (ECVarType type) const UCVarValue FStringCVar::GetGenericRepDefault (ECVarType type) const
{ {
return FromString (mDefaultValue, type); return FromString (mDefaultValue.GetChars(), type);
} }
UCVarValue FStringCVar::GetFavoriteRepDefault (ECVarType *type) const UCVarValue FStringCVar::GetFavoriteRepDefault (ECVarType *type) const
{ {
UCVarValue ret; UCVarValue ret;
*type = CVAR_String; *type = CVAR_String;
ret.String = mDefaultValue; ret.String = mDefaultValue.GetChars();
return ret; return ret;
} }
@ -969,7 +969,7 @@ int FColorCVar::ToInt2 (UCVarValue value, ECVarType type)
if (string.IsNotEmpty()) if (string.IsNotEmpty())
{ {
ret = V_GetColorFromString (string); ret = V_GetColorFromString (string.GetChars());
} }
else else
{ {
@ -1394,7 +1394,7 @@ void C_RestoreCVars (void)
{ {
for (unsigned int i = 0; i < CVarBackups.Size(); ++i) for (unsigned int i = 0; i < CVarBackups.Size(); ++i)
{ {
cvar_set(CVarBackups[i].Name, CVarBackups[i].String); cvar_set(CVarBackups[i].Name.GetChars(), CVarBackups[i].String.GetChars());
} }
C_ForgetCVars(); C_ForgetCVars();
} }

View file

@ -79,7 +79,7 @@ public:
if (--TicsLeft == 0) if (--TicsLeft == 0)
{ {
UnsafeExecutionScope scope(IsUnsafe); UnsafeExecutionScope scope(IsUnsafe);
AddCommandString(Command); AddCommandString(Command.GetChars());
return true; return true;
} }
return false; return false;
@ -101,7 +101,7 @@ public:
{ {
if (Text.IsNotEmpty() && Command != nullptr) if (Text.IsNotEmpty() && Command != nullptr)
{ {
FCommandLine args(Text); FCommandLine args(Text.GetChars());
Command->Run(args, 0); Command->Run(args, 0);
} }
return true; return true;
@ -301,7 +301,7 @@ void C_DoCommand (const char *cmd, int keynum)
} }
else else
{ // Get the variable's value { // Get the variable's value
if (var->GetDescription().Len()) Printf("%s\n", GStrings.localize(var->GetDescription())); if (var->GetDescription().Len()) Printf("%s\n", GStrings.localize(var->GetDescription().GetChars()));
Printf ("\"%s\" is \"%s\" ", var->GetName(), var->GetHumanString()); Printf ("\"%s\" is \"%s\" ", var->GetName(), var->GetHumanString());
Printf ("(default: \"%s\")\n", var->GetHumanStringDefault()); Printf ("(default: \"%s\")\n", var->GetHumanStringDefault());
} }
@ -400,7 +400,7 @@ static FConsoleCommand *ScanChainForName (FConsoleCommand *start, const char *na
*prev = NULL; *prev = NULL;
while (start) while (start)
{ {
comp = strnicmp (start->m_Name, name, namelen); comp = start->m_Name.CompareNoCase(name, namelen);
if (comp > 0) if (comp > 0)
return NULL; return NULL;
else if (comp == 0 && start->m_Name[namelen] == 0) else if (comp == 0 && start->m_Name[namelen] == 0)
@ -424,10 +424,10 @@ bool FConsoleCommand::AddToHash (FConsoleCommand **table)
unsigned int key; unsigned int key;
FConsoleCommand *insert, **bucket; FConsoleCommand *insert, **bucket;
key = MakeKey (m_Name); key = MakeKey (m_Name.GetChars());
bucket = &table[key % HASH_SIZE]; bucket = &table[key % HASH_SIZE];
if (ScanChainForName (*bucket, m_Name, strlen (m_Name), &insert)) if (ScanChainForName (*bucket, m_Name.GetChars(), m_Name.Len(), &insert))
{ {
return false; return false;
} }
@ -477,7 +477,7 @@ FConsoleCommand::~FConsoleCommand ()
*m_Prev = m_Next; *m_Prev = m_Next;
if (m_Next) if (m_Next)
m_Next->m_Prev = m_Prev; m_Next->m_Prev = m_Prev;
C_RemoveTabCommand (m_Name); C_RemoveTabCommand (m_Name.GetChars());
} }
void FConsoleCommand::Run(FCommandLine &argv, int key) void FConsoleCommand::Run(FCommandLine &argv, int key)
@ -530,7 +530,7 @@ FString BuildString (int argc, FString *argv)
{ // It's an empty argument, we need to convert it to '""' { // It's an empty argument, we need to convert it to '""'
buf << "\"\" "; buf << "\"\" ";
} }
else if (strchr(argv[arg], '"')) else if (strchr(argv[arg].GetChars(), '"'))
{ // If it contains one or more quotes, we need to escape them. { // If it contains one or more quotes, we need to escape them.
buf << '"'; buf << '"';
ptrdiff_t substr_start = 0, quotepos; ptrdiff_t substr_start = 0, quotepos;
@ -545,7 +545,7 @@ FString BuildString (int argc, FString *argv)
} }
buf << argv[arg].Mid(substr_start) << "\" "; buf << argv[arg].Mid(substr_start) << "\" ";
} }
else if (strchr(argv[arg], ' ')) else if (strchr(argv[arg].GetChars(), ' '))
{ // If it contains a space, it needs to be quoted. { // If it contains a space, it needs to be quoted.
buf << '"' << argv[arg] << "\" "; buf << '"' << argv[arg] << "\" ";
} }
@ -674,7 +674,7 @@ static int DumpHash (FConsoleCommand **table, bool aliases, const char *pattern=
cmd = table[bucket]; cmd = table[bucket];
while (cmd) while (cmd)
{ {
if (CheckWildcards (pattern, cmd->m_Name)) if (CheckWildcards (pattern, cmd->m_Name.GetChars()))
{ {
if (cmd->IsAlias()) if (cmd->IsAlias())
{ {
@ -712,8 +712,8 @@ void FConsoleAlias::Archive (FConfigFile *f)
{ {
if (f != NULL && !m_Command[0].IsEmpty()) if (f != NULL && !m_Command[0].IsEmpty())
{ {
f->SetValueForKey ("Name", m_Name, true); f->SetValueForKey ("Name", m_Name.GetChars(), true);
f->SetValueForKey ("Command", m_Command[0], true); f->SetValueForKey ("Command", m_Command[0].GetChars(), true);
} }
} }
@ -923,7 +923,7 @@ void FConsoleAlias::Run (FCommandLine &args, int key)
} }
bRunning = true; bRunning = true;
AddCommandString (mycommand, key); AddCommandString (mycommand.GetChars(), key);
bRunning = false; bRunning = false;
if (m_Command[index].IsEmpty()) if (m_Command[index].IsEmpty())
{ // The alias is unchanged, so put the command back so it can be used again. { // The alias is unchanged, so put the command back so it can be used again.
@ -999,7 +999,7 @@ void FExecList::ExecCommands() const
{ {
for (unsigned i = 0; i < Commands.Size(); ++i) for (unsigned i = 0; i < Commands.Size(); ++i)
{ {
AddCommandString(Commands[i]); AddCommandString(Commands[i].GetChars());
} }
} }
@ -1007,7 +1007,7 @@ void FExecList::AddPullins(std::vector<std::string>& wads, FConfigFile *config)
{ {
for (unsigned i = 0; i < Pullins.Size(); ++i) for (unsigned i = 0; i < Pullins.Size(); ++i)
{ {
D_AddFile(wads, Pullins[i], true, -1, config); D_AddFile(wads, Pullins[i].GetChars(), true, -1, config);
} }
} }

View file

@ -189,11 +189,11 @@ UNSAFE_CCMD (dir)
{ {
path = I_GetCWD();; path = I_GetCWD();;
} }
auto base = ExtractFileBase(path, true); auto base = ExtractFileBase(path.GetChars(), true);
FString bpath; FString bpath;
if (base.IndexOfAny("*?") >= 0) if (base.IndexOfAny("*?") >= 0)
{ {
bpath = ExtractFilePath(path); bpath = ExtractFilePath(path.GetChars());
} }
else else
{ {
@ -202,7 +202,7 @@ UNSAFE_CCMD (dir)
} }
FileSys::FileList list; FileSys::FileList list;
if (!FileSys::ScanDirectory(list, bpath, base, true)) if (!FileSys::ScanDirectory(list, bpath.GetChars(), base.GetChars(), true))
{ {
Printf ("Nothing matching %s\n", path.GetChars()); Printf ("Nothing matching %s\n", path.GetChars());
} }

View file

@ -224,7 +224,7 @@ static void FormatTime(const FString& timeForm, int timeVal, FString* result)
if (timeinfo != nullptr) if (timeinfo != nullptr)
{ {
char timeString[1024]; char timeString[1024];
if (strftime(timeString, sizeof(timeString), timeForm, timeinfo)) if (strftime(timeString, sizeof(timeString), timeForm.GetChars(), timeinfo))
*result = timeString; *result = timeString;
} }
} }

View file

@ -97,7 +97,7 @@ FFont::FFont (const char *name, const char *nametemplate, const char *filetempla
FStringf path("fonts/%s/", filetemplate); FStringf path("fonts/%s/", filetemplate);
// If a name template is given, collect data from all resource files. // If a name template is given, collect data from all resource files.
// For anything else, each folder is being treated as an atomic, self-contained unit and mixing from different glyph sets is blocked. // For anything else, each folder is being treated as an atomic, self-contained unit and mixing from different glyph sets is blocked.
fileSystem.GetFilesInFolder(path, folderdata, nametemplate == nullptr); fileSystem.GetFilesInFolder(path.GetChars(), folderdata, nametemplate == nullptr);
//if (nametemplate == nullptr) //if (nametemplate == nullptr)
{ {
@ -231,8 +231,8 @@ FFont::FFont (const char *name, const char *nametemplate, const char *filetempla
// provide STCFN120 (x) and STCFN122 (z) for STCFN121 to load as a 'y'. // provide STCFN120 (x) and STCFN122 (z) for STCFN121 to load as a 'y'.
FStringf c120(nametemplate, 120); FStringf c120(nametemplate, 120);
FStringf c122(nametemplate, 122); FStringf c122(nametemplate, 122);
if (!TexMan.CheckForTexture(c120, ETextureType::MiscPatch).isValid() || if (!TexMan.CheckForTexture(c120.GetChars(), ETextureType::MiscPatch).isValid() ||
!TexMan.CheckForTexture(c122, ETextureType::MiscPatch).isValid()) !TexMan.CheckForTexture(c122.GetChars(), ETextureType::MiscPatch).isValid())
{ {
// insert the incorrectly named '|' graphic in its correct position. // insert the incorrectly named '|' graphic in its correct position.
position = 124; position = 124;

View file

@ -113,7 +113,7 @@ FFont *V_GetFont(const char *name, const char *fontlumpname)
FStringf path("fonts/%s/", name); FStringf path("fonts/%s/", name);
// Use a folder-based font only if it comes from a later file than the single lump version. // Use a folder-based font only if it comes from a later file than the single lump version.
if (fileSystem.GetFilesInFolder(path, folderdata, true)) if (fileSystem.GetFilesInFolder(path.GetChars(), folderdata, true))
{ {
// This assumes that any custom font comes in one piece and not distributed across multiple resource files. // This assumes that any custom font comes in one piece and not distributed across multiple resource files.
folderfile = fileSystem.GetFileContainer(folderdata[0].lumpnum); folderfile = fileSystem.GetFileContainer(folderdata[0].lumpnum);
@ -300,7 +300,7 @@ void V_InitCustomFonts()
} }
if (format == 1) if (format == 1)
{ {
FFont *fnt = new FFont (namebuffer, templatebuf, nullptr, first, count, start, llump, spacewidth, donttranslate); FFont *fnt = new FFont(namebuffer.GetChars(), templatebuf.GetChars(), nullptr, first, count, start, llump, spacewidth, donttranslate);
fnt->SetCursor(cursor); fnt->SetCursor(cursor);
fnt->SetKerning(kerning); fnt->SetKerning(kerning);
if (ignoreoffsets) fnt->ClearOffsets(); if (ignoreoffsets) fnt->ClearOffsets();
@ -326,7 +326,7 @@ void V_InitCustomFonts()
if (count > 0) if (count > 0)
{ {
FFont *CreateSpecialFont (const char *name, int first, int count, FGameTexture **lumplist, const bool *notranslate, int lump, bool donttranslate); FFont *CreateSpecialFont (const char *name, int first, int count, FGameTexture **lumplist, const bool *notranslate, int lump, bool donttranslate);
FFont *fnt = CreateSpecialFont (namebuffer, first, count, &lumplist[first], notranslate, llump, donttranslate); FFont *fnt = CreateSpecialFont(namebuffer.GetChars(), first, count, &lumplist[first], notranslate, llump, donttranslate);
fnt->SetCursor(cursor); fnt->SetCursor(cursor);
fnt->SetKerning(kerning); fnt->SetKerning(kerning);
if (spacewidth >= 0) fnt->SpaceWidth = spacewidth; if (spacewidth >= 0) fnt->SpaceWidth = spacewidth;

View file

@ -89,7 +89,7 @@ void FModel::DestroyVertexBuffer()
static int FindGFXFile(FString & fn) static int FindGFXFile(FString & fn)
{ {
int lump = fileSystem.CheckNumForFullName(fn); // if we find something that matches the name plus the extension, return it and do not enter the substitution logic below. int lump = fileSystem.CheckNumForFullName(fn.GetChars()); // if we find something that matches the name plus the extension, return it and do not enter the substitution logic below.
if (lump != -1) return lump; if (lump != -1) return lump;
int best = -1; int best = -1;
@ -101,7 +101,7 @@ static int FindGFXFile(FString & fn)
for (const char ** extp=extensions; *extp; extp++) for (const char ** extp=extensions; *extp; extp++)
{ {
lump = fileSystem.CheckNumForFullName(fn + *extp); lump = fileSystem.CheckNumForFullName((fn + *extp).GetChars());
if (lump >= best) best = lump; if (lump >= best) best = lump;
} }
return best; return best;
@ -149,7 +149,7 @@ unsigned FindModel(const char * path, const char * modelfile, bool silent)
if (path) fullname.Format("%s%s", path, modelfile); if (path) fullname.Format("%s%s", path, modelfile);
else fullname = modelfile; else fullname = modelfile;
int lump = fileSystem.CheckNumForFullName(fullname); int lump = fileSystem.CheckNumForFullName(fullname.GetChars());
if (lump<0) if (lump<0)
{ {
@ -170,7 +170,7 @@ unsigned FindModel(const char * path, const char * modelfile, bool silent)
{ {
FString anivfile = fullname.GetChars(); FString anivfile = fullname.GetChars();
anivfile.Substitute("_d.3d","_a.3d"); anivfile.Substitute("_d.3d","_a.3d");
if ( fileSystem.CheckNumForFullName(anivfile) > 0 ) if ( fileSystem.CheckNumForFullName(anivfile.GetChars()) > 0 )
{ {
model = new FUE1Model; model = new FUE1Model;
} }
@ -179,7 +179,7 @@ unsigned FindModel(const char * path, const char * modelfile, bool silent)
{ {
FString datafile = fullname.GetChars(); FString datafile = fullname.GetChars();
datafile.Substitute("_a.3d","_d.3d"); datafile.Substitute("_a.3d","_d.3d");
if ( fileSystem.CheckNumForFullName(datafile) > 0 ) if ( fileSystem.CheckNumForFullName(datafile.GetChars()) > 0 )
{ {
model = new FUE1Model; model = new FUE1Model;
} }

View file

@ -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. // 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()); FStringf path("%s" GAMENAMELOWERCASE "_portable.ini", progdir.GetChars());
if (FileExists(path.GetChars())) if (FileExists(path))
{ {
file = CreateFile(path.WideString().c_str(), GENERIC_READ | GENERIC_WRITE, 0, NULL, file = CreateFile(path.WideString().c_str(), GENERIC_READ | GENERIC_WRITE, 0, NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
@ -217,7 +217,7 @@ FString M_GetOldConfigPath(int& type)
} }
path << GAMENAMELOWERCASE "-" << FString(uname) << ".ini"; path << GAMENAMELOWERCASE "-" << FString(uname) << ".ini";
type = 0; type = 0;
if (FileExists(path.GetChars())) if (FileExists(path))
return path; return path;
} }
@ -226,7 +226,7 @@ FString M_GetOldConfigPath(int& type)
path = GetKnownFolder(CSIDL_APPDATA, FOLDERID_RoamingAppData, true); path = GetKnownFolder(CSIDL_APPDATA, FOLDERID_RoamingAppData, true);
path += "/" GAME_DIR "/" GAMENAMELOWERCASE ".ini"; path += "/" GAME_DIR "/" GAMENAMELOWERCASE ".ini";
type = 1; type = 1;
if (FileExists(path.GetChars())) if (FileExists(path))
return path; return path;
return ""; return "";
@ -285,7 +285,7 @@ FString M_GetConfigPath(bool for_reading)
path += "/My Games/" GAME_DIR; path += "/My Games/" GAME_DIR;
CreatePath(path.GetChars()); CreatePath(path.GetChars());
path += "/" GAMENAMELOWERCASE ".ini"; path += "/" GAMENAMELOWERCASE ".ini";
if (!for_reading || FileExists(path.GetChars())) if (!for_reading || FileExists(path))
return path; return path;
// No config was found in the accepted locations. // No config was found in the accepted locations.
@ -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 we are reading the config file, check if it exists. If not, fallback to base version.
if (for_reading) if (for_reading)
{ {
if (!FileExists(path.GetChars())) if (!FileExists(path))
{ {
path = progdir; path = progdir;
path << GAMENAMELOWERCASE ".ini"; path << GAMENAMELOWERCASE ".ini";

View file

@ -1013,7 +1013,7 @@ void PPCustomShaderInstance::SetTextures(PPRenderState *renderstate)
while (it.NextPair(pair)) while (it.NextPair(pair))
{ {
FString name = pair->Value; FString name = pair->Value;
auto gtex = TexMan.GetGameTexture(TexMan.CheckForTexture(name, ETextureType::Any), true); auto gtex = TexMan.GetGameTexture(TexMan.CheckForTexture(name.GetChars(), ETextureType::Any), true);
if (gtex && gtex->isValid()) if (gtex && gtex->isValid())
{ {
// Why does this completely circumvent the normal way of handling textures? // Why does this completely circumvent the normal way of handling textures?

View file

@ -790,7 +790,7 @@ VMFunction *FFunctionBuildList::AddFunction(PNamespace *gnspc, const VersionInfo
it.PrintableName = name; it.PrintableName = name;
it.Function = new VMScriptFunction; it.Function = new VMScriptFunction;
it.Function->Name = functype->SymbolName; it.Function->Name = functype->SymbolName;
it.Function->QualifiedName = it.Function->PrintableName = ClassDataAllocator.Strdup(name); it.Function->QualifiedName = it.Function->PrintableName = ClassDataAllocator.Strdup(name.GetChars());
it.Function->ImplicitArgs = functype->GetImplicitArgs(); it.Function->ImplicitArgs = functype->GetImplicitArgs();
it.Proto = nullptr; it.Proto = nullptr;
it.FromDecorate = fromdecorate; it.FromDecorate = fromdecorate;
@ -1148,7 +1148,7 @@ void VMDisassemblyDumper::Write(VMScriptFunction *sfunc, const FString &fname)
assert(sfunc != nullptr); assert(sfunc != nullptr);
DumpFunction(dump, sfunc, fname, (int)fname.Len()); DumpFunction(dump, sfunc, fname.GetChars(), (int)fname.Len());
codesize += sfunc->CodeSize; codesize += sfunc->CodeSize;
datasize += sfunc->LineInfoCount * sizeof(FStatementInfo) + sfunc->ExtraSpace + sfunc->NumKonstD * sizeof(int) + datasize += sfunc->LineInfoCount * sizeof(FStatementInfo) + sfunc->ExtraSpace + sfunc->NumKonstD * sizeof(int) +
sfunc->NumKonstA * sizeof(void*) + sfunc->NumKonstF * sizeof(double) + sfunc->NumKonstS * sizeof(FString); sfunc->NumKonstA * sizeof(void*) + sfunc->NumKonstF * sizeof(double) + sfunc->NumKonstS * sizeof(FString);

View file

@ -662,7 +662,7 @@ void ZCCCompiler::MessageV(ZCC_TreeNode *node, const char *txtcolor, const char
composed.Format("%s%s, line %d: ", txtcolor, node->SourceName->GetChars(), node->SourceLoc); composed.Format("%s%s, line %d: ", txtcolor, node->SourceName->GetChars(), node->SourceLoc);
composed.VAppendFormat(msg, argptr); composed.VAppendFormat(msg, argptr);
composed += '\n'; composed += '\n';
PrintString(PRINT_HIGH, composed); PrintString(PRINT_HIGH, composed.GetChars());
} }
//========================================================================== //==========================================================================

View file

@ -471,7 +471,7 @@ PNamespace *ParseOneScript(const int baselump, ZCCParseState &state)
ParseSingleFile(&sc, nullptr, lumpnum, parser, state); ParseSingleFile(&sc, nullptr, lumpnum, parser, state);
for (unsigned i = 0; i < Includes.Size(); i++) for (unsigned i = 0; i < Includes.Size(); i++)
{ {
lumpnum = fileSystem.CheckNumForFullName(Includes[i], true); lumpnum = fileSystem.CheckNumForFullName(Includes[i].GetChars(), true);
if (lumpnum == -1) if (lumpnum == -1)
{ {
IncludeLocs[i].Message(MSG_ERROR, "Include script lump %s not found", Includes[i].GetChars()); IncludeLocs[i].Message(MSG_ERROR, "Include script lump %s not found", Includes[i].GetChars());
@ -518,7 +518,7 @@ PNamespace *ParseOneScript(const int baselump, ZCCParseState &state)
FString filename = fileSystem.GetFileFullPath(baselump).c_str(); FString filename = fileSystem.GetFileFullPath(baselump).c_str();
filename.ReplaceChars(":\\/?|", '.'); filename.ReplaceChars(":\\/?|", '.');
filename << ".ast"; filename << ".ast";
FileWriter *ff = FileWriter::Open(filename); FileWriter *ff = FileWriter::Open(filename.GetChars());
if (ff != NULL) if (ff != NULL)
{ {
ff->Write(ast.GetChars(), ast.Len()); ff->Write(ast.GetChars(), ast.Len());

View file

@ -148,7 +148,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(DStatusBarCore, DrawTexture, SBar_DrawTexture)
void SBar_DrawImage(DStatusBarCore* self, const FString& texid, double x, double y, int flags, double alpha, double w, double h, double scaleX, double scaleY, int style, int color, int translation, double clipwidth) void SBar_DrawImage(DStatusBarCore* self, const FString& texid, double x, double y, int flags, double alpha, double w, double h, double scaleX, double scaleY, int style, int color, int translation, double clipwidth)
{ {
if (!twod->HasBegun2D()) ThrowAbortException(X_OTHER, "Attempt to draw to screen outside a draw function"); if (!twod->HasBegun2D()) ThrowAbortException(X_OTHER, "Attempt to draw to screen outside a draw function");
self->DrawGraphic(TexMan.CheckForTexture(texid, ETextureType::Any), x, y, flags, alpha, w, h, scaleX, scaleY, ERenderStyle(style), color, translation, clipwidth); self->DrawGraphic(TexMan.CheckForTexture(texid.GetChars(), ETextureType::Any), x, y, flags, alpha, w, h, scaleX, scaleY, ERenderStyle(style), color, translation, clipwidth);
} }
DEFINE_ACTION_FUNCTION_NATIVE(DStatusBarCore, DrawImage, SBar_DrawImage) DEFINE_ACTION_FUNCTION_NATIVE(DStatusBarCore, DrawImage, SBar_DrawImage)
@ -174,7 +174,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(DStatusBarCore, DrawImage, SBar_DrawImage)
void SBar_DrawImageRotated(DStatusBarCore* self, const FString& texid, double x, double y, int flags, double angle, double alpha, double scaleX, double scaleY, int style, int color, int translation) void SBar_DrawImageRotated(DStatusBarCore* self, const FString& texid, double x, double y, int flags, double angle, double alpha, double scaleX, double scaleY, int style, int color, int translation)
{ {
if (!twod->HasBegun2D()) ThrowAbortException(X_OTHER, "Attempt to draw to screen outside a draw function"); if (!twod->HasBegun2D()) ThrowAbortException(X_OTHER, "Attempt to draw to screen outside a draw function");
self->DrawRotated(TexMan.CheckForTexture(texid, ETextureType::Any), x, y, flags, angle, alpha, scaleX, scaleY, color, translation, (ERenderStyle)style); self->DrawRotated(TexMan.CheckForTexture(texid.GetChars(), ETextureType::Any), x, y, flags, angle, alpha, scaleX, scaleY, color, translation, (ERenderStyle)style);
} }
DEFINE_ACTION_FUNCTION_NATIVE(DStatusBarCore, DrawImageRotated, SBar_DrawImageRotated) DEFINE_ACTION_FUNCTION_NATIVE(DStatusBarCore, DrawImageRotated, SBar_DrawImageRotated)
@ -433,7 +433,7 @@ DEFINE_ACTION_FUNCTION(_TexMan, GetName)
static int CheckForTexture(const FString& name, int type, int flags) static int CheckForTexture(const FString& name, int type, int flags)
{ {
return TexMan.CheckForTexture(name, static_cast<ETextureType>(type), flags).GetIndex(); return TexMan.CheckForTexture(name.GetChars(), static_cast<ETextureType>(type), flags).GetIndex();
} }
DEFINE_ACTION_FUNCTION_NATIVE(_TexMan, CheckForTexture, CheckForTexture) DEFINE_ACTION_FUNCTION_NATIVE(_TexMan, CheckForTexture, CheckForTexture)
@ -560,7 +560,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(_TexMan, CheckRealHeight, CheckRealHeight)
static int OkForLocalization_(int index, const FString& substitute) static int OkForLocalization_(int index, const FString& substitute)
{ {
return sysCallbacks.OkForLocalization? sysCallbacks.OkForLocalization(FSetTextureID(index), substitute) : false; return sysCallbacks.OkForLocalization? sysCallbacks.OkForLocalization(FSetTextureID(index), substitute.GetChars()) : false;
} }
DEFINE_ACTION_FUNCTION_NATIVE(_TexMan, OkForLocalization, OkForLocalization_) DEFINE_ACTION_FUNCTION_NATIVE(_TexMan, OkForLocalization, OkForLocalization_)
@ -788,14 +788,14 @@ DEFINE_ACTION_FUNCTION(_Wads, CheckNumForName)
PARAM_INT(ns); PARAM_INT(ns);
PARAM_INT(wadnum); PARAM_INT(wadnum);
PARAM_BOOL(exact); PARAM_BOOL(exact);
ACTION_RETURN_INT(fileSystem.CheckNumForName(name, ns, wadnum, exact)); ACTION_RETURN_INT(fileSystem.CheckNumForName(name.GetChars(), ns, wadnum, exact));
} }
DEFINE_ACTION_FUNCTION(_Wads, CheckNumForFullName) DEFINE_ACTION_FUNCTION(_Wads, CheckNumForFullName)
{ {
PARAM_PROLOGUE; PARAM_PROLOGUE;
PARAM_STRING(name); PARAM_STRING(name);
ACTION_RETURN_INT(fileSystem.CheckNumForFullName(name)); ACTION_RETURN_INT(fileSystem.CheckNumForFullName(name.GetChars()));
} }
DEFINE_ACTION_FUNCTION(_Wads, FindLump) DEFINE_ACTION_FUNCTION(_Wads, FindLump)
@ -805,7 +805,7 @@ DEFINE_ACTION_FUNCTION(_Wads, FindLump)
PARAM_INT(startlump); PARAM_INT(startlump);
PARAM_INT(ns); PARAM_INT(ns);
const bool isLumpValid = startlump >= 0 && startlump < fileSystem.GetNumEntries(); const bool isLumpValid = startlump >= 0 && startlump < fileSystem.GetNumEntries();
ACTION_RETURN_INT(isLumpValid ? fileSystem.FindLump(name, &startlump, 0 != ns) : -1); ACTION_RETURN_INT(isLumpValid ? fileSystem.FindLump(name.GetChars(), &startlump, 0 != ns) : -1);
} }
DEFINE_ACTION_FUNCTION(_Wads, FindLumpFullName) DEFINE_ACTION_FUNCTION(_Wads, FindLumpFullName)
@ -815,7 +815,7 @@ DEFINE_ACTION_FUNCTION(_Wads, FindLumpFullName)
PARAM_INT(startlump); PARAM_INT(startlump);
PARAM_BOOL(noext); PARAM_BOOL(noext);
const bool isLumpValid = startlump >= 0 && startlump < fileSystem.GetNumEntries(); const bool isLumpValid = startlump >= 0 && startlump < fileSystem.GetNumEntries();
ACTION_RETURN_INT(isLumpValid ? fileSystem.FindLumpFullName(name, &startlump, noext) : -1); ACTION_RETURN_INT(isLumpValid ? fileSystem.FindLumpFullName(name.GetChars(), &startlump, noext) : -1);
} }
DEFINE_ACTION_FUNCTION(_Wads, GetLumpName) DEFINE_ACTION_FUNCTION(_Wads, GetLumpName)
@ -1023,7 +1023,7 @@ DEFINE_ACTION_FUNCTION(FKeyBindings, SetBind)
} }
self->SetBind(k, cmd); self->SetBind(k, cmd.GetChars());
return 0; return 0;
} }
@ -1062,7 +1062,7 @@ DEFINE_ACTION_FUNCTION(FKeyBindings, GetAllKeysForCommand)
PARAM_SELF_STRUCT_PROLOGUE(FKeyBindings); PARAM_SELF_STRUCT_PROLOGUE(FKeyBindings);
PARAM_POINTER(array, TArray<int>); PARAM_POINTER(array, TArray<int>);
PARAM_STRING(cmd); PARAM_STRING(cmd);
*array = self->GetKeysForCommand(cmd); *array = self->GetKeysForCommand(cmd.GetChars());
return 0; return 0;
} }
@ -1084,7 +1084,7 @@ DEFINE_ACTION_FUNCTION(FKeyBindings, UnbindACommand)
I_FatalError("Attempt to unbind key bindings for '%s' outside of menu code", cmd.GetChars()); I_FatalError("Attempt to unbind key bindings for '%s' outside of menu code", cmd.GetChars());
} }
self->UnbindACommand(cmd); self->UnbindACommand(cmd.GetChars());
return 0; return 0;
} }
@ -1102,7 +1102,7 @@ DEFINE_ACTION_FUNCTION(DOptionMenuItemCommand, DoCommand)
} }
UnsafeExecutionScope scope(unsafe); UnsafeExecutionScope scope(unsafe);
AddCommandString(cmd); AddCommandString(cmd.GetChars());
return 0; return 0;
} }
@ -1147,7 +1147,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(_System, StopAllSounds, StopAllSounds)
static int PlayMusic(const FString& musname, int order, int looped) static int PlayMusic(const FString& musname, int order, int looped)
{ {
return S_ChangeMusic(musname, order, !!looped, true); return S_ChangeMusic(musname.GetChars(), order, !!looped, true);
} }
DEFINE_ACTION_FUNCTION_NATIVE(_System, PlayMusic, PlayMusic) DEFINE_ACTION_FUNCTION_NATIVE(_System, PlayMusic, PlayMusic)

View file

@ -2117,7 +2117,7 @@ static void DoCast(const VMRegisters &reg, const VMFrame *f, int a, int b, int c
case CAST_S2Co: case CAST_S2Co:
ASSERTD(a); ASSERTS(b); ASSERTD(a); ASSERTS(b);
reg.d[a] = V_GetColor(reg.s[b]); reg.d[a] = V_GetColor(reg.s[b].GetChars());
break; break;
case CAST_Co2S: case CAST_Co2S:

View file

@ -34,6 +34,10 @@ char(&_ArraySizeHelper(T(&array)[N]))[N];
#define myoffsetof(type,identifier) ((size_t)&((type *)alignof(type))->identifier - alignof(type)) #define myoffsetof(type,identifier) ((size_t)&((type *)alignof(type))->identifier - alignof(type))
bool FileExists (const char *filename); bool FileExists (const char *filename);
inline bool FileExists(const FString& filename)
{
return FileExists(filename.GetChars());
}
bool FileReadable (const char *filename); bool FileReadable (const char *filename);
bool DirExists(const char *filename); bool DirExists(const char *filename);
bool DirEntryExists (const char *pathname, bool *isdir = nullptr); bool DirEntryExists (const char *pathname, bool *isdir = nullptr);

View file

@ -309,12 +309,12 @@ CCMD (idclev)
// Catch invalid maps. // Catch invalid maps.
mapname = CalcMapName (epsd, map); mapname = CalcMapName (epsd, map);
if (!P_CheckMapData(mapname)) if (!P_CheckMapData(mapname.GetChars()))
return; return;
// So be it. // So be it.
Printf ("%s\n", GStrings("STSTR_CLEV")); Printf ("%s\n", GStrings("STSTR_CLEV"));
G_DeferedInitNew (mapname); G_DeferedInitNew (mapname.GetChars());
//players[0].health = 0; // Force reset //players[0].health = 0; // Force reset
} }
} }
@ -334,11 +334,11 @@ CCMD (hxvisit)
{ {
// Just because it's in MAPINFO doesn't mean it's in the wad. // Just because it's in MAPINFO doesn't mean it's in the wad.
if (P_CheckMapData(mapname)) if (P_CheckMapData(mapname.GetChars()))
{ {
// So be it. // So be it.
Printf ("%s\n", GStrings("STSTR_CLEV")); Printf ("%s\n", GStrings("STSTR_CLEV"));
G_DeferedInitNew (mapname); G_DeferedInitNew (mapname.GetChars());
return; return;
} }
} }
@ -686,8 +686,8 @@ UNSAFE_CCMD (load)
return; return;
} }
#endif #endif
fname = G_BuildSaveName(fname); fname = G_BuildSaveName(fname.GetChars());
G_LoadGame (fname); G_LoadGame (fname.GetChars());
} }
//========================================================================== //==========================================================================
@ -725,8 +725,8 @@ UNSAFE_CCMD(save)
return; return;
} }
#endif #endif
fname = G_BuildSaveName(fname); fname = G_BuildSaveName(fname.GetChars());
G_SaveGame (fname, argv.argc() > 2 ? argv[2] : argv[1]); G_SaveGame (fname.GetChars(), argv.argc() > 2 ? argv[2] : argv[1]);
} }
@ -971,7 +971,7 @@ CCMD(nextmap)
if (primaryLevel->NextMap.Len() > 0 && primaryLevel->NextMap.Compare("enDSeQ", 6)) if (primaryLevel->NextMap.Len() > 0 && primaryLevel->NextMap.Compare("enDSeQ", 6))
{ {
G_DeferedInitNew(primaryLevel->NextMap); G_DeferedInitNew(primaryLevel->NextMap.GetChars());
} }
else else
{ {
@ -995,7 +995,7 @@ CCMD(nextsecret)
if (primaryLevel->NextSecretMap.Len() > 0 && primaryLevel->NextSecretMap.Compare("enDSeQ", 6)) if (primaryLevel->NextSecretMap.Len() > 0 && primaryLevel->NextSecretMap.Compare("enDSeQ", 6))
{ {
G_DeferedInitNew(primaryLevel->NextSecretMap); G_DeferedInitNew(primaryLevel->NextSecretMap.GetChars());
} }
else else
{ {
@ -1085,7 +1085,7 @@ static void PrintSecretString(const char *string, bool thislevel)
CCMD(secret) CCMD(secret)
{ {
const char *mapname = argv.argc() < 2? primaryLevel->MapName.GetChars() : argv[1]; const char *mapname = argv.argc() < 2? primaryLevel->MapName.GetChars() : argv[1];
bool thislevel = !stricmp(mapname, primaryLevel->MapName); bool thislevel = !stricmp(mapname, primaryLevel->MapName.GetChars());
bool foundsome = false; bool foundsome = false;
int lumpno=fileSystem.CheckNumForName("SECRETS"); int lumpno=fileSystem.CheckNumForName("SECRETS");
@ -1105,13 +1105,13 @@ CCMD(secret)
{ {
if (readbuffer[0] == '[') if (readbuffer[0] == '[')
{ {
inlevel = !strnicmp(readbuffer, maphdr, maphdr.Len()); inlevel = !strnicmp(readbuffer, maphdr.GetChars(), maphdr.Len());
if (!foundsome) if (!foundsome)
{ {
FString levelname; FString levelname;
level_info_t *info = FindLevelInfo(mapname); level_info_t *info = FindLevelInfo(mapname);
const char* ln = info->LookupLevelName(); FString ln = info->LookupLevelName();
levelname.Format("%s - %s", mapname, ln); levelname.Format("%s - %s", mapname, ln.GetChars());
Printf(TEXTCOLOR_YELLOW "%s\n", levelname.GetChars()); Printf(TEXTCOLOR_YELLOW "%s\n", levelname.GetChars());
size_t llen = levelname.Len(); size_t llen = levelname.Len();
levelname = ""; levelname = "";
@ -1132,7 +1132,7 @@ CCMD(secret)
// line complete so print it. // line complete so print it.
linebuild.Substitute("\r", ""); linebuild.Substitute("\r", "");
linebuild.StripRight(" \t\n"); linebuild.StripRight(" \t\n");
PrintSecretString(linebuild, thislevel); PrintSecretString(linebuild.GetChars(), thislevel);
linebuild = ""; linebuild = "";
} }
} }
@ -1209,11 +1209,11 @@ CCMD(idmus)
map = CalcMapName(argv[1][0] - '0', argv[1][1] - '0'); map = CalcMapName(argv[1][0] - '0', argv[1][1] - '0');
} }
if ((info = FindLevelInfo(map))) if ((info = FindLevelInfo(map.GetChars())))
{ {
if (info->Music.IsNotEmpty()) if (info->Music.IsNotEmpty())
{ {
S_ChangeMusic(info->Music, info->musicorder); S_ChangeMusic(info->Music.GetChars(), info->musicorder);
Printf("%s\n", GStrings("STSTR_MUS")); Printf("%s\n", GStrings("STSTR_MUS"));
} }
} }
@ -1310,7 +1310,7 @@ CCMD (mapinfo)
Printf(" LevelName: %s\n", myLevel->LookupLevelName().GetChars()); Printf(" LevelName: %s\n", myLevel->LookupLevelName().GetChars());
if (myLevel->AuthorName.IsNotEmpty()) if (myLevel->AuthorName.IsNotEmpty())
Printf(" AuthorName: %s\n", testlocalised(myLevel->AuthorName)); Printf(" AuthorName: %s\n", testlocalised(myLevel->AuthorName.GetChars()));
if (myLevel->levelnum) if (myLevel->levelnum)
Printf(" LevelNum: %i\n", myLevel->levelnum); Printf(" LevelNum: %i\n", myLevel->levelnum);
@ -1322,7 +1322,7 @@ CCMD (mapinfo)
Printf(" SecretNext: %s\n", myLevel->NextSecretMap.GetChars()); Printf(" SecretNext: %s\n", myLevel->NextSecretMap.GetChars());
if (myLevel->Music.IsNotEmpty()) if (myLevel->Music.IsNotEmpty())
Printf(" Music: %s%s\n", myLevel->Music[0] == '$'? "D_" : "", testlocalised(myLevel->Music)); Printf(" Music: %s%s\n", myLevel->Music[0] == '$'? "D_" : "", testlocalised(myLevel->Music.GetChars()));
Printf(" PixelStretch: %f\n", myLevel->pixelstretch); Printf(" PixelStretch: %f\n", myLevel->pixelstretch);

View file

@ -81,17 +81,17 @@ void D_GrabCVarDefaults()
CurrentFindCVar.ToLower(); CurrentFindCVar.ToLower();
// these two got renamed // these two got renamed
if (strcmp(CurrentFindCVar, "gamma") == 0) if (CurrentFindCVar.Compare("gamma") == 0)
{ {
CurrentFindCVar = "vid_gamma"; CurrentFindCVar = "vid_gamma";
} }
if (strcmp(CurrentFindCVar, "fullscreen") == 0) if (CurrentFindCVar.Compare("fullscreen") == 0)
{ {
CurrentFindCVar = "vid_fullscreen"; CurrentFindCVar = "vid_fullscreen";
} }
// this was removed // this was removed
if (strcmp(CurrentFindCVar, "cd_drive") == 0) if (CurrentFindCVar.Compare("cd_drive") == 0)
break; break;
} }
if (lumpversion < 221) if (lumpversion < 221)
@ -100,9 +100,9 @@ void D_GrabCVarDefaults()
// this one doesn't matter as much, since it depended on platform-specific values, // this one doesn't matter as much, since it depended on platform-specific values,
// and is something the user should change anyhow, so, let's just throw this value // and is something the user should change anyhow, so, let's just throw this value
// out. // out.
if (strcmp(CurrentFindCVar, "mouse_sensitivity") == 0) if (CurrentFindCVar.Compare("mouse_sensitivity") == 0)
break; break;
if (strcmp(CurrentFindCVar, "m_noprescale") == 0) if (CurrentFindCVar.Compare("m_noprescale") == 0)
break; break;
} }
@ -132,7 +132,7 @@ void D_GrabCVarDefaults()
SHOULD_BLACKLIST(anonstats_host) SHOULD_BLACKLIST(anonstats_host)
SHOULD_BLACKLIST(sentstats_hwr_done) SHOULD_BLACKLIST(sentstats_hwr_done)
var = FindCVar(CurrentFindCVar, NULL); var = FindCVar(CurrentFindCVar.GetChars(), NULL);
if (blacklisted) if (blacklisted)
{ {

View file

@ -23,6 +23,6 @@
#define SHOULD_BLACKLIST(name) \ #define SHOULD_BLACKLIST(name) \
if (#name[0]==CurrentFindCVar[0]) \ if (#name[0]==CurrentFindCVar[0]) \
if (strcmp(CurrentFindCVar, #name) == 0) \ if (CurrentFindCVar.Compare(#name) == 0) \
blacklisted = true; blacklisted = true;

View file

@ -360,7 +360,7 @@ int FIWadManager::ScanIWAD (const char *iwad)
if (full && strnicmp(full, "maps/", 5) == 0) if (full && strnicmp(full, "maps/", 5) == 0)
{ {
FString mapname(&full[5], strcspn(&full[5], ".")); FString mapname(&full[5], strcspn(&full[5], "."));
CheckFileName(mapname); CheckFileName(mapname.GetChars());
} }
} }
} }
@ -490,7 +490,7 @@ void FIWadManager::AddIWADCandidates(const char *dir)
} }
for (auto &name : mIWadNames) for (auto &name : mIWadNames)
{ {
if (!stricmp(name, entry.FileName.c_str())) if (!name.CompareNoCase(entry.FileName.c_str()))
{ {
mFoundWads.Push(FFoundWadInfo{ entry.FilePath.c_str(), "", -1 }); mFoundWads.Push(FFoundWadInfo{ entry.FilePath.c_str(), "", -1 });
} }
@ -515,14 +515,14 @@ void FIWadManager::ValidateIWADs()
for (auto &p : mFoundWads) for (auto &p : mFoundWads)
{ {
int index; int index;
auto x = strrchr(p.mFullPath, '.'); auto x = strrchr(p.mFullPath.GetChars(), '.');
if (x != nullptr && (!stricmp(x, ".iwad") || !stricmp(x, ".ipk3") || !stricmp(x, ".ipk7"))) if (x != nullptr && (!stricmp(x, ".iwad") || !stricmp(x, ".ipk3") || !stricmp(x, ".ipk7")))
{ {
index = CheckIWADInfo(p.mFullPath); index = CheckIWADInfo(p.mFullPath.GetChars());
} }
else else
{ {
index = ScanIWAD(p.mFullPath); index = ScanIWAD(p.mFullPath.GetChars());
} }
p.mInfoIndex = index; p.mInfoIndex = index;
} }
@ -561,7 +561,7 @@ int FIWadManager::IdentifyVersion (std::vector<std::string>&wadfiles, const char
// Collect all IWADs in the search path // Collect all IWADs in the search path
for (auto &dir : mSearchPaths) for (auto &dir : mSearchPaths)
{ {
AddIWADCandidates(dir); AddIWADCandidates(dir.GetChars());
} }
unsigned numFoundWads = mFoundWads.Size(); unsigned numFoundWads = mFoundWads.Size();
@ -608,7 +608,7 @@ int FIWadManager::IdentifyVersion (std::vector<std::string>&wadfiles, const char
// Check for symbolic links leading to non-existent files and for files that are unreadable. // Check for symbolic links leading to non-existent files and for files that are unreadable.
for (unsigned int i = 0; i < mFoundWads.Size(); i++) for (unsigned int i = 0; i < mFoundWads.Size(); i++)
{ {
if (!FileExists(mFoundWads[i].mFullPath) || !FileReadable(mFoundWads[i].mFullPath)) mFoundWads.Delete(i--); if (!FileExists(mFoundWads[i].mFullPath) || !FileReadable(mFoundWads[i].mFullPath.GetChars())) mFoundWads.Delete(i--);
} }
// Now check if what got collected actually is an IWAD. // Now check if what got collected actually is an IWAD.
@ -729,7 +729,7 @@ int FIWadManager::IdentifyVersion (std::vector<std::string>&wadfiles, const char
for (unsigned i = 0; i < picks.Size(); ++i) for (unsigned i = 0; i < picks.Size(); ++i)
{ {
FString &basename = mIWadInfos[picks[i].mInfoIndex].Name; FString &basename = mIWadInfos[picks[i].mInfoIndex].Name;
if (stricmp(basename, defaultiwad) == 0) if (basename.CompareNoCase(defaultiwad) == 0)
{ {
pick = i; pick = i;
break; break;
@ -745,7 +745,7 @@ int FIWadManager::IdentifyVersion (std::vector<std::string>&wadfiles, const char
{ {
WadStuff stuff; WadStuff stuff;
stuff.Name = mIWadInfos[found.mInfoIndex].Name; stuff.Name = mIWadInfos[found.mInfoIndex].Name;
stuff.Path = ExtractFileBase(found.mFullPath); stuff.Path = ExtractFileBase(found.mFullPath.GetChars());
wads.Push(stuff); wads.Push(stuff);
} }
int flags = 0;; int flags = 0;;
@ -764,7 +764,7 @@ int FIWadManager::IdentifyVersion (std::vector<std::string>&wadfiles, const char
autoloadwidescreen = !!(flags & 8); autoloadwidescreen = !!(flags & 8);
// The newly selected IWAD becomes the new default // The newly selected IWAD becomes the new default
defaultiwad = mIWadInfos[picks[pick].mInfoIndex].Name; defaultiwad = mIWadInfos[picks[pick].mInfoIndex].Name.GetChars();
} }
else else
{ {
@ -789,10 +789,10 @@ int FIWadManager::IdentifyVersion (std::vector<std::string>&wadfiles, const char
fileSystem.SetIwadNum(iwadnum); fileSystem.SetIwadNum(iwadnum);
if (picks[pick].mRequiredPath.IsNotEmpty()) if (picks[pick].mRequiredPath.IsNotEmpty())
{ {
D_AddFile (wadfiles, picks[pick].mRequiredPath, true, -1, GameConfig); D_AddFile (wadfiles, picks[pick].mRequiredPath.GetChars(), true, -1, GameConfig);
iwadnum++; iwadnum++;
} }
D_AddFile (wadfiles, picks[pick].mFullPath, true, -1, GameConfig); D_AddFile (wadfiles, picks[pick].mFullPath.GetChars(), true, -1, GameConfig);
fileSystem.SetMaxIwadNum(iwadnum); fileSystem.SetMaxIwadNum(iwadnum);
auto info = mIWadInfos[picks[pick].mInfoIndex]; auto info = mIWadInfos[picks[pick].mInfoIndex];
@ -813,7 +813,7 @@ int FIWadManager::IdentifyVersion (std::vector<std::string>&wadfiles, const char
path = FString(picks[pick].mFullPath.GetChars(), lastslash + 1); path = FString(picks[pick].mFullPath.GetChars(), lastslash + 1);
} }
path += info.Load[i]; path += info.Load[i];
D_AddFile(wadfiles, path, true, -1, GameConfig); D_AddFile(wadfiles, path.GetChars(), true, -1, GameConfig);
} }
else else
{ {

View file

@ -277,7 +277,7 @@ CUSTOM_CVAR (String, vid_cursor, "None", CVAR_ARCHIVE | CVAR_NOINITCALL)
if (!stricmp(self, "None" ) && gameinfo.CursorPic.IsNotEmpty()) if (!stricmp(self, "None" ) && gameinfo.CursorPic.IsNotEmpty())
{ {
res = I_SetCursor(TexMan.GetGameTextureByName(gameinfo.CursorPic)); res = I_SetCursor(TexMan.GetGameTextureByName(gameinfo.CursorPic.GetChars()));
} }
else else
{ {
@ -1082,7 +1082,7 @@ void D_Display ()
} }
if ( !skip ) if ( !skip )
{ {
auto tex = TexMan.GetGameTextureByName(gameinfo.PauseSign, true); auto tex = TexMan.GetGameTextureByName(gameinfo.PauseSign.GetChars(), true);
double x = (SCREENWIDTH - tex->GetDisplayWidth() * CleanXfac)/2 + double x = (SCREENWIDTH - tex->GetDisplayWidth() * CleanXfac)/2 +
tex->GetDisplayLeftOffset() * CleanXfac; tex->GetDisplayLeftOffset() * CleanXfac;
DrawTexture(twod, tex, x, 4, DTA_CleanNoMove, true, TAG_DONE); DrawTexture(twod, tex, x, 4, DTA_CleanNoMove, true, TAG_DONE);
@ -1093,7 +1093,7 @@ void D_Display ()
pstring.Substitute("%s", players[paused - 1].userinfo.GetName()); pstring.Substitute("%s", players[paused - 1].userinfo.GetName());
DrawText(twod, font, CR_RED, DrawText(twod, font, CR_RED,
(twod->GetWidth() - font->StringWidth(pstring)*CleanXfac) / 2, (twod->GetWidth() - font->StringWidth(pstring)*CleanXfac) / 2,
(tex->GetDisplayHeight() * CleanYfac) + 4, pstring, DTA_CleanNoMove, true, TAG_DONE); (tex->GetDisplayHeight() * CleanYfac) + 4, pstring.GetChars(), DTA_CleanNoMove, true, TAG_DONE);
} }
} }
} }
@ -1515,7 +1515,7 @@ void D_DoAdvanceDemo (void)
gamestate = GS_DEMOSCREEN; gamestate = GS_DEMOSCREEN;
pagename = gameinfo.TitlePage; pagename = gameinfo.TitlePage;
pagetic = (int)(gameinfo.titleTime * TICRATE); pagetic = (int)(gameinfo.titleTime * TICRATE);
if (!playedtitlemusic) S_ChangeMusic (gameinfo.titleMusic, gameinfo.titleOrder, false); if (!playedtitlemusic) S_ChangeMusic (gameinfo.titleMusic.GetChars(), gameinfo.titleOrder, false);
playedtitlemusic = true; playedtitlemusic = true;
demosequence = 3; demosequence = 3;
pagecount = 0; pagecount = 0;
@ -1537,7 +1537,7 @@ void D_DoAdvanceDemo (void)
if (pagename.IsNotEmpty()) if (pagename.IsNotEmpty())
{ {
Page = TexMan.CheckForTexture(pagename, ETextureType::MiscPatch); Page = TexMan.CheckForTexture(pagename.GetChars(), ETextureType::MiscPatch);
} }
} }
@ -1716,7 +1716,7 @@ void ParseCVarInfo()
} }
} }
// Now create the cvar. // Now create the cvar.
cvar = customCVar ? C_CreateZSCustomCVar(cvarname, cvartype, cvarflags, customCVarClassName) : C_CreateCVar(cvarname, cvartype, cvarflags); cvar = customCVar ? C_CreateZSCustomCVar(cvarname.GetChars(), cvartype, cvarflags, customCVarClassName) : C_CreateCVar(cvarname.GetChars(), cvartype, cvarflags);
if (cvardefault != NULL) if (cvardefault != NULL)
{ {
UCVarValue val; UCVarValue val;
@ -1732,7 +1732,7 @@ void ParseCVarInfo()
// clutter up the cvar space when not playing mods with custom cvars. // clutter up the cvar space when not playing mods with custom cvars.
if (addedcvars) if (addedcvars)
{ {
GameConfig->DoModSetup (gameinfo.ConfigName); GameConfig->DoModSetup (gameinfo.ConfigName.GetChars());
} }
} }
@ -1753,8 +1753,8 @@ bool ConsiderPatches (const char *arg)
argc = Args->CheckParmList(arg, &args); argc = Args->CheckParmList(arg, &args);
for (i = 0; i < argc; ++i) for (i = 0; i < argc; ++i)
{ {
if ( (f = BaseFileSearch(args[i], ".deh", false, GameConfig)) || if ( (f = BaseFileSearch(args[i].GetChars(), ".deh", false, GameConfig)) ||
(f = BaseFileSearch(args[i], ".bex", false, GameConfig)) ) (f = BaseFileSearch(args[i].GetChars(), ".bex", false, GameConfig)) )
{ {
D_LoadDehFile(f); D_LoadDehFile(f);
} }
@ -1785,7 +1785,7 @@ static void GetCmdLineFiles(std::vector<std::string>& wadfiles)
argc = Args->CheckParmList("-file", &args); argc = Args->CheckParmList("-file", &args);
for (i = 0; i < argc; ++i) for (i = 0; i < argc; ++i)
{ {
D_AddWildFile(wadfiles, args[i], ".wad", GameConfig); D_AddWildFile(wadfiles, args[i].GetChars(), ".wad", GameConfig);
} }
} }
@ -1830,13 +1830,13 @@ static FString ParseGameInfo(std::vector<std::string> &pwads, const char *fn, co
{ {
checkpath = sc.String; checkpath = sc.String;
} }
if (!DirEntryExists(checkpath, &isDir)) if (!DirEntryExists(checkpath.GetChars(), &isDir))
{ {
pos += D_AddFile(pwads, sc.String, true, pos, GameConfig); pos += D_AddFile(pwads, sc.String, true, pos, GameConfig);
} }
else else
{ {
pos += D_AddFile(pwads, checkpath, true, pos, GameConfig); pos += D_AddFile(pwads, checkpath.GetChars(), true, pos, GameConfig);
} }
} }
while (sc.CheckToken(',')); while (sc.CheckToken(','));
@ -2037,7 +2037,7 @@ static void AddAutoloadFiles(const char *autoname, std::vector<std::string>& all
file = progdir; file = progdir;
#endif #endif
file += "skins"; file += "skins";
D_AddDirectory (allwads, file, "*.wad", GameConfig); D_AddDirectory (allwads, file.GetChars(), "*.wad", GameConfig);
#ifdef __unix__ #ifdef __unix__
file = NicePath("$HOME/" GAME_DIR "/skins"); file = NicePath("$HOME/" GAME_DIR "/skins");
@ -2053,7 +2053,7 @@ static void AddAutoloadFiles(const char *autoname, std::vector<std::string>& all
while ((len = LumpFilterIWAD.IndexOf('.', lastpos+1)) > 0) while ((len = LumpFilterIWAD.IndexOf('.', lastpos+1)) > 0)
{ {
file = LumpFilterIWAD.Left(len) + ".Autoload"; file = LumpFilterIWAD.Left(len) + ".Autoload";
D_AddConfigFiles(allwads, file, "*.wad", GameConfig); D_AddConfigFiles(allwads, file.GetChars(), "*.wad", GameConfig);
lastpos = len; lastpos = len;
} }
} }
@ -2140,7 +2140,7 @@ static void CheckCmdLine()
FString mapvalue = Args->TakeValue("+map"); FString mapvalue = Args->TakeValue("+map");
if (mapvalue.IsNotEmpty()) if (mapvalue.IsNotEmpty())
{ {
if (!P_CheckMapData(mapvalue)) if (!P_CheckMapData(mapvalue.GetChars()))
{ {
Printf ("Can't find map %s\n", mapvalue.GetChars()); Printf ("Can't find map %s\n", mapvalue.GetChars());
} }
@ -2192,9 +2192,8 @@ static void CheckCmdLine()
StartScreen->AppendStatusLine("Respawning..."); StartScreen->AppendStatusLine("Respawning...");
if (autostart) if (autostart)
{ {
FString temp; FStringf temp("Warp to map %s, Skill %d ", startmap.GetChars(), gameskill + 1);
temp.Format ("Warp to map %s, Skill %d ", startmap.GetChars(), gameskill + 1); StartScreen->AppendStatusLine(temp.GetChars());
StartScreen->AppendStatusLine(temp);
} }
} }
@ -3117,15 +3116,15 @@ static int D_InitGame(const FIWADInfo* iwad_info, std::vector<std::string>& allw
FRandom::StaticClearRandom (); FRandom::StaticClearRandom ();
FBaseCVar::DisableCallbacks(); FBaseCVar::DisableCallbacks();
GameConfig->DoGameSetup (gameinfo.ConfigName); GameConfig->DoGameSetup (gameinfo.ConfigName.GetChars());
AddAutoloadFiles(iwad_info->Autoname, allwads); AddAutoloadFiles(iwad_info->Autoname.GetChars(), allwads);
// Process automatically executed files // Process automatically executed files
FExecList *exec; FExecList *exec;
FArgs *execFiles = new FArgs; FArgs *execFiles = new FArgs;
if (!(Args->CheckParm("-noautoexec"))) if (!(Args->CheckParm("-noautoexec")))
GameConfig->AddAutoexec(execFiles, gameinfo.ConfigName); GameConfig->AddAutoexec(execFiles, gameinfo.ConfigName.GetChars());
exec = D_MultiExec(execFiles, NULL); exec = D_MultiExec(execFiles, NULL);
delete execFiles; delete execFiles;
@ -3145,7 +3144,7 @@ static int D_InitGame(const FIWADInfo* iwad_info, std::vector<std::string>& allw
if (!batchrun) Printf ("W_Init: Init WADfiles.\n"); if (!batchrun) Printf ("W_Init: Init WADfiles.\n");
LumpFilterInfo lfi; LumpFilterInfo lfi;
lfi.dotFilter = LumpFilterIWAD; lfi.dotFilter = LumpFilterIWAD.GetChars();
static const struct { int match; const char* name; } blanket[] = static const struct { int match; const char* name; } blanket[] =
{ {
@ -3208,7 +3207,7 @@ static int D_InitGame(const FIWADInfo* iwad_info, std::vector<std::string>& allw
StartScreen = nostartscreen? nullptr : GetGameStartScreen(per_shader_progress > 0 ? max_progress * 10 / 9 : max_progress + 3); StartScreen = nostartscreen? nullptr : GetGameStartScreen(per_shader_progress > 0 ? max_progress * 10 / 9 : max_progress + 3);
GameConfig->DoKeySetup(gameinfo.ConfigName); GameConfig->DoKeySetup(gameinfo.ConfigName.GetChars());
// Now that wads are loaded, define mod-specific cvars. // Now that wads are loaded, define mod-specific cvars.
ParseCVarInfo(); ParseCVarInfo();
@ -3312,7 +3311,7 @@ static int D_InitGame(const FIWADInfo* iwad_info, std::vector<std::string>& allw
}, CheckForHacks, InitBuildTiles); }, CheckForHacks, InitBuildTiles);
PatchTextures(); PatchTextures();
TexAnim.Init(); TexAnim.Init();
C_InitConback(TexMan.CheckForTexture(gameinfo.BorderFlat, ETextureType::Flat), true, 0.25); C_InitConback(TexMan.CheckForTexture(gameinfo.BorderFlat.GetChars(), ETextureType::Flat), true, 0.25);
FixWideStatusBar(); FixWideStatusBar();
@ -3521,7 +3520,7 @@ static int D_InitGame(const FIWADInfo* iwad_info, std::vector<std::string>& allw
{ {
I_FatalError("Cannot find savegame %s", file.GetChars()); I_FatalError("Cannot find savegame %s", file.GetChars());
} }
G_LoadGame(file); G_LoadGame(file.GetChars());
} }
v = Args->CheckValue("-playdemo"); v = Args->CheckValue("-playdemo");
@ -3550,11 +3549,11 @@ static int D_InitGame(const FIWADInfo* iwad_info, std::vector<std::string>& allw
} }
CheckWarpTransMap(startmap, true); CheckWarpTransMap(startmap, true);
if (demorecording) if (demorecording)
G_BeginRecording(startmap); G_BeginRecording(startmap.GetChars());
G_InitNew(startmap, false); G_InitNew(startmap.GetChars(), false);
if (StoredWarp.IsNotEmpty()) if (StoredWarp.IsNotEmpty())
{ {
AddCommandString(StoredWarp); AddCommandString(StoredWarp.GetChars());
StoredWarp = ""; StoredWarp = "";
} }
} }
@ -3670,7 +3669,7 @@ static int D_DoomMain_Internal (void)
FString logfile = Args->TakeValue("+logfile"); FString logfile = Args->TakeValue("+logfile");
if (logfile.IsNotEmpty()) if (logfile.IsNotEmpty())
{ {
execLogfile(logfile); execLogfile(logfile.GetChars());
} }
else if (batchout != NULL && *batchout != 0) else if (batchout != NULL && *batchout != 0)
{ {
@ -3694,7 +3693,7 @@ static int D_DoomMain_Internal (void)
FString optionalwad = BaseFileSearch(OPTIONALWAD, NULL, true, GameConfig); FString optionalwad = BaseFileSearch(OPTIONALWAD, NULL, true, GameConfig);
iwad_man = new FIWadManager(basewad, optionalwad); iwad_man = new FIWadManager(basewad.GetChars(), optionalwad.GetChars());
// Now that we have the IWADINFO, initialize the autoload ini sections. // Now that we have the IWADINFO, initialize the autoload ini sections.
GameConfig->DoAutoloadSetup(iwad_man); GameConfig->DoAutoloadSetup(iwad_man);
@ -3714,7 +3713,7 @@ static int D_DoomMain_Internal (void)
if (iwad_man == NULL) if (iwad_man == NULL)
{ {
iwad_man = new FIWadManager(basewad, optionalwad); iwad_man = new FIWadManager(basewad.GetChars(), optionalwad.GetChars());
} }
// Load zdoom.pk3 alone so that we can get access to the internal gameinfos before // Load zdoom.pk3 alone so that we can get access to the internal gameinfos before
@ -3730,7 +3729,7 @@ static int D_DoomMain_Internal (void)
std::vector<std::string> allwads; std::vector<std::string> allwads;
const FIWADInfo *iwad_info = iwad_man->FindIWAD(allwads, iwad, basewad, optionalwad); const FIWADInfo *iwad_info = iwad_man->FindIWAD(allwads, iwad.GetChars(), basewad.GetChars(), optionalwad.GetChars());
if (!iwad_info) return 0; // user exited the selection popup via cancel button. if (!iwad_info) return 0; // user exited the selection popup via cancel button.
if ((iwad_info->flags & GI_SHAREWARE) && pwads.size() > 0) if ((iwad_info->flags & GI_SHAREWARE) && pwads.size() > 0)
{ {
@ -3955,7 +3954,7 @@ void I_UpdateWindowTitle()
// Strip out any color escape sequences before setting a window title // Strip out any color escape sequences before setting a window title
TArray<char> copy(titlestr.Len() + 1); TArray<char> copy(titlestr.Len() + 1);
const char* srcp = titlestr; const char* srcp = titlestr.GetChars();
char* dstp = copy.Data(); char* dstp = copy.Data();
while (*srcp != 0) while (*srcp != 0)

View file

@ -1535,7 +1535,7 @@ bool DoArbitrate (void *userdata)
netbuffer[1] = (uint8_t)doomcom.ticdup; netbuffer[1] = (uint8_t)doomcom.ticdup;
netbuffer[2] = NetMode; netbuffer[2] = NetMode;
stream = &netbuffer[3]; stream = &netbuffer[3];
WriteString (startmap, &stream); WriteString (startmap.GetChars(), &stream);
WriteLong (rngseed, &stream); WriteLong (rngseed, &stream);
C_WriteCVars (&stream, CVAR_SERVERINFO, true); C_WriteCVars (&stream, CVAR_SERVERINFO, true);
@ -2452,8 +2452,8 @@ void Net_DoCommand (int type, uint8_t **stream, int player)
{ {
// Paths sent over the network will be valid for the system that sent // Paths sent over the network will be valid for the system that sent
// the save command. For other systems, the path needs to be changed. // the save command. For other systems, the path needs to be changed.
FString basename = ExtractFileBase(savegamefile, true); FString basename = ExtractFileBase(savegamefile.GetChars(), true);
savegamefile = G_BuildSaveName (basename); savegamefile = G_BuildSaveName (basename.GetChars());
} }
} }
gameaction = ga_savegame; gameaction = ga_savegame;
@ -2732,7 +2732,7 @@ static void RunScript(uint8_t **stream, AActor *pawn, int snum, int argn, int al
arg[i] = argval; arg[i] = argval;
} }
} }
P_StartScript(pawn->Level, pawn, NULL, snum, primaryLevel->MapName, arg, min<int>(countof(arg), argn), ACS_NET | always); P_StartScript(pawn->Level, pawn, NULL, snum, primaryLevel->MapName.GetChars(), arg, min<int>(countof(arg), argn), ACS_NET | always);
} }
void Net_SkipCommand (int type, uint8_t **stream) void Net_SkipCommand (int type, uint8_t **stream)

View file

@ -1723,7 +1723,7 @@ void FLevelLocals::DoReborn (int playernum, bool freshbot)
if (!multiplayer && !(flags2 & LEVEL2_ALLOWRESPAWN) && !sv_singleplayerrespawn && if (!multiplayer && !(flags2 & LEVEL2_ALLOWRESPAWN) && !sv_singleplayerrespawn &&
!G_SkillProperty(SKILLP_PlayerRespawn)) !G_SkillProperty(SKILLP_PlayerRespawn))
{ {
if (BackupSaveName.Len() > 0 && FileExists (BackupSaveName.GetChars())) if (BackupSaveName.Len() > 0 && FileExists (BackupSaveName))
{ // Load game from the last point it was saved { // Load game from the last point it was saved
savename = BackupSaveName; savename = BackupSaveName;
gameaction = ga_autoloadgame; gameaction = ga_autoloadgame;

View file

@ -154,7 +154,7 @@ static FSoundID DehFindSound(int index,bool mustexist = false)
if (index < 0) return NO_SOUND; if (index < 0) return NO_SOUND;
if (index < (int) SoundMap.Size()) return SoundMap[index]; if (index < (int) SoundMap.Size()) return SoundMap[index];
FStringf name("~dsdhacked/#%d", index); FStringf name("~dsdhacked/#%d", index);
if (dsdhacked && !mustexist) return soundEngine->FindSoundTentative(name); if (dsdhacked && !mustexist) return soundEngine->FindSoundTentative(name.GetChars());
return NO_SOUND; return NO_SOUND;
} }
@ -165,7 +165,7 @@ static void ReplaceSoundName(int index, const char* newname)
if (snd == NO_SOUND) return; if (snd == NO_SOUND) return;
auto sfx = soundEngine->GetWritableSfx(snd); auto sfx = soundEngine->GetWritableSfx(snd);
FStringf dsname("ds%s", newname); FStringf dsname("ds%s", newname);
sfx->lumpnum = fileSystem.CheckNumForName(dsname, FileSys::ns_sounds); sfx->lumpnum = fileSystem.CheckNumForName(dsname.GetChars(), FileSys::ns_sounds);
sfx->bTentative = false; sfx->bTentative = false;
sfx->bRandomHeader = false; sfx->bRandomHeader = false;
sfx->bLoadRAW = false; sfx->bLoadRAW = false;
@ -1118,7 +1118,7 @@ static void SetDehParams(FState *state, int codepointer, VMDisassemblyDumper &di
sfunc->NumArgs = numargs; sfunc->NumArgs = numargs;
sfunc->ImplicitArgs = numargs; sfunc->ImplicitArgs = numargs;
state->SetAction(sfunc); state->SetAction(sfunc);
sfunc->PrintableName = ClassDataAllocator.Strdup(FStringf("Dehacked.%s.%d.%d", MBFCodePointers[codepointer].name.GetChars(), value1, value2)); sfunc->PrintableName = ClassDataAllocator.Strdup(FStringf("Dehacked.%s.%d.%d", MBFCodePointers[codepointer].name.GetChars(), value1, value2).GetChars());
disasmdump.Write(sfunc, sfunc->PrintableName); disasmdump.Write(sfunc, sfunc->PrintableName);
@ -2939,7 +2939,7 @@ static int PatchSoundNames (int dummy)
{ {
stripwhite(Line2); stripwhite(Line2);
FString newname = skipwhite (Line2); FString newname = skipwhite (Line2);
ReplaceSoundName((int)strtoll(Line1, nullptr, 10), newname); ReplaceSoundName((int)strtoll(Line1, nullptr, 10), newname.GetChars());
DPrintf (DMSG_SPAMMY, "Sound %d set to:\n%s\n", Line1, newname.GetChars()); DPrintf (DMSG_SPAMMY, "Sound %d set to:\n%s\n", Line1, newname.GetChars());
} }
@ -2972,7 +2972,7 @@ static int PatchSpriteNames (int dummy)
OrgSprNames[o] = nulname; OrgSprNames[o] = nulname;
} }
} }
int v = GetSpriteIndex(newname); int v = GetSpriteIndex(newname.GetChars());
memcpy(OrgSprNames[line1val].c, sprites[v].name, 5); memcpy(OrgSprNames[line1val].c, sprites[v].name, 5);
DPrintf (DMSG_SPAMMY, "Sprite %d set to:\n%s\n", Line1, newname.GetChars()); DPrintf (DMSG_SPAMMY, "Sprite %d set to:\n%s\n", Line1, newname.GetChars());
@ -3028,15 +3028,15 @@ static int DoInclude (int dummy)
// Try looking for the included file in the same directory // Try looking for the included file in the same directory
// as the patch before looking in the current file. // as the patch before looking in the current file.
const char *lastSlash = strrchr(savepatchname, '/'); const char *lastSlash = strrchr(savepatchname.GetChars(), '/');
char *path = data; char *path = data;
if (lastSlash != NULL) if (lastSlash != NULL)
{ {
size_t pathlen = lastSlash - savepatchname + strlen (data) + 2; size_t pathlen = lastSlash - savepatchname.GetChars() + strlen (data) + 2;
path = new char[pathlen]; path = new char[pathlen];
strncpy (path, savepatchname, (lastSlash - savepatchname) + 1); strncpy (path, savepatchname.GetChars(), (lastSlash - savepatchname.GetChars()) + 1);
strcpy (path + (lastSlash - savepatchname) + 1, data); strcpy (path + (lastSlash - savepatchname.GetChars()) + 1, data);
if (!FileExists (path)) if (!FileExists (path))
{ {
delete[] path; delete[] path;
@ -3171,7 +3171,7 @@ bool D_LoadDehFile(const char *patchfile)
// some WAD may need it. Should be deleted if it can // some WAD may need it. Should be deleted if it can
// be confirmed that nothing uses this case. // be confirmed that nothing uses this case.
FString filebase(ExtractFileBase(patchfile)); FString filebase(ExtractFileBase(patchfile));
lumpnum = fileSystem.CheckNumForName(filebase); lumpnum = fileSystem.CheckNumForName(filebase.GetChars());
} }
if (lumpnum >= 0) if (lumpnum >= 0)
{ {

View file

@ -376,7 +376,7 @@ void FDecalLib::ParseDecal (FScanner &sc)
sc.MustGetString (); sc.MustGetString ();
if (sc.Compare ("}")) if (sc.Compare ("}"))
{ {
AddDecal (decalName, decalNum, newdecal); AddDecal(decalName.GetChars(), decalNum, newdecal);
break; break;
} }
switch (sc.MustMatchString (DecalKeywords)) switch (sc.MustMatchString (DecalKeywords))
@ -577,7 +577,7 @@ void FDecalLib::ParseFader (FScanner &sc)
sc.MustGetString (); sc.MustGetString ();
if (sc.Compare ("}")) if (sc.Compare ("}"))
{ {
FDecalFaderAnim *fader = new FDecalFaderAnim (faderName); FDecalFaderAnim *fader = new FDecalFaderAnim (faderName.GetChars());
fader->DecayStart = startTime; fader->DecayStart = startTime;
fader->DecayTime = decayTime; fader->DecayTime = decayTime;
Animators.Push (fader); Animators.Push (fader);
@ -617,7 +617,7 @@ void FDecalLib::ParseStretcher (FScanner &sc)
{ {
if (goalX >= 0 || goalY >= 0) if (goalX >= 0 || goalY >= 0)
{ {
FDecalStretcherAnim *stretcher = new FDecalStretcherAnim (stretcherName); FDecalStretcherAnim *stretcher = new FDecalStretcherAnim (stretcherName.GetChars());
stretcher->StretchStart = startTime; stretcher->StretchStart = startTime;
stretcher->StretchTime = takeTime; stretcher->StretchTime = takeTime;
stretcher->GoalX = goalX; stretcher->GoalX = goalX;
@ -668,7 +668,7 @@ void FDecalLib::ParseSlider (FScanner &sc)
{ {
if ((/*distX |*/ distY) != 0) if ((/*distX |*/ distY) != 0)
{ {
FDecalSliderAnim *slider = new FDecalSliderAnim (sliderName); FDecalSliderAnim *slider = new FDecalSliderAnim (sliderName.GetChars());
slider->SlideStart = startTime; slider->SlideStart = startTime;
slider->SlideTime = takeTime; slider->SlideTime = takeTime;
/*slider->DistX = distX;*/ /*slider->DistX = distX;*/
@ -719,7 +719,7 @@ void FDecalLib::ParseColorchanger (FScanner &sc)
sc.MustGetString (); sc.MustGetString ();
if (sc.Compare ("}")) if (sc.Compare ("}"))
{ {
FDecalColorerAnim *fader = new FDecalColorerAnim (faderName); FDecalColorerAnim *fader = new FDecalColorerAnim (faderName.GetChars());
fader->DecayStart = startTime; fader->DecayStart = startTime;
fader->DecayTime = decayTime; fader->DecayTime = decayTime;
fader->GoalColor = goal; fader->GoalColor = goal;
@ -772,7 +772,7 @@ void FDecalLib::ParseCombiner (FScanner &sc)
if (last > first) if (last > first)
{ {
FDecalCombinerAnim *combiner = new FDecalCombinerAnim (combinerName); FDecalCombinerAnim *combiner = new FDecalCombinerAnim (combinerName.GetChars());
combiner->FirstAnimator = (int)first; combiner->FirstAnimator = (int)first;
combiner->NumAnimators = (int)(last - first); combiner->NumAnimators = (int)(last - first);
Animators.Push (combiner); Animators.Push (combiner);

View file

@ -230,7 +230,7 @@ static int ParseStandardProperty(FScanner &scanner, UMapEntry *mape)
if (split.Size() > 1) if (split.Size() > 1)
{ {
epi.mEpisodeName = strbin1(split[1]); epi.mEpisodeName = strbin1(split[1].GetChars());
} }
if (split.Size() > 2 && split[2].IsNotEmpty()) if (split.Size() > 2 && split[2].IsNotEmpty())
{ {
@ -389,7 +389,7 @@ void CommitUMapinfo(level_info_t *defaultinfo)
{ {
for (auto &map : Maps) for (auto &map : Maps)
{ {
auto levelinfo = FindLevelInfo(map.MapName, false); auto levelinfo = FindLevelInfo(map.MapName.GetChars(), false);
if (levelinfo == nullptr) if (levelinfo == nullptr)
{ {
// Map did not exist yet. // Map did not exist yet.

View file

@ -212,6 +212,10 @@ private:
void Spawn3DFloors (); void Spawn3DFloors ();
void SetTexture(side_t *side, int position, const char *name, FMissingTextureTracker &track); void SetTexture(side_t *side, int position, const char *name, FMissingTextureTracker &track);
void SetTexture(side_t* side, int position, const FString& name, FMissingTextureTracker& track)
{
SetTexture(side, position, name.GetChars(), track);
}
void SetTexture(sector_t *sector, int index, int position, const char *name, FMissingTextureTracker &track, bool truncate); void SetTexture(sector_t *sector, int index, int position, const char *name, FMissingTextureTracker &track, bool truncate);
void SetTexture(side_t *side, int position, uint32_t *blend, const char *name); void SetTexture(side_t *side, int position, uint32_t *blend, const char *name);
void SetTextureNoErr(side_t *side, int position, uint32_t *color, const char *name, bool *validcolor, bool isFog); void SetTextureNoErr(side_t *side, int position, uint32_t *color, const char *name, bool *validcolor, bool isFog);

View file

@ -279,7 +279,7 @@ const char *UDMFParserBase::CheckString(FName key)
{ {
sc.ScriptMessage("String value expected for key '%s'", key.GetChars()); sc.ScriptMessage("String value expected for key '%s'", key.GetChars());
} }
return parsedString; return parsedString.GetChars();
} }
//=========================================================================== //===========================================================================

View file

@ -221,7 +221,7 @@ bool M_SetSpecialMenu(FName& menu, int param)
NewGameStartupInfo.Skill = param; NewGameStartupInfo.Skill = param;
LastSkill = param; LastSkill = param;
const char *msg = AllSkills[param].MustConfirmText; const char *msg = AllSkills[param].MustConfirmText.GetChars();
if (*msg==0) msg = GStrings("NIGHTMARE"); if (*msg==0) msg = GStrings("NIGHTMARE");
M_StartMessage (msg, 0, NAME_StartgameConfirmed); M_StartMessage (msg, 0, NAME_StartgameConfirmed);
return false; return false;
@ -287,7 +287,7 @@ bool M_SetSpecialMenu(FName& menu, int param)
{ {
if ((*desc)->mNetgameMessage.IsNotEmpty() && netgame && !demoplayback) if ((*desc)->mNetgameMessage.IsNotEmpty() && netgame && !demoplayback)
{ {
M_StartMessage((*desc)->mNetgameMessage, 1); M_StartMessage((*desc)->mNetgameMessage.GetChars(), 1);
return false; return false;
} }
} }
@ -389,7 +389,7 @@ CCMD (menu_quit)
const size_t messageindex = static_cast<size_t>(gametic) % gameinfo.quitmessages.Size(); const size_t messageindex = static_cast<size_t>(gametic) % gameinfo.quitmessages.Size();
FString EndString; FString EndString;
const char *msg = gameinfo.quitmessages[messageindex]; const char *msg = gameinfo.quitmessages[messageindex].GetChars();
if (msg[0] == '$') if (msg[0] == '$')
{ {
if (msg[1] == '*') if (msg[1] == '*')

View file

@ -559,7 +559,7 @@ void FParser::SF_Include(void)
{ {
if(t_argv[0].type == svt_string) if(t_argv[0].type == svt_string)
{ {
strncpy(tempstr, t_argv[0].string, 8); strncpy(tempstr, t_argv[0].string.GetChars(), 8);
tempstr[8]=0; tempstr[8]=0;
} }
else else
@ -1869,7 +1869,7 @@ void FParser::SF_FloorTexture(void)
if(t_argc > 1) if(t_argc > 1)
{ {
int i = -1; int i = -1;
FTextureID picnum = TexMan.GetTextureID(t_argv[1].string, ETextureType::Flat, FTextureManager::TEXMAN_Overridable); FTextureID picnum = TexMan.GetTextureID(t_argv[1].string.GetChars(), ETextureType::Flat, FTextureManager::TEXMAN_Overridable);
// set all sectors with tag // set all sectors with tag
auto itr = Level->GetSectorTagIterator(tagnum); auto itr = Level->GetSectorTagIterator(tagnum);
@ -1959,7 +1959,7 @@ void FParser::SF_CeilingTexture(void)
if(t_argc > 1) if(t_argc > 1)
{ {
int i = -1; int i = -1;
FTextureID picnum = TexMan.GetTextureID(t_argv[1].string, ETextureType::Flat, FTextureManager::TEXMAN_Overridable); FTextureID picnum = TexMan.GetTextureID(t_argv[1].string.GetChars(), ETextureType::Flat, FTextureManager::TEXMAN_Overridable);
// set all sectors with tag // set all sectors with tag
auto itr = Level->GetSectorTagIterator(tagnum); auto itr = Level->GetSectorTagIterator(tagnum);
@ -2229,7 +2229,7 @@ void FParser::SF_SetLineTexture(void)
} }
else // and an improved legacy version else // and an improved legacy version
{ {
FTextureID picnum = TexMan.GetTextureID(t_argv[1].string, ETextureType::Wall, FTextureManager::TEXMAN_Overridable); FTextureID picnum = TexMan.GetTextureID(t_argv[1].string.GetChars(), ETextureType::Wall, FTextureManager::TEXMAN_Overridable);
side = !!intvalue(t_argv[2]); side = !!intvalue(t_argv[2]);
int sections = intvalue(t_argv[3]); int sections = intvalue(t_argv[3]);

View file

@ -137,7 +137,7 @@ void FScriptLoader::ParseInfoCmd(char *line, FString &scriptsrc)
sc.MustGetString(); sc.MustGetString();
if (!FS_ChangeMusic(sc.String)) if (!FS_ChangeMusic(sc.String))
{ {
S_ChangeMusic(Level->Music, Level->musicorder); S_ChangeMusic(Level->Music.GetChars(), Level->musicorder);
} }
} }
else if (sc.Compare("skyname")) else if (sc.Compare("skyname"))

View file

@ -167,7 +167,7 @@ void FParser::OPcmp(svalue_t &result, int start, int n, int stop)
if(left.type == svt_string && right.type == svt_string) if(left.type == svt_string && right.type == svt_string)
{ {
result.value.i = !strcmp(left.string, right.string); result.value.i = !strcmp(left.string.GetChars(), right.string.GetChars());
return; return;
} }

View file

@ -284,7 +284,7 @@ char *DFsScript::ProcessFindChar(char *datap, char find)
Printf(PRINT_BOLD,"Script %d: ':' encountrered in incorrect position!\n",scriptnum); Printf(PRINT_BOLD,"Script %d: ':' encountrered in incorrect position!\n",scriptnum);
} }
DFsVariable *newlabel = NewVariable(labelname, svt_label); DFsVariable *newlabel = NewVariable(labelname.GetChars(), svt_label);
newlabel->value.i = MakeIndex(labelptr); newlabel->value.i = MakeIndex(labelptr);
} }

View file

@ -273,7 +273,7 @@ public:
CFsError(const FString &in) CFsError(const FString &in)
{ {
strncpy(msg, in, 2047); strncpy(msg, in.GetChars(), 2047);
msg[2047]=0; msg[2047]=0;
} }
}; };

View file

@ -54,7 +54,7 @@
int intvalue(const svalue_t &v) int intvalue(const svalue_t &v)
{ {
return (v.type == svt_string ? atoi(v.string) : return (v.type == svt_string ? atoi(v.string.GetChars()) :
v.type == svt_fixed ? (int)(v.value.f / 65536.) : v.type == svt_fixed ? (int)(v.value.f / 65536.) :
v.type == svt_mobj ? -1 : v.value.i ); v.type == svt_mobj ? -1 : v.value.i );
} }
@ -68,7 +68,7 @@ int intvalue(const svalue_t &v)
fsfix fixedvalue(const svalue_t &v) fsfix fixedvalue(const svalue_t &v)
{ {
return (v.type == svt_fixed ? v.value.f : return (v.type == svt_fixed ? v.value.f :
v.type == svt_string ? (fsfix)(atof(v.string) * 65536.) : v.type == svt_string ? (fsfix)(atof(v.string.GetChars()) * 65536.) :
v.type == svt_mobj ? -65536 : v.value.i * 65536 ); v.type == svt_mobj ? -65536 : v.value.i * 65536 );
} }
@ -81,7 +81,7 @@ fsfix fixedvalue(const svalue_t &v)
double floatvalue(const svalue_t &v) double floatvalue(const svalue_t &v)
{ {
return return
v.type == svt_string ? atof(v.string) : v.type == svt_string ? atof(v.string.GetChars()) :
v.type == svt_fixed ? v.value.f / 65536. : v.type == svt_fixed ? v.value.f / 65536. :
v.type == svt_mobj ? -1. : (double)v.value.i; v.type == svt_mobj ? -1. : (double)v.value.i;
} }
@ -99,7 +99,7 @@ const char *stringvalue(const svalue_t & v)
switch(v.type) switch(v.type)
{ {
case svt_string: case svt_string:
return v.string; return v.string.GetChars();
case svt_mobj: case svt_mobj:
// return the class name // return the class name
@ -349,7 +349,7 @@ DFsVariable *DFsScript::VariableForName(const char *name)
while(current) while(current)
{ {
if(!strcmp(name, current->Name)) // found it? if(!strcmp(name, current->Name.GetChars())) // found it?
return current; return current;
current = current->next; // check next in chain current = current->next; // check next in chain
} }

View file

@ -80,7 +80,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(_TexMan, SetCameraToTexture, SetCameraToTexture)
static void SetCameraTextureAspectRatio(const FString &texturename, double aspectScale, bool useTextureRatio) static void SetCameraTextureAspectRatio(const FString &texturename, double aspectScale, bool useTextureRatio)
{ {
FTextureID textureid = TexMan.CheckForTexture(texturename, ETextureType::Wall, FTextureManager::TEXMAN_Overridable); FTextureID textureid = TexMan.CheckForTexture(texturename.GetChars(), ETextureType::Wall, FTextureManager::TEXMAN_Overridable);
if (textureid.isValid()) if (textureid.isValid())
{ {
// Only proceed if the texture actually has a canvas. // Only proceed if the texture actually has a canvas.
@ -1026,7 +1026,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(_Sector, SetXOffset, SetXOffset)
static void SetEnvironment(sector_t *self, const FString &env) static void SetEnvironment(sector_t *self, const FString &env)
{ {
self->Level->Zones[self->ZoneNumber].Environment = S_FindEnvironment(env); self->Level->Zones[self->ZoneNumber].Environment = S_FindEnvironment(env.GetChars());
} }
DEFINE_ACTION_FUNCTION_NATIVE(_Sector, SetEnvironment, SetEnvironment) DEFINE_ACTION_FUNCTION_NATIVE(_Sector, SetEnvironment, SetEnvironment)
@ -1723,7 +1723,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(_Sector, SetXOffset, SetXOffset)
// This is needed to convert the strings to char pointers. // This is needed to convert the strings to char pointers.
static void ReplaceTextures(FLevelLocals *self, const FString &from, const FString &to, int flags) static void ReplaceTextures(FLevelLocals *self, const FString &from, const FString &to, int flags)
{ {
self->ReplaceTextures(from, to, flags); self->ReplaceTextures(from.GetChars(), to.GetChars(), flags);
} }
DEFINE_ACTION_FUNCTION_NATIVE(FLevelLocals, ReplaceTextures, ReplaceTextures) DEFINE_ACTION_FUNCTION_NATIVE(FLevelLocals, ReplaceTextures, ReplaceTextures)
@ -1732,7 +1732,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(FLevelLocals, ReplaceTextures, ReplaceTextures)
PARAM_STRING(from); PARAM_STRING(from);
PARAM_STRING(to); PARAM_STRING(to);
PARAM_INT(flags); PARAM_INT(flags);
self->ReplaceTextures(from, to, flags); self->ReplaceTextures(from.GetChars(), to.GetChars(), flags);
return 0; return 0;
} }
@ -2097,7 +2097,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(DBaseStatusBar, Draw, SBar_Draw)
static void SetMugshotState(DBaseStatusBar *self, const FString &statename, bool wait, bool reset) static void SetMugshotState(DBaseStatusBar *self, const FString &statename, bool wait, bool reset)
{ {
self->mugshot.SetState(statename, wait, reset); self->mugshot.SetState(statename.GetChars(), wait, reset);
} }
DEFINE_ACTION_FUNCTION_NATIVE(DBaseStatusBar, SetMugshotState, SetMugshotState) DEFINE_ACTION_FUNCTION_NATIVE(DBaseStatusBar, SetMugshotState, SetMugshotState)
@ -2106,7 +2106,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(DBaseStatusBar, SetMugshotState, SetMugshotState)
PARAM_STRING(statename); PARAM_STRING(statename);
PARAM_BOOL(wait); PARAM_BOOL(wait);
PARAM_BOOL(reset); PARAM_BOOL(reset);
self->mugshot.SetState(statename, wait, reset); self->mugshot.SetState(statename.GetChars(), wait, reset);
return 0; return 0;
} }
@ -2201,7 +2201,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(DBaseStatusBar, ReceivedWeapon, ReceivedWeapon)
static int GetMugshot(DBaseStatusBar *self, int accuracy, int stateflags, const FString &def_face) static int GetMugshot(DBaseStatusBar *self, int accuracy, int stateflags, const FString &def_face)
{ {
auto tex = self->mugshot.GetFace(self->CPlayer, def_face, accuracy, (FMugShot::StateFlags)stateflags); auto tex = self->mugshot.GetFace(self->CPlayer, def_face.GetChars(), accuracy, (FMugShot::StateFlags)stateflags);
return (tex ? tex->GetID().GetIndex() : -1); return (tex ? tex->GetID().GetIndex() : -1);
} }
@ -2614,7 +2614,7 @@ DEFINE_ACTION_FUNCTION(DObject, S_ChangeMusic)
PARAM_INT(order); PARAM_INT(order);
PARAM_BOOL(looping); PARAM_BOOL(looping);
PARAM_BOOL(force); PARAM_BOOL(force);
ACTION_RETURN_BOOL(S_ChangeMusic(music, order, looping, force)); ACTION_RETURN_BOOL(S_ChangeMusic(music.GetChars(), order, looping, force));
} }

View file

@ -650,7 +650,7 @@ void ZCCDoomCompiler::ProcessDefaultProperty(PClassActor *cls, ZCC_PropertyStmt
} }
FPropertyInfo *property = FindProperty(propname); FPropertyInfo *property = FindProperty(propname.GetChars());
if (property != nullptr && property->category != CAT_INFO) if (property != nullptr && property->category != CAT_INFO)
{ {
@ -987,7 +987,7 @@ void ZCCDoomCompiler::CompileStates()
{ {
auto sl = static_cast<ZCC_StateLabel *>(st); auto sl = static_cast<ZCC_StateLabel *>(st);
statename = FName(sl->Label).GetChars(); statename = FName(sl->Label).GetChars();
statedef.AddStateLabel(statename); statedef.AddStateLabel(statename.GetChars());
break; break;
} }
case AST_StateLine: case AST_StateLine:
@ -1046,7 +1046,7 @@ void ZCCDoomCompiler::CompileStates()
auto l = sl->Lights; auto l = sl->Lights;
do do
{ {
AddStateLight(&state, StringConstFromNode(l, c->Type())); AddStateLight(&state, StringConstFromNode(l, c->Type()).GetChars());
l = static_cast<decltype(l)>(l->SiblingNext); l = static_cast<decltype(l)>(l->SiblingNext);
} while (l != sl->Lights); } while (l != sl->Lights);
} }
@ -1097,7 +1097,7 @@ void ZCCDoomCompiler::CompileStates()
statename.AppendFormat("+%d", offset); statename.AppendFormat("+%d", offset);
} }
} }
if (!statedef.SetGotoLabel(statename)) if (!statedef.SetGotoLabel(statename.GetChars()))
{ {
Error(sg, "GOTO before first state"); Error(sg, "GOTO before first state");
} }

View file

@ -20,6 +20,10 @@ inline void S_Sound(int channel, EChanFlags flags, const char* sfxid, float volu
{ {
S_Sound(channel, flags, S_FindSound(sfxid), volume, attenuation); S_Sound(channel, flags, S_FindSound(sfxid), volume, attenuation);
} }
inline void S_Sound(int channel, EChanFlags flags, const FString& sfxid, float volume, float attenuation)
{
S_Sound(channel, flags, S_FindSound(sfxid), volume, attenuation);
}
void S_SoundPitch(int channel, EChanFlags flags, FSoundID sfxid, float volume, float attenuation, float pitch, float startTime = 0.f); void S_SoundPitch(int channel, EChanFlags flags, FSoundID sfxid, float volume, float attenuation, float pitch, float startTime = 0.f);

View file

@ -281,20 +281,20 @@ bool DInterBackground::LoadBackground(bool isenterpic)
if (!isenterpic) tilebackground = false; if (!isenterpic) tilebackground = false;
texture.SetInvalid(); texture.SetInvalid();
level_info_t* li = FindLevelInfo(wbs->current); level_info_t* li = FindLevelInfo(wbs->current.GetChars());
if (li != nullptr) if (li != nullptr)
{ {
exitpic = li->ExitPic; exitpic = li->ExitPic.GetChars();
if (li->ExitPic.IsNotEmpty()) tilebackground = false; if (li->ExitPic.IsNotEmpty()) tilebackground = false;
} }
lumpname = exitpic; lumpname = exitpic;
if (isenterpic) if (isenterpic)
{ {
level_info_t* li = FindLevelInfo(wbs->next); level_info_t* li = FindLevelInfo(wbs->next.GetChars());
if (li != NULL) if (li != NULL)
{ {
lumpname = li->EnterPic; lumpname = li->EnterPic.GetChars();
if (li->EnterPic.IsNotEmpty()) tilebackground = false; if (li->EnterPic.IsNotEmpty()) tilebackground = false;
} }
} }
@ -309,7 +309,7 @@ bool DInterBackground::LoadBackground(bool isenterpic)
case GAME_Doom: case GAME_Doom:
if (!(gameinfo.flags & GI_MAPxx)) if (!(gameinfo.flags & GI_MAPxx))
{ {
const char* levelname = isenterpic ? wbs->next : wbs->current; const char* levelname = isenterpic ? wbs->next.GetChars() : wbs->current.GetChars();
if (IsExMy(levelname)) if (IsExMy(levelname))
{ {
mysnprintf(buffer, countof(buffer), "$IN_EPI%c", levelname[1]); mysnprintf(buffer, countof(buffer), "$IN_EPI%c", levelname[1]);
@ -331,10 +331,10 @@ bool DInterBackground::LoadBackground(bool isenterpic)
if (!(gameinfo.flags & GI_MAPxx)) if (!(gameinfo.flags & GI_MAPxx))
{ {
// not if the last level is not from the first 3 episodes // not if the last level is not from the first 3 episodes
if (!IsExMy(wbs->current)) return false; if (!IsExMy(wbs->current.GetChars())) return false;
// not if the next level is one of the first 3 episodes // not if the next level is one of the first 3 episodes
if (IsExMy(wbs->next)) return false; if (IsExMy(wbs->next.GetChars())) return false;
} }
} }
lumpname = "INTERPIC"; lumpname = "INTERPIC";
@ -345,7 +345,7 @@ bool DInterBackground::LoadBackground(bool isenterpic)
case GAME_Heretic: case GAME_Heretic:
if (isenterpic) if (isenterpic)
{ {
if (IsExMy(wbs->next)) if (IsExMy(wbs->next.GetChars()))
{ {
mysnprintf(buffer, countof(buffer), "$IN_HTC%c", wbs->next[1]); mysnprintf(buffer, countof(buffer), "$IN_HTC%c", wbs->next[1]);
lumpname = buffer; lumpname = buffer;
@ -369,7 +369,7 @@ bool DInterBackground::LoadBackground(bool isenterpic)
default: default:
// Strife doesn't have an intermission pic so choose something neutral. // Strife doesn't have an intermission pic so choose something neutral.
if (isenterpic) return false; if (isenterpic) return false;
lumpname = gameinfo.BorderFlat; lumpname = gameinfo.BorderFlat.GetChars();
tilebackground = true; tilebackground = true;
break; break;
} }
@ -664,38 +664,38 @@ void DInterBackground::drawBackground(int state, bool drawsplat, bool snl_pointe
switch (a->type & ANIM_CONDITION) switch (a->type & ANIM_CONDITION)
{ {
case ANIM_IFVISITED: case ANIM_IFVISITED:
li = FindLevelInfo(a->LevelName); li = FindLevelInfo(a->LevelName.GetChars());
if (li == NULL || !(li->flags & LEVEL_VISITED)) continue; if (li == NULL || !(li->flags & LEVEL_VISITED)) continue;
break; break;
case ANIM_IFNOTVISITED: case ANIM_IFNOTVISITED:
li = FindLevelInfo(a->LevelName); li = FindLevelInfo(a->LevelName.GetChars());
if (li == NULL || (li->flags & LEVEL_VISITED)) continue; if (li == NULL || (li->flags & LEVEL_VISITED)) continue;
break; break;
// StatCount means 'leaving' - everything else means 'entering'! // StatCount means 'leaving' - everything else means 'entering'!
case ANIM_IFENTERING: case ANIM_IFENTERING:
if (state == StatCount || strnicmp(a->LevelName, wbs->next, 8)) continue; if (state == StatCount || a->LevelName.CompareNoCase(wbs->next, 8)) continue;
break; break;
case ANIM_IFNOTENTERING: case ANIM_IFNOTENTERING:
if (state != StatCount && !strnicmp(a->LevelName, wbs->next, 8)) continue; if (state != StatCount && !a->LevelName.CompareNoCase(wbs->next, 8)) continue;
break; break;
case ANIM_IFLEAVING: case ANIM_IFLEAVING:
if (state != StatCount || strnicmp(a->LevelName, wbs->current, 8)) continue; if (state != StatCount || a->LevelName.CompareNoCase(wbs->current, 8)) continue;
break; break;
case ANIM_IFNOTLEAVING: case ANIM_IFNOTLEAVING:
if (state == StatCount && !strnicmp(a->LevelName, wbs->current, 8)) continue; if (state == StatCount && !a->LevelName.CompareNoCase(wbs->current, 8)) continue;
break; break;
case ANIM_IFTRAVELLING: case ANIM_IFTRAVELLING:
if (strnicmp(a->LevelName2, wbs->current, 8) || strnicmp(a->LevelName, wbs->next, 8)) continue; if (a->LevelName2.CompareNoCase(wbs->current, 8) || a->LevelName.CompareNoCase(wbs->next, 8)) continue;
break; break;
case ANIM_IFNOTTRAVELLING: case ANIM_IFNOTTRAVELLING:
if (!strnicmp(a->LevelName2, wbs->current, 8) && !strnicmp(a->LevelName, wbs->next, 8)) continue; if (!a->LevelName2.CompareNoCase(wbs->current, 8) && !a->LevelName.CompareNoCase(wbs->next, 8)) continue;
break; break;
} }
if (a->ctr >= 0) if (a->ctr >= 0)
@ -707,7 +707,7 @@ void DInterBackground::drawBackground(int state, bool drawsplat, bool snl_pointe
{ {
for (i = 0; i<lnodes.Size(); i++) for (i = 0; i<lnodes.Size(); i++)
{ {
level_info_t * li = FindLevelInfo(lnodes[i].Level); level_info_t * li = FindLevelInfo(lnodes[i].Level.GetChars());
if (li && li->flags & LEVEL_VISITED) drawOnLnode(i, &splat, 1, animwidth, animheight); // draw a splat on taken cities. if (li && li->flags & LEVEL_VISITED) drawOnLnode(i, &splat, 1, animwidth, animheight); // draw a splat on taken cities.
} }
} }
@ -715,7 +715,7 @@ void DInterBackground::drawBackground(int state, bool drawsplat, bool snl_pointe
// draw flashing ptr // draw flashing ptr
if (snl_pointeron && yah.Size()) if (snl_pointeron && yah.Size())
{ {
unsigned int v = MapToIndex(wbs->next); unsigned int v = MapToIndex(wbs->next.GetChars());
// Draw only if it points to a valid level on the current screen! // Draw only if it points to a valid level on the current screen!
if (v<lnodes.Size()) drawOnLnode(v, &yah[0], yah.Size(), animwidth, animheight); if (v<lnodes.Size()) drawOnLnode(v, &yah[0], yah.Size(), animwidth, animheight);
} }