- moved the combined compatibility flags into FLevelLocals.

This commit is contained in:
Christoph Oelckers 2019-01-29 19:28:22 +01:00
commit 6451b7d592
35 changed files with 162 additions and 97 deletions

View file

@ -6858,9 +6858,7 @@ ExpEmit FxCVar::Emit(VMFunctionBuilder *build)
int *pVal;
auto cv = static_cast<FFlagCVar *>(CVar);
auto vcv = &cv->ValueVar;
if (vcv == &compatflags) pVal = &i_compatflags;
else if (vcv == &compatflags2) pVal = &i_compatflags2;
else pVal = &vcv->Value;
pVal = &vcv->Value;
build->Emit(OP_LKP, addr.RegNum, build->GetConstantAddress(pVal));
build->Emit(OP_LW, dest.RegNum, addr.RegNum, nul);
build->Emit(OP_SRL_RI, dest.RegNum, dest.RegNum, cv->BitNum);

View file

@ -1666,6 +1666,34 @@ DEFINE_ACTION_FUNCTION_NATIVE(AActor, isFrozen, isFrozen)
}
//=====================================================================================
//
// compat flags. These two are the only ones that get checked in script code
// so anything more complex isn't really needed.
//
//=====================================================================================
static int compat_limitpain_(AActor *self)
{
return self->Level->i_compatflags & COMPATF_LIMITPAIN;
}
static int compat_mushroom_(AActor *self)
{
return self->Level->i_compatflags & COMPATF_MUSHROOM;
}
DEFINE_ACTION_FUNCTION_NATIVE(AActor, compat_limitpain, compat_limitpain_)
{
PARAM_SELF_PROLOGUE(AActor);
ACTION_RETURN_INT(compat_limitpain_(self));
}
DEFINE_ACTION_FUNCTION_NATIVE(AActor, compat_mushroom, compat_mushroom_)
{
PARAM_SELF_PROLOGUE(AActor);
ACTION_RETURN_INT(compat_mushroom_(self));
}
//===========================================================================
//
// PlayerPawn functions