MCPcopy Create free account
hub / github.com/ZDoom/gzdoom / LoadActors

Function LoadActors

src/scripting/thingdef.cpp:448–553  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

446}
447
448void LoadActors()
449{
450 cycle_t timer;
451
452 timer.Reset(); timer.Clock();
453 FScriptPosition::ResetErrorCounter();
454
455 SetDoomCompileEnvironment();
456 InitThingdef();
457 FScriptPosition::StrictErrors = true;
458 ParseScripts();
459
460 FScriptPosition::StrictErrors = strictdecorate;
461 ParseAllDecorate();
462 SynthesizeFlagFields();
463
464 FunctionBuildList.Build();
465
466 if (FScriptPosition::ErrorCounter > 0)
467 {
468 if (FScriptPosition::WarnCounter > 0)
469 {
470 I_Error("%d errors, %d warnings while parsing scripts", FScriptPosition::ErrorCounter, FScriptPosition::WarnCounter);
471 }
472 else
473 {
474 I_Error("%d errors while parsing scripts", FScriptPosition::ErrorCounter);
475 }
476 }
477 else if (FScriptPosition::WarnCounter > 0)
478 {
479 if(warningstoerrors)
480 {
481 I_Error("%d warnings while parsing scripts\n", FScriptPosition::WarnCounter);
482 }
483 else
484 {
485 Printf(TEXTCOLOR_ORANGE "%d warnings while parsing scripts\n", FScriptPosition::WarnCounter);
486 }
487 }
488
489 FScriptPosition::ResetErrorCounter();
490 // AllActorClasses hasn'T been set up yet.
491 for (int i = PClass::AllClasses.Size() - 1; i >= 0; i--)
492 {
493 auto ti = (PClassActor*)PClass::AllClasses[i];
494 if (!ti->IsDescendantOf(RUNTIME_CLASS(AActor))) continue;
495 if (ti->Size == TentativeClass)
496 {
497 if (ti->bOptional)
498 {
499 Printf(TEXTCOLOR_ORANGE "Class %s referenced but not defined\n", ti->TypeName.GetChars());
500 FScriptPosition::WarnCounter++;
501 // the class must be rendered harmless so that it won't cause problems.
502 ti->ParentClass = RUNTIME_CLASS(AActor);
503 ti->Size = sizeof(AActor);
504 }
505 else

Callers 1

StaticInitMethod · 0.85

Calls 15

InitThingdefFunction · 0.85
ParseScriptsFunction · 0.85
ParseAllDecorateFunction · 0.85
SynthesizeFlagFieldsFunction · 0.85
I_ErrorFunction · 0.85
PrintfFunction · 0.85
GetDefaultByTypeFunction · 0.85
CheckStatesFunction · 0.85
CheckForUnsafeStatesFunction · 0.85
CheckDropItemsFunction · 0.85
BuildMethod · 0.80

Tested by

no test coverage detected