mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-24 04:51:19 +00:00
Reduce calling overhead for A_SetUser* functions by making them non-action functions
This commit is contained in:
parent
e83bc53678
commit
c795f29cc4
3 changed files with 18 additions and 11 deletions
|
@ -4604,7 +4604,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetSpecial)
|
|||
//
|
||||
//===========================================================================
|
||||
|
||||
static PField *GetVar(AActor *self, FName varname)
|
||||
static PField *GetVar(DObject *self, FName varname)
|
||||
{
|
||||
PField *var = dyn_cast<PField>(self->GetClass()->Symbols.FindSymbol(varname, true));
|
||||
|
||||
|
@ -4619,7 +4619,8 @@ static PField *GetVar(AActor *self, FName varname)
|
|||
|
||||
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetUserVar)
|
||||
{
|
||||
PARAM_ACTION_PROLOGUE;
|
||||
PARAM_PROLOGUE;
|
||||
PARAM_OBJECT(self, DObject);
|
||||
PARAM_NAME (varname);
|
||||
PARAM_INT (value);
|
||||
|
||||
|
@ -4634,7 +4635,8 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetUserVar)
|
|||
|
||||
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetUserVarFloat)
|
||||
{
|
||||
PARAM_ACTION_PROLOGUE;
|
||||
PARAM_PROLOGUE;
|
||||
PARAM_OBJECT(self, DObject);
|
||||
PARAM_NAME (varname);
|
||||
PARAM_FLOAT (value);
|
||||
|
||||
|
@ -4653,7 +4655,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetUserVarFloat)
|
|||
//
|
||||
//===========================================================================
|
||||
|
||||
static PField *GetArrayVar(AActor *self, FName varname, int pos)
|
||||
static PField *GetArrayVar(DObject *self, FName varname, int pos)
|
||||
{
|
||||
PField *var = dyn_cast<PField>(self->GetClass()->Symbols.FindSymbol(varname, true));
|
||||
|
||||
|
@ -4676,7 +4678,8 @@ static PField *GetArrayVar(AActor *self, FName varname, int pos)
|
|||
|
||||
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetUserArray)
|
||||
{
|
||||
PARAM_ACTION_PROLOGUE;
|
||||
PARAM_PROLOGUE;
|
||||
PARAM_OBJECT(self, DObject);
|
||||
PARAM_NAME (varname);
|
||||
PARAM_INT (pos);
|
||||
PARAM_INT (value);
|
||||
|
@ -4693,7 +4696,8 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetUserArray)
|
|||
|
||||
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetUserArrayFloat)
|
||||
{
|
||||
PARAM_ACTION_PROLOGUE;
|
||||
PARAM_PROLOGUE;
|
||||
PARAM_OBJECT(self, DObject);
|
||||
PARAM_NAME (varname);
|
||||
PARAM_INT (pos);
|
||||
PARAM_FLOAT (value);
|
||||
|
|
|
@ -473,7 +473,7 @@ static void ParseNativeFunction(FScanner &sc, PClassActor *cls)
|
|||
FScriptPosition::ErrorCounter++;
|
||||
}
|
||||
|
||||
// Read the type and make sure it's int or float.
|
||||
// Read the type and make sure it's acceptable.
|
||||
sc.MustGetAnyToken();
|
||||
switch (sc.TokenType)
|
||||
{
|
||||
|
@ -490,6 +490,9 @@ static void ParseNativeFunction(FScanner &sc, PClassActor *cls)
|
|||
rets.Push(TypeState);
|
||||
break;
|
||||
|
||||
case TK_Void:
|
||||
break;
|
||||
|
||||
case TK_Identifier:
|
||||
rets.Push(NewPointer(RUNTIME_CLASS(DObject)));
|
||||
// Todo: Object type
|
||||
|
|
|
@ -274,10 +274,10 @@ ACTOR Actor native //: Thinker
|
|||
action native A_ScaleVelocity(float scale, int ptr = AAPTR_DEFAULT);
|
||||
action native A_ChangeVelocity(float x = 0, float y = 0, float z = 0, int flags = 0, int ptr = AAPTR_DEFAULT);
|
||||
action native A_SetArg(int pos, int value);
|
||||
action native A_SetUserVar(name varname, int value);
|
||||
action native A_SetUserArray(name varname, int index, int value);
|
||||
action native A_SetUserVarFloat(name varname, float value);
|
||||
action native A_SetUserArrayFloat(name varname, int index, float value);
|
||||
native void A_SetUserVar(name varname, int value);
|
||||
native void A_SetUserArray(name varname, int index, int value);
|
||||
native void A_SetUserVarFloat(name varname, float value);
|
||||
native void A_SetUserArrayFloat(name varname, int index, float value);
|
||||
action native A_SetSpecial(int spec, int arg0 = 0, int arg1 = 0, int arg2 = 0, int arg3 = 0, int arg4 = 0);
|
||||
action native A_Quake(int intensity, int duration, int damrad, int tremrad, sound sfx = "world/quake");
|
||||
action native A_QuakeEx(int intensityX, int intensityY, int intensityZ, int duration, int damrad, int tremrad, sound sfx = "world/quake", int flags = 0, float mulWaveX = 1, float mulWaveY = 1, float mulWaveZ = 1, int falloff = 0, int highpoint = 0);
|
||||
|
|
Loading…
Reference in a new issue