mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-28 23:11:58 +00:00
- redirect script access to the compatflags CVARs to their internal shadow variables.
This is needed so that MAPINFO settings for these flags don't get ignored.
This commit is contained in:
parent
a312f5a7c1
commit
1fdcacc337
1 changed files with 7 additions and 1 deletions
|
@ -46,6 +46,7 @@
|
|||
#include "codegen.h"
|
||||
#include "v_text.h"
|
||||
#include "w_wad.h"
|
||||
#include "doomstat.h"
|
||||
|
||||
inline PClass *PObjectPointer::PointedClass() const { return static_cast<PClassType*>(PointedType)->Descriptor; }
|
||||
|
||||
|
@ -6855,8 +6856,13 @@ ExpEmit FxCVar::Emit(VMFunctionBuilder *build)
|
|||
|
||||
case CVAR_DummyBool:
|
||||
{
|
||||
int *pVal;
|
||||
auto cv = static_cast<FFlagCVar *>(CVar);
|
||||
build->Emit(OP_LKP, addr.RegNum, build->GetConstantAddress(&cv->ValueVar.Value));
|
||||
auto &vcv = cv->ValueVar;
|
||||
if (vcv == compatflags) pVal = &i_compatflags;
|
||||
else if (vcv == compatflags2) pVal = &ii_compatflags2;
|
||||
else 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);
|
||||
build->Emit(OP_AND_RK, dest.RegNum, dest.RegNum, build->GetConstantInt(1));
|
||||
|
|
Loading…
Reference in a new issue