mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2025-01-19 05:30:49 +00:00
Add float casts to DECORATE for the sake of completeness
This commit is contained in:
parent
55142078d8
commit
c160121f45
5 changed files with 25 additions and 19 deletions
|
@ -690,4 +690,5 @@ xx(Max_10_Exp)
|
||||||
|
|
||||||
xx(__decorate_internal_int__)
|
xx(__decorate_internal_int__)
|
||||||
xx(__decorate_internal_bool__)
|
xx(__decorate_internal_bool__)
|
||||||
xx(__decorate_internal_state__)
|
xx(__decorate_internal_state__)
|
||||||
|
xx(__decorate_internal_float__)
|
||||||
|
|
|
@ -360,8 +360,12 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, GetGibHealth)
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
//
|
//
|
||||||
// __decorate_internal_state__
|
// __decorate_internal_state__
|
||||||
|
// __decorate_internal_int__
|
||||||
|
// __decorate_internal_bool__
|
||||||
|
// __decorate_internal_float__
|
||||||
//
|
//
|
||||||
// Returns the state passed in.
|
// Placeholders for forcing DECORATE to cast numbers. If actually called,
|
||||||
|
// returns whatever was passed.
|
||||||
//
|
//
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
|
|
||||||
|
@ -373,14 +377,6 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, __decorate_internal_state__)
|
||||||
ACTION_RETURN_STATE(returnme);
|
ACTION_RETURN_STATE(returnme);
|
||||||
}
|
}
|
||||||
|
|
||||||
//===========================================================================
|
|
||||||
//
|
|
||||||
// __decorate_internal_int__
|
|
||||||
//
|
|
||||||
// Returns the int passed in.
|
|
||||||
//
|
|
||||||
//===========================================================================
|
|
||||||
|
|
||||||
DEFINE_ACTION_FUNCTION_PARAMS(AActor, __decorate_internal_int__)
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, __decorate_internal_int__)
|
||||||
{
|
{
|
||||||
PARAM_PROLOGUE;
|
PARAM_PROLOGUE;
|
||||||
|
@ -389,14 +385,6 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, __decorate_internal_int__)
|
||||||
ACTION_RETURN_INT(returnme);
|
ACTION_RETURN_INT(returnme);
|
||||||
}
|
}
|
||||||
|
|
||||||
//===========================================================================
|
|
||||||
//
|
|
||||||
// __decorate_internal_bool__
|
|
||||||
//
|
|
||||||
// Returns the bool passed in.
|
|
||||||
//
|
|
||||||
//===========================================================================
|
|
||||||
|
|
||||||
DEFINE_ACTION_FUNCTION_PARAMS(AActor, __decorate_internal_bool__)
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, __decorate_internal_bool__)
|
||||||
{
|
{
|
||||||
PARAM_PROLOGUE;
|
PARAM_PROLOGUE;
|
||||||
|
@ -405,6 +393,19 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, __decorate_internal_bool__)
|
||||||
ACTION_RETURN_BOOL(returnme);
|
ACTION_RETURN_BOOL(returnme);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, __decorate_internal_float__)
|
||||||
|
{
|
||||||
|
PARAM_PROLOGUE;
|
||||||
|
PARAM_OBJECT(self, AActor);
|
||||||
|
PARAM_FLOAT(returnme);
|
||||||
|
if (numret > 0)
|
||||||
|
{
|
||||||
|
ret->SetFloat(returnme);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
//
|
//
|
||||||
// A_RearrangePointers
|
// A_RearrangePointers
|
||||||
|
|
|
@ -3420,7 +3420,8 @@ bool FxVMFunctionCall::CheckEmitCast(VMFunctionBuilder *build, bool returnit, Ex
|
||||||
FName funcname = Function->SymbolName;
|
FName funcname = Function->SymbolName;
|
||||||
if (funcname == NAME___decorate_internal_int__ ||
|
if (funcname == NAME___decorate_internal_int__ ||
|
||||||
funcname == NAME___decorate_internal_bool__ ||
|
funcname == NAME___decorate_internal_bool__ ||
|
||||||
funcname == NAME___decorate_internal_state__)
|
funcname == NAME___decorate_internal_state__ ||
|
||||||
|
funcname == NAME___decorate_internal_float__)
|
||||||
{
|
{
|
||||||
FxExpression *arg = (*ArgList)[0];
|
FxExpression *arg = (*ArgList)[0];
|
||||||
if (returnit)
|
if (returnit)
|
||||||
|
|
|
@ -711,6 +711,8 @@ FName CheckCastKludges(FName in)
|
||||||
return NAME___decorate_internal_bool__;
|
return NAME___decorate_internal_bool__;
|
||||||
case NAME_State:
|
case NAME_State:
|
||||||
return NAME___decorate_internal_state__;
|
return NAME___decorate_internal_state__;
|
||||||
|
case NAME_Float:
|
||||||
|
return NAME___decorate_internal_float__;
|
||||||
default:
|
default:
|
||||||
return in;
|
return in;
|
||||||
}
|
}
|
||||||
|
|
|
@ -356,4 +356,5 @@ ACTOR Actor native //: Thinker
|
||||||
native state __decorate_internal_state__(state);
|
native state __decorate_internal_state__(state);
|
||||||
native int __decorate_internal_int__(int);
|
native int __decorate_internal_int__(int);
|
||||||
native bool __decorate_internal_bool__(bool);
|
native bool __decorate_internal_bool__(bool);
|
||||||
|
native float __decorate_internal_float__(float);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue