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

Function LookupFunction

source/common/cutscenes/screenjob.cpp:85–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83//=============================================================================
84
85VMFunction* LookupFunction(const char* qname, bool validate)
86{
87 size_t p = strcspn(qname, ".");
88 if (p == 0)
89 I_Error("Call to undefined function %s", qname);
90 FName clsname(qname, p, true);
91 FName funcname(qname + p + 1, true);
92
93 auto func = PClass::FindFunction(clsname, funcname);
94 if (func == nullptr)
95 I_Error("Call to undefined function %s", qname);
96 if (validate)
97 {
98 // these conditions must be met by all functions for this interface.
99 if (func->Proto->ReturnTypes.Size() != 0) I_Error("Bad cutscene function %s. Return value not allowed", qname);
100 if (func->ImplicitArgs != 0) I_Error("Bad cutscene function %s. Must be static", qname);
101 }
102 return func;
103}
104
105//=============================================================================
106//

Callers 6

CallCreateMapFunctionFunction · 0.85
ShowScoreboardFunction · 0.85
CallCreateFunctionFunction · 0.85
CreateRunnerFunction · 0.85
AddGenericVideoFunction · 0.85

Calls 3

I_ErrorFunction · 0.85
FindFunctionFunction · 0.85
SizeMethod · 0.45

Tested by

no test coverage detected