MCPcopy Create free account
hub / github.com/ZDoom/Raze / ParseTextureFlags

Method ParseTextureFlags

source/core/g_mapinfo.cpp:592–627  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

590//==========================================================================
591
592void FMapInfoParser::ParseTextureFlags()
593{
594 int num = -1;
595
596 // this block deliberately uses a 'flag = texture, texture...' syntax because it is a lot easier to handle than doing the reverse
597 sc.MustGetStringName("{");
598 while (!sc.CheckString("}"))
599 {
600 // Do not use internal lookup here because this code must be able to gracefully skip the definition if the flag constant does not exist.
601 // This also blocks passing in literal numbers which is quite intentional.
602 sc.MustGetString();
603 FName cname(sc.String, true);
604 auto lookup = cname == NAME_None ? nullptr : sc.LookupSymbol(cname);
605 num = 0;
606 if (lookup) num = int(lookup->Number);
607 else
608 sc.ScriptMessage("'%s': Unknown texture flag", sc.String);
609 ParseAssign();
610 do
611 {
612 sc.MustGetString();
613 // this must also get null textures and ones not yet loaded.
614 auto tex = TexMan.CheckForTexture(sc.String, ETextureType::Any, texlookupflags);
615
616 if (!tex.isValid())
617 {
618 sc.ScriptMessage("textureflags:Unknown texture name '%s'", sc.String);
619 }
620 else
621 {
622 AccessExtInfo(tex).flags |= num;
623 }
624
625 } while (sc.CheckString(","));
626 }
627}
628
629//==========================================================================
630//

Callers

nothing calls this directly

Calls 7

MustGetStringNameMethod · 0.80
MustGetStringMethod · 0.80
LookupSymbolMethod · 0.80
ScriptMessageMethod · 0.80
CheckForTextureMethod · 0.80
CheckStringMethod · 0.45
isValidMethod · 0.45

Tested by

no test coverage detected