diff options
Diffstat (limited to 'src/entities/Entity.h')
-rw-r--r-- | src/entities/Entity.h | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/src/entities/Entity.h b/src/entities/Entity.h index ee9e6490..eca462cd 100644 --- a/src/entities/Entity.h +++ b/src/entities/Entity.h @@ -6,7 +6,7 @@ struct CReference; class CPtrList; -enum eEntityType +enum eEntityType : uint8 { ENTITY_TYPE_NOTHING = 0, ENTITY_TYPE_BUILDING, @@ -16,7 +16,7 @@ enum eEntityType ENTITY_TYPE_DUMMY, }; -enum eEntityStatus +enum eEntityStatus : uint8 { STATUS_PLAYER, STATUS_PLAYER_PLAYBACKFROMBUFFER, @@ -36,9 +36,11 @@ class CEntity : public CPlaceable { public: RwObject *m_rwObject; +protected: uint32 m_type : 3; +private: uint32 m_status : 5; - +public: // flagsA uint32 bUsesCollision : 1; // does entity use collision uint32 bCollisionProcessed : 1; // has object been processed by a ProcessEntityCollision function @@ -57,7 +59,6 @@ public: uint32 bRenderScorched : 1; uint32 bHasBlip : 1; uint32 bIsBIGBuilding : 1; // Set if this entity is a big building - // VC inserts one more flag here: if drawdist <= 2000 uint32 bRenderDamaged : 1; // use damaged LOD models for objects with applicable damage // flagsC @@ -90,8 +91,19 @@ public: uint16 m_level; // int16 CReference *m_pFirstReference; +public: + eEntityType GetType() const { return (eEntityType)m_type; } + void SetType(eEntityType type) { m_type = type; } + eEntityStatus GetStatus() const { return (eEntityStatus)m_status; } + void SetStatus(eEntityStatus status) { m_status = status; } CColModel *GetColModel(void) { return CModelInfo::GetModelInfo(m_modelIndex)->GetColModel(); } + bool IsStatic(void) { return bIsStatic; } +#ifdef COMPATIBLE_SAVES + void SaveEntityFlags(uint8*& buf); + void LoadEntityFlags(uint8*& buf); +#else uint32* GetAddressOfEntityProperties() { /* AWFUL */ return (uint32*)((char*)&m_rwObject + sizeof(m_rwObject)); } +#endif CEntity(void); ~CEntity(void); @@ -137,7 +149,7 @@ public: bool GetIsOnScreenComplex(void); bool IsVisible(void) { return m_rwObject && bIsVisible && GetIsOnScreen(); } bool IsVisibleComplex(void) { return m_rwObject && bIsVisible && GetIsOnScreenComplex(); } - int GetModelIndex(void) { return m_modelIndex; } + int16 GetModelIndex(void) const { return m_modelIndex; } void UpdateRwFrame(void); void SetupBigBuilding(void); @@ -160,4 +172,5 @@ public: static void AddSteamsFromGround(CPtrList& list); }; -static_assert(sizeof(CEntity) == 0x64, "CEntity: error"); + +VALIDATE_SIZE(CEntity, 0x64); |