- added a distancecheck property to AActor that allows a given CVAR to be used as maximum display distance for actors of this type.
This is for WolfenDoom: BOA, which has some scripted sprite distance checks that very negatively affected performance.
This commit is contained in:
parent
e1a683b9ec
commit
3f0ed5d252
4 changed files with 43 additions and 2 deletions
|
|
@ -1523,6 +1523,28 @@ DEFINE_PROPERTY(riplevelmax, I, Actor)
|
|||
defaults->RipLevelMax = id;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
//==========================================================================
|
||||
DEFINE_PROPERTY(distancecheck, S, Actor)
|
||||
{
|
||||
PROP_STRING_PARM(cvar, 0);
|
||||
FBaseCVar *scratch;
|
||||
FBaseCVar *cv = FindCVar(cvar, &scratch);
|
||||
if (cv == NULL)
|
||||
{
|
||||
I_Error("CVar %s not defined", cvar);
|
||||
}
|
||||
else if (cv->GetRealType() == CVAR_Int)
|
||||
{
|
||||
static_cast<PClassActor*>(info)->distancecheck = static_cast<FIntCVar *>(cv);
|
||||
}
|
||||
else
|
||||
{
|
||||
I_Error("CVar %s must of type Int", cvar);
|
||||
}
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// Special inventory properties
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue