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

Function ParseOptionValue

source/common/menu/menudef.cpp:861–882  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

859//=============================================================================
860
861static void ParseOptionValue(FScanner &sc)
862{
863 FOptionValues *val = new FOptionValues;
864 sc.MustGetString();
865 FName optname = sc.String;
866 sc.MustGetStringName("{");
867 while (!sc.CheckString("}"))
868 {
869 FOptionValues::Pair &pair = val->mValues[val->mValues.Reserve(1)];
870 sc.MustGetFloat();
871 pair.Value = sc.Float;
872 sc.MustGetStringName(",");
873 sc.MustGetString();
874 pair.Text = strbin1(sc.String);
875 }
876 FOptionValues **pOld = OptionValues.CheckKey(optname);
877 if (pOld != nullptr && *pOld != nullptr)
878 {
879 delete *pOld;
880 }
881 OptionValues[optname] = val;
882}
883
884
885//=============================================================================

Callers 1

M_ParseMenuDefsFunction · 0.85

Calls 7

strbin1Function · 0.85
MustGetStringMethod · 0.80
MustGetStringNameMethod · 0.80
ReserveMethod · 0.80
MustGetFloatMethod · 0.80
CheckStringMethod · 0.45
CheckKeyMethod · 0.45

Tested by

no test coverage detected