- renamed the file system related classes to actually use the term "FileSystem".
This commit is contained in:
parent
83befa7686
commit
6bccde3b51
103 changed files with 647 additions and 647 deletions
|
|
@ -187,7 +187,7 @@ bool FCompileContext::CheckWritable(int flags)
|
|||
{
|
||||
if (!(flags & VARF_ReadOnly)) return false;
|
||||
if (!(flags & VARF_InternalAccess)) return true;
|
||||
return Wads.GetLumpFile(Lump) != 0;
|
||||
return fileSystem.GetLumpFile(Lump) != 0;
|
||||
}
|
||||
|
||||
FxLocalVariableDeclaration *FCompileContext::FindLocalVariable(FName name)
|
||||
|
|
@ -6141,7 +6141,7 @@ FxExpression *FxIdentifier::Resolve(FCompileContext& ctx)
|
|||
// even if it depends on some deprecated symbol.
|
||||
// The main motivation here is to keep the deprecated static functions accessing the global level variable as they were.
|
||||
// Print these only if debug output is active and at the highest verbosity level.
|
||||
const bool internal = (ctx.Function->Variants[0].Flags & VARF_Deprecated) && Wads.GetLumpFile(ctx.Lump) == 0;
|
||||
const bool internal = (ctx.Function->Variants[0].Flags & VARF_Deprecated) && fileSystem.GetLumpFile(ctx.Lump) == 0;
|
||||
const FString &deprecationMessage = vsym->DeprecationMessage;
|
||||
|
||||
ScriptPosition.Message(internal ? MSG_DEBUGMSG : MSG_WARNING,
|
||||
|
|
|
|||
|
|
@ -1113,7 +1113,7 @@ static PClassActor *ParseActorHeader(FScanner &sc, Baggage *bag)
|
|||
{
|
||||
PClassActor *info = CreateNewActor(sc, typeName, parentName);
|
||||
info->ActorInfo()->DoomEdNum = DoomEdNum > 0 ? DoomEdNum : -1;
|
||||
info->SourceLumpName = Wads.GetLumpFullPath(sc.LumpNum);
|
||||
info->SourceLumpName = fileSystem.GetLumpFullPath(sc.LumpNum);
|
||||
|
||||
if (!info->SetReplacement(replaceName))
|
||||
{
|
||||
|
|
@ -1270,13 +1270,13 @@ void ParseDecorate (FScanner &sc, PNamespace *ns)
|
|||
{
|
||||
sc.MustGetString();
|
||||
// This check needs to remain overridable for testing purposes.
|
||||
if (Wads.GetLumpFile(sc.LumpNum) == 0 && !Args->CheckParm("-allowdecoratecrossincludes"))
|
||||
if (fileSystem.GetLumpFile(sc.LumpNum) == 0 && !Args->CheckParm("-allowdecoratecrossincludes"))
|
||||
{
|
||||
int includefile = Wads.GetLumpFile(Wads.CheckNumForFullName(sc.String, true));
|
||||
int includefile = fileSystem.GetLumpFile(fileSystem.CheckNumForFullName(sc.String, true));
|
||||
if (includefile != 0)
|
||||
{
|
||||
I_FatalError("File %s is overriding core lump %s.",
|
||||
Wads.GetWadFullName(includefile), sc.String);
|
||||
fileSystem.GetWadFullName(includefile), sc.String);
|
||||
}
|
||||
}
|
||||
FScanner newscanner;
|
||||
|
|
@ -1341,7 +1341,7 @@ void ParseAllDecorate()
|
|||
{
|
||||
int lastlump = 0, lump;
|
||||
|
||||
while ((lump = Wads.FindLump("DECORATE", &lastlump)) != -1)
|
||||
while ((lump = fileSystem.FindLump("DECORATE", &lastlump)) != -1)
|
||||
{
|
||||
FScanner sc(lump);
|
||||
auto ns = Namespaces.NewNamespace(sc.LumpNum);
|
||||
|
|
|
|||
|
|
@ -1125,7 +1125,7 @@ static void SetIcon(FTextureID &icon, Baggage &bag, const char *i)
|
|||
// Don't print warnings if the item is for another game or if this is a shareware IWAD.
|
||||
// Strife's teaser doesn't contain all the icon graphics of the full game.
|
||||
if ((bag.Info->ActorInfo()->GameFilter == GAME_Any || bag.Info->ActorInfo()->GameFilter & gameinfo.gametype) &&
|
||||
!(gameinfo.flags&GI_SHAREWARE) && Wads.GetLumpFile(bag.Lumpnum) != 0)
|
||||
!(gameinfo.flags&GI_SHAREWARE) && fileSystem.GetLumpFile(bag.Lumpnum) != 0)
|
||||
{
|
||||
bag.ScriptPosition.Message(MSG_WARNING,
|
||||
"Icon '%s' for '%s' not found\n", i, bag.Info->TypeName.GetChars());
|
||||
|
|
@ -1474,7 +1474,7 @@ DEFINE_CLASS_PROPERTY_PREFIX(player, colorsetfile, ISSI, PlayerPawn)
|
|||
|
||||
FPlayerColorSet color;
|
||||
color.Name = setname;
|
||||
color.Lump = Wads.CheckNumForName(rangefile);
|
||||
color.Lump = fileSystem.CheckNumForName(rangefile);
|
||||
color.RepresentativeColor = representative_color;
|
||||
color.NumExtraRanges = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -687,7 +687,7 @@ void ZCCCompiler::CreateStructTypes()
|
|||
syms = &OutNamespace->Symbols;
|
||||
}
|
||||
|
||||
if (s->NodeName() == NAME__ && Wads.GetLumpFile(Lump) == 0)
|
||||
if (s->NodeName() == NAME__ && fileSystem.GetLumpFile(Lump) == 0)
|
||||
{
|
||||
// This is just a container for syntactic purposes.
|
||||
s->strct->Type = nullptr;
|
||||
|
|
@ -1406,7 +1406,7 @@ bool ZCCCompiler::CompileFields(PContainerType *type, TArray<ZCC_VarDeclarator *
|
|||
ZCC_Latent | ZCC_Final | ZCC_Action | ZCC_Static | ZCC_FuncConst | ZCC_Abstract | ZCC_Virtual | ZCC_Override | ZCC_Extension | ZCC_VirtualScope | ZCC_ClearScope;
|
||||
|
||||
// Some internal fields need to be set to clearscope.
|
||||
if (Wads.GetLumpFile(Lump) == 0) notallowed &= ~ZCC_ClearScope;
|
||||
if (fileSystem.GetLumpFile(Lump) == 0) notallowed &= ~ZCC_ClearScope;
|
||||
|
||||
if (field->Flags & notallowed)
|
||||
{
|
||||
|
|
@ -1617,7 +1617,7 @@ bool ZCCCompiler::CompileProperties(PClass *type, TArray<ZCC_Property *> &Proper
|
|||
TArray<PField *> fields;
|
||||
ZCC_Identifier *id = (ZCC_Identifier *)p->Body;
|
||||
|
||||
if (FName(p->NodeName) == FName("prefix") && Wads.GetLumpFile(Lump) == 0)
|
||||
if (FName(p->NodeName) == FName("prefix") && fileSystem.GetLumpFile(Lump) == 0)
|
||||
{
|
||||
// only for internal definitions: Allow setting a prefix. This is only for compatiblity with the old DECORATE property parser, but not for general use.
|
||||
prefix = id->Id;
|
||||
|
|
@ -1672,7 +1672,7 @@ bool ZCCCompiler::CompileFlagDefs(PClass *type, TArray<ZCC_FlagDef *> &Propertie
|
|||
PField *field;
|
||||
FName referenced = FName(p->RefName);
|
||||
|
||||
if (FName(p->NodeName) == FName("prefix") && Wads.GetLumpFile(Lump) == 0)
|
||||
if (FName(p->NodeName) == FName("prefix") && fileSystem.GetLumpFile(Lump) == 0)
|
||||
{
|
||||
// only for internal definitions: Allow setting a prefix. This is only for compatiblity with the old DECORATE property parser, but not for general use.
|
||||
prefix = referenced;
|
||||
|
|
@ -1840,7 +1840,7 @@ PType *ZCCCompiler::DetermineType(PType *outertype, ZCC_TreeNode *field, FName n
|
|||
case ZCC_NativeType:
|
||||
|
||||
// Creating an instance of a native struct is only allowed for internal definitions of native variables.
|
||||
if (Wads.GetLumpFile(Lump) != 0 || !formember)
|
||||
if (fileSystem.GetLumpFile(Lump) != 0 || !formember)
|
||||
{
|
||||
Error(field, "%s: @ not allowed for user scripts", name.GetChars());
|
||||
}
|
||||
|
|
@ -1896,7 +1896,7 @@ PType *ZCCCompiler::DetermineType(PType *outertype, ZCC_TreeNode *field, FName n
|
|||
auto ftype = DetermineType(outertype, field, name, atype->ElementType, false, true);
|
||||
if (ftype->GetRegType() == REGT_NIL || ftype->GetRegCount() > 1)
|
||||
{
|
||||
if (field->NodeType == AST_VarDeclarator && (static_cast<ZCC_VarDeclarator*>(field)->Flags & ZCC_Native) && Wads.GetLumpFile(Lump) == 0)
|
||||
if (field->NodeType == AST_VarDeclarator && (static_cast<ZCC_VarDeclarator*>(field)->Flags & ZCC_Native) && fileSystem.GetLumpFile(Lump) == 0)
|
||||
{
|
||||
// the internal definitions may declare native arrays to complex types.
|
||||
// As long as they can be mapped to a static array type the VM can handle them, in a limited but sufficient fashion.
|
||||
|
|
|
|||
|
|
@ -245,7 +245,7 @@ static void ParseSingleFile(FScanner *pSC, const char *filename, int lump, void
|
|||
{
|
||||
if (filename != nullptr)
|
||||
{
|
||||
lump = Wads.CheckNumForFullName(filename, true);
|
||||
lump = fileSystem.CheckNumForFullName(filename, true);
|
||||
if (lump >= 0)
|
||||
{
|
||||
lsc.OpenLumpNum(lump);
|
||||
|
|
@ -355,7 +355,7 @@ static void DoParse(int lumpnum)
|
|||
void *parser;
|
||||
ZCCToken value;
|
||||
auto baselump = lumpnum;
|
||||
auto fileno = Wads.GetLumpFile(lumpnum);
|
||||
auto fileno = fileSystem.GetLumpFile(lumpnum);
|
||||
|
||||
parser = ZCCParseAlloc(malloc);
|
||||
ZCCParseState state;
|
||||
|
|
@ -415,18 +415,18 @@ static void DoParse(int lumpnum)
|
|||
ParseSingleFile(&sc, nullptr, lumpnum, parser, state);
|
||||
for (unsigned i = 0; i < Includes.Size(); i++)
|
||||
{
|
||||
lumpnum = Wads.CheckNumForFullName(Includes[i], true);
|
||||
lumpnum = fileSystem.CheckNumForFullName(Includes[i], true);
|
||||
if (lumpnum == -1)
|
||||
{
|
||||
IncludeLocs[i].Message(MSG_ERROR, "Include script lump %s not found", Includes[i].GetChars());
|
||||
}
|
||||
else
|
||||
{
|
||||
auto fileno2 = Wads.GetLumpFile(lumpnum);
|
||||
auto fileno2 = fileSystem.GetLumpFile(lumpnum);
|
||||
if (fileno == 0 && fileno2 != 0)
|
||||
{
|
||||
I_FatalError("File %s is overriding core lump %s.",
|
||||
Wads.GetWadFullName(Wads.GetLumpFile(lumpnum)), Includes[i].GetChars());
|
||||
fileSystem.GetWadFullName(fileSystem.GetLumpFile(lumpnum)), Includes[i].GetChars());
|
||||
}
|
||||
|
||||
ParseSingleFile(nullptr, nullptr, lumpnum, parser, state);
|
||||
|
|
@ -445,7 +445,7 @@ static void DoParse(int lumpnum)
|
|||
// If the parser fails, there is no point starting the compiler, because it'd only flood the output with endless errors.
|
||||
if (FScriptPosition::ErrorCounter > 0)
|
||||
{
|
||||
I_Error("%d errors while parsing %s", FScriptPosition::ErrorCounter, Wads.GetLumpFullPath(baselump).GetChars());
|
||||
I_Error("%d errors while parsing %s", FScriptPosition::ErrorCounter, fileSystem.GetLumpFullPath(baselump).GetChars());
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
|
|
@ -459,7 +459,7 @@ static void DoParse(int lumpnum)
|
|||
if (Args->CheckParm("-dumpast"))
|
||||
{
|
||||
FString ast = ZCC_PrintAST(state.TopNode);
|
||||
FString filename = Wads.GetLumpFullPath(baselump);
|
||||
FString filename = fileSystem.GetLumpFullPath(baselump);
|
||||
filename.ReplaceChars(":\\/?|", '.');
|
||||
filename << ".ast";
|
||||
FileWriter *ff = FileWriter::Open(filename);
|
||||
|
|
@ -471,19 +471,19 @@ static void DoParse(int lumpnum)
|
|||
}
|
||||
|
||||
PSymbolTable symtable;
|
||||
auto newns = Wads.GetLumpFile(baselump) == 0 ? Namespaces.GlobalNamespace : Namespaces.NewNamespace(Wads.GetLumpFile(baselump));
|
||||
auto newns = fileSystem.GetLumpFile(baselump) == 0 ? Namespaces.GlobalNamespace : Namespaces.NewNamespace(fileSystem.GetLumpFile(baselump));
|
||||
ZCCCompiler cc(state, NULL, symtable, newns, baselump, state.ParseVersion);
|
||||
cc.Compile();
|
||||
|
||||
if (FScriptPosition::ErrorCounter > 0)
|
||||
{
|
||||
// Abort if the compiler produced any errors. Also do not compile further lumps, because they very likely miss some stuff.
|
||||
I_Error("%d errors, %d warnings while compiling %s", FScriptPosition::ErrorCounter, FScriptPosition::WarnCounter, Wads.GetLumpFullPath(baselump).GetChars());
|
||||
I_Error("%d errors, %d warnings while compiling %s", FScriptPosition::ErrorCounter, FScriptPosition::WarnCounter, fileSystem.GetLumpFullPath(baselump).GetChars());
|
||||
}
|
||||
else if (FScriptPosition::WarnCounter > 0)
|
||||
{
|
||||
// If we got warnings, but no errors, print the information but continue.
|
||||
Printf(TEXTCOLOR_ORANGE "%d warnings while compiling %s\n", FScriptPosition::WarnCounter, Wads.GetLumpFullPath(baselump).GetChars());
|
||||
Printf(TEXTCOLOR_ORANGE "%d warnings while compiling %s\n", FScriptPosition::WarnCounter, fileSystem.GetLumpFullPath(baselump).GetChars());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -497,7 +497,7 @@ void ParseScripts()
|
|||
int lump, lastlump = 0;
|
||||
FScriptPosition::ResetErrorCounter();
|
||||
|
||||
while ((lump = Wads.FindLump("ZSCRIPT", &lastlump)) != -1)
|
||||
while ((lump = fileSystem.FindLump("ZSCRIPT", &lastlump)) != -1)
|
||||
{
|
||||
DoParse(lump);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue