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

Method ParseMapHeader

source/core/g_mapinfo.cpp:1341–1379  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1339static MapRecord sink;
1340
1341MapRecord *FMapInfoParser::ParseMapHeader(MapRecord &defaultinfo)
1342{
1343 FString mapname;
1344 MapRecord* map;
1345
1346 if (!CheckLegacyMapDefinition(mapname))
1347 {
1348 ParseLookupName(mapname);
1349 }
1350
1351 if (mapname.IsEmpty())
1352 {
1353 map = &sink; // parse over the entire definition but discard the result.
1354 }
1355 else
1356 {
1357 map = FindMapByName(mapname.GetChars());
1358 if (!map)
1359 {
1360 map = AllocateMap();
1361 *map = defaultinfo;
1362 DefaultExtension(mapname, ".map");
1363 map->SetFileName(mapname.GetChars());
1364 }
1365 }
1366
1367 if (!sc.CheckString("{"))
1368 {
1369 sc.MustGetString();
1370 map->name = sc.String;
1371 }
1372 else
1373 {
1374 if (map != &sink && map->name.IsEmpty()) sc.ScriptError("Missing level name");
1375 sc.UnGet();
1376 }
1377 if (map->levelNumber <= 0) map->levelNumber = GetDefaultLevelNum(map->labelName.GetChars());
1378 return map;
1379}
1380
1381
1382//==========================================================================

Callers

nothing calls this directly

Calls 11

FindMapByNameFunction · 0.85
AllocateMapFunction · 0.85
DefaultExtensionFunction · 0.85
GetDefaultLevelNumFunction · 0.85
SetFileNameMethod · 0.80
MustGetStringMethod · 0.80
UnGetMethod · 0.80
IsEmptyMethod · 0.45
GetCharsMethod · 0.45
CheckStringMethod · 0.45
ScriptErrorMethod · 0.45

Tested by

no test coverage detected