mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-28 23:11:58 +00:00
- fixed: The static variant of PClass::FindFunction may only be used for actual static variables.
This commit is contained in:
parent
0e095b0c05
commit
1b07bded47
4 changed files with 10 additions and 3 deletions
|
@ -48,6 +48,7 @@
|
||||||
#include "a_keys.h"
|
#include "a_keys.h"
|
||||||
#include "vm.h"
|
#include "vm.h"
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
|
#include "scriptutil.h"
|
||||||
|
|
||||||
// MACROS ------------------------------------------------------------------
|
// MACROS ------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -255,6 +256,7 @@ void PClass::StaticShutdown ()
|
||||||
{
|
{
|
||||||
*p = nullptr;
|
*p = nullptr;
|
||||||
}
|
}
|
||||||
|
ScriptUtil::Clear();
|
||||||
FunctionPtrList.Clear();
|
FunctionPtrList.Clear();
|
||||||
VMFunction::DeleteAll();
|
VMFunction::DeleteAll();
|
||||||
|
|
||||||
|
|
|
@ -367,8 +367,7 @@ DBaseStatusBar::DBaseStatusBar ()
|
||||||
{
|
{
|
||||||
AltHud = cls->CreateNew();
|
AltHud = cls->CreateNew();
|
||||||
|
|
||||||
VMFunction * func = nullptr;
|
VMFunction * func = PClass::FindFunction(classname, "Init");
|
||||||
PClass::FindFunction(&func, classname, "Init");
|
|
||||||
if (func != nullptr)
|
if (func != nullptr)
|
||||||
{
|
{
|
||||||
VMValue params[] = { AltHud };
|
VMValue params[] = { AltHud };
|
||||||
|
|
|
@ -35,6 +35,11 @@
|
||||||
static TArray<VMValue> parameters;
|
static TArray<VMValue> parameters;
|
||||||
static TMap<FName, VMFunction*> functions;
|
static TMap<FName, VMFunction*> functions;
|
||||||
|
|
||||||
|
void ScriptUtil::Clear()
|
||||||
|
{
|
||||||
|
parameters.Clear();
|
||||||
|
functions.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
void ScriptUtil::BuildParameters(va_list ap)
|
void ScriptUtil::BuildParameters(va_list ap)
|
||||||
{
|
{
|
||||||
|
@ -69,7 +74,7 @@ void ScriptUtil::RunFunction(FName functionname, unsigned paramstart, VMReturn &
|
||||||
auto check = functions.CheckKey(functionname);
|
auto check = functions.CheckKey(functionname);
|
||||||
if (!check)
|
if (!check)
|
||||||
{
|
{
|
||||||
PClass::FindFunction(&func, NAME_ScriptUtil, functionname);
|
func = PClass::FindFunction(NAME_ScriptUtil, functionname);
|
||||||
if (func == nullptr)
|
if (func == nullptr)
|
||||||
{
|
{
|
||||||
I_Error("Call to undefined function ScriptUtil.%s", functionname.GetChars());
|
I_Error("Call to undefined function ScriptUtil.%s", functionname.GetChars());
|
||||||
|
|
|
@ -24,4 +24,5 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
static int Exec(FName functionname, ...);
|
static int Exec(FName functionname, ...);
|
||||||
|
static void Clear();
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue