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

Function PostProcessLevel

source/core/postprocessor.cpp:60–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58IMPLEMENT_CLASS(DLevelPostProcessor, true, false);
59
60void PostProcessLevel(const uint8_t* md4, const FString& mapname, SpawnSpriteDef& sprites)
61{
62 hw_ClearSplitSector();
63 auto lc = Create<DLevelPostProcessor>();
64 lc->sprites = &sprites;
65
66 char md4string[33];
67 for (int i = 0; i < 16; i++) mysnprintf(md4string + 2 * i, 3, "%02x", md4[i]);
68 FName checksum(md4string, true);
69 if (checksum == NAME_None) return; // we do not have anything so save the work.
70
71 for(auto cls : PClass::AllClasses)
72 {
73 if (cls->IsDescendantOf(RUNTIME_CLASS(DLevelPostProcessor)))
74 {
75 PFunction *const func = dyn_cast<PFunction>(cls->FindSymbol("Apply", false));
76 if (func == nullptr)
77 {
78 Printf("Missing 'Apply' method in class '%s', level compatibility object ignored\n", cls->TypeName.GetChars());
79 continue;
80 }
81
82 auto argTypes = func->Variants[0].Proto->ArgumentTypes;
83 if (argTypes.Size() != 3 || argTypes[1] != TypeName || argTypes[2] != TypeString)
84 {
85 Printf("Wrong signature of 'Apply' method in class '%s', level compatibility object ignored\n", cls->TypeName.GetChars());
86 continue;
87 }
88
89 VMValue param[] = { lc, checksum.GetIndex(), &mapname };
90 VMCall(func->Variants[0].Implementation, param, 3, nullptr, 0);
91 }
92 }
93}
94
95DEFINE_ACTION_FUNCTION(DLevelPostProcessor, SetSpriteLotag)
96{

Callers 2

dbLoadMapFunction · 0.85
loadMapFunction · 0.85

Calls 8

hw_ClearSplitSectorFunction · 0.85
PrintfFunction · 0.85
VMCallFunction · 0.85
IsDescendantOfMethod · 0.80
FindSymbolMethod · 0.45
GetCharsMethod · 0.45
SizeMethod · 0.45
GetIndexMethod · 0.45

Tested by

no test coverage detected