summaryrefslogtreecommitdiffstats
path: root/src/entities
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2020-05-11 20:05:01 +0200
committerNikolay Korolev <nickvnuk@gmail.com>2020-05-11 20:05:01 +0200
commit5f5babe7fe1330bfc2a4f420f7531c06d5af4795 (patch)
treec53d63372761cfa31bd56a90a3c5db025c3c35e8 /src/entities
parentgarages + script (diff)
parentCRenderer (diff)
downloadre3-5f5babe7fe1330bfc2a4f420f7531c06d5af4795.tar
re3-5f5babe7fe1330bfc2a4f420f7531c06d5af4795.tar.gz
re3-5f5babe7fe1330bfc2a4f420f7531c06d5af4795.tar.bz2
re3-5f5babe7fe1330bfc2a4f420f7531c06d5af4795.tar.lz
re3-5f5babe7fe1330bfc2a4f420f7531c06d5af4795.tar.xz
re3-5f5babe7fe1330bfc2a4f420f7531c06d5af4795.tar.zst
re3-5f5babe7fe1330bfc2a4f420f7531c06d5af4795.zip
Diffstat (limited to 'src/entities')
-rw-r--r--src/entities/Entity.cpp26
-rw-r--r--src/entities/Entity.h8
2 files changed, 23 insertions, 11 deletions
diff --git a/src/entities/Entity.cpp b/src/entities/Entity.cpp
index e3ecf50f..1e00b129 100644
--- a/src/entities/Entity.cpp
+++ b/src/entities/Entity.cpp
@@ -53,16 +53,16 @@ CEntity::CEntity(void)
bHasBlip = false;
bIsBIGBuilding = false;
bStreamBIGBuilding = false;
- bRenderDamaged = false;
+ bRenderDamaged = false;
bBulletProof = false;
bFireProof = false;
bCollisionProof = false;
bMeleeProof = false;
bOnlyDamagedByPlayer = false;
bStreamingDontDelete = false;
-
bRemoveFromWorld = false;
+
bHasHitWall = false;
bImBeingRendered = false;
bTouchingWater = false;
@@ -70,11 +70,15 @@ CEntity::CEntity(void)
bDrawLast = false;
bNoBrightHeadLights = false;
bDoNotRender = false;
-
bDistanceFade = false;
- m_flagE2 = false;
+ m_flagE1 = false;
+ m_flagE2 = false;
+ bOffscreen = false;
bIsStaticWaitingForCollision = false;
+ m_flagE10 = false;
+ m_flagE20 = false;
+ m_flagE40 = false;
m_scanCode = 0;
m_modelIndex = -1;
@@ -924,6 +928,7 @@ CEntity::AddSteamsFromGround(CPtrList& list)
}
#ifdef COMPATIBLE_SAVES
+// TODO(MIAMI)
void
CEntity::SaveEntityFlags(uint8*& buf)
{
@@ -955,26 +960,27 @@ CEntity::SaveEntityFlags(uint8*& buf)
if (bMeleeProof) tmp |= BIT(27);
if (bOnlyDamagedByPlayer) tmp |= BIT(28);
if (bStreamingDontDelete) tmp |= BIT(29);
+ if (bRemoveFromWorld) tmp |= BIT(0);
+ if (bHasHitWall) tmp |= BIT(1);
WriteSaveBuf<uint32>(buf, tmp);
tmp = 0;
- if (bRemoveFromWorld) tmp |= BIT(0);
- if (bHasHitWall) tmp |= BIT(1);
if (bImBeingRendered) tmp |= BIT(2);
if (bTouchingWater) tmp |= BIT(3);
if (bIsSubway) tmp |= BIT(4);
if (bDrawLast) tmp |= BIT(5);
if (bNoBrightHeadLights) tmp |= BIT(6);
if (bDoNotRender) tmp |= BIT(7);
-
if (bDistanceFade) tmp |= BIT(8);
+
if (m_flagE2) tmp |= BIT(9);
WriteSaveBuf<uint32>(buf, tmp);
}
+// TODO(MIAMI)
void
CEntity::LoadEntityFlags(uint8*& buf)
{
@@ -1006,19 +1012,19 @@ CEntity::LoadEntityFlags(uint8*& buf)
bMeleeProof = !!(tmp & BIT(27));
bOnlyDamagedByPlayer = !!(tmp & BIT(28));
bStreamingDontDelete = !!(tmp & BIT(29));
+ bRemoveFromWorld = !!(tmp & BIT(0));
+ bHasHitWall = !!(tmp & BIT(1));
tmp = ReadSaveBuf<uint32>(buf);
- bRemoveFromWorld = !!(tmp & BIT(0));
- bHasHitWall = !!(tmp & BIT(1));
bImBeingRendered = !!(tmp & BIT(2));
bTouchingWater = !!(tmp & BIT(3));
bIsSubway = !!(tmp & BIT(4));
bDrawLast = !!(tmp & BIT(5));
bNoBrightHeadLights = !!(tmp & BIT(6));
bDoNotRender = !!(tmp & BIT(7));
-
bDistanceFade = !!(tmp & BIT(8));
+
m_flagE2 = !!(tmp & BIT(9));
}
diff --git a/src/entities/Entity.h b/src/entities/Entity.h
index 2e2c64c0..b8f8c80c 100644
--- a/src/entities/Entity.h
+++ b/src/entities/Entity.h
@@ -82,9 +82,13 @@ public:
uint32 bDistanceFade : 1; // Fade entity because it is far away
// flagsE
+ uint32 m_flagE1 : 1;
uint32 m_flagE2 : 1;
- // TODO(MIAMI)
+ uint32 bOffscreen : 1; // offscreen flag. This can only be trusted when it is set to true
uint32 bIsStaticWaitingForCollision : 1; // this is used by script created entities - they are static until the collision is loaded below them
+ uint32 m_flagE10 : 1;
+ uint32 m_flagE20 : 1;
+ uint32 m_flagE40 : 1;
uint16 m_scanCode;
uint16 m_randomSeed;
@@ -151,6 +155,8 @@ public:
bool GetIsOnScreenComplex(void);
bool IsVisible(void) { return m_rwObject && bIsVisible && GetIsOnScreen(); }
bool IsVisibleComplex(void) { return m_rwObject && bIsVisible && GetIsOnScreenComplex(); }
+// TODO(MIAMI):
+ bool IsEntityOccluded(void) { return false; }
int16 GetModelIndex(void) const { return m_modelIndex; }
void UpdateRwFrame(void);
void SetupBigBuilding(void);