diff options
Diffstat (limited to '')
-rw-r--r-- | src/objects/CutsceneHead.cpp | 2 | ||||
-rw-r--r-- | src/objects/CutsceneHead.h | 2 | ||||
-rw-r--r-- | src/objects/CutsceneObject.cpp | 4 | ||||
-rw-r--r-- | src/objects/CutsceneObject.h | 2 | ||||
-rw-r--r-- | src/objects/DummyObject.h | 3 | ||||
-rw-r--r-- | src/objects/Object.cpp | 32 | ||||
-rw-r--r-- | src/objects/Object.h | 46 | ||||
-rw-r--r-- | src/objects/ObjectData.h | 2 | ||||
-rw-r--r-- | src/objects/ParticleObject.cpp | 5 |
9 files changed, 49 insertions, 49 deletions
diff --git a/src/objects/CutsceneHead.cpp b/src/objects/CutsceneHead.cpp index 3ef257d2..0938960e 100644 --- a/src/objects/CutsceneHead.cpp +++ b/src/objects/CutsceneHead.cpp @@ -131,7 +131,7 @@ CCutsceneHead::RenderLimb(int32 bone) RpHAnimHierarchy *hier = GetAnimHierarchyFromSkinClump(m_parentObject->GetClump()); int idx = RpHAnimIDGetIndex(hier, bone); RwMatrix *mats = RpHAnimHierarchyGetMatrixArray(hier); - CPedModelInfo *mi = (CPedModelInfo*)CModelInfo::GetModelInfo(m_modelIndex); + CPedModelInfo *mi = (CPedModelInfo *)CModelInfo::GetModelInfo(GetModelIndex()); switch(bone){ case BONE_Lhand: atomic = mi->getLeftHand(); diff --git a/src/objects/CutsceneHead.h b/src/objects/CutsceneHead.h index 0a70353d..c931eb01 100644 --- a/src/objects/CutsceneHead.h +++ b/src/objects/CutsceneHead.h @@ -24,5 +24,5 @@ public: void PlayAnimation(const char *animName); }; #ifndef PED_SKIN -static_assert(sizeof(CCutsceneHead) == 0x19C, "CCutsceneHead: error"); +VALIDATE_SIZE(CCutsceneHead, 0x19C); #endif diff --git a/src/objects/CutsceneObject.cpp b/src/objects/CutsceneObject.cpp index 7b4ae02b..5c10d37d 100644 --- a/src/objects/CutsceneObject.cpp +++ b/src/objects/CutsceneObject.cpp @@ -15,7 +15,7 @@ CCutsceneObject::CCutsceneObject(void) { - m_status = STATUS_SIMPLE; + SetStatus(STATUS_SIMPLE); bUsesCollision = false; bStreamingDontDelete = true; ObjectCreatedBy = CUTSCENE_OBJECT; @@ -100,7 +100,7 @@ void CCutsceneObject::RenderLimb(int32 bone) { RpAtomic *atomic; - CPedModelInfo *mi = (CPedModelInfo*)CModelInfo::GetModelInfo(m_modelIndex); + CPedModelInfo *mi = (CPedModelInfo *)CModelInfo::GetModelInfo(GetModelIndex()); switch(bone){ case BONE_head: atomic = mi->getHead(); diff --git a/src/objects/CutsceneObject.h b/src/objects/CutsceneObject.h index 9c4036bf..407adcc7 100644 --- a/src/objects/CutsceneObject.h +++ b/src/objects/CutsceneObject.h @@ -29,5 +29,5 @@ public: void RemoveLighting(bool reset); }; #ifndef PED_SKIN -static_assert(sizeof(CCutsceneObject) == 0x198, "CCutsceneObject: error"); +VALIDATE_SIZE(CCutsceneObject, 0x198); #endif diff --git a/src/objects/DummyObject.h b/src/objects/DummyObject.h index d4dce609..d6f88335 100644 --- a/src/objects/DummyObject.h +++ b/src/objects/DummyObject.h @@ -10,4 +10,5 @@ public: CDummyObject(void) {} CDummyObject(CObject *obj); }; -static_assert(sizeof(CDummyObject) == 0x68, "CDummyObject: error"); + +VALIDATE_SIZE(CDummyObject, 0x68); diff --git a/src/objects/Object.cpp b/src/objects/Object.cpp index c0ce38f8..cd2cd688 100644 --- a/src/objects/Object.cpp +++ b/src/objects/Object.cpp @@ -57,7 +57,7 @@ CObject::CObject(int32 mi, bool createRW) CObject::CObject(CDummyObject *dummy) { - SetModelIndexNoCreate(dummy->m_modelIndex); + SetModelIndexNoCreate(dummy->GetModelIndex()); if (dummy->m_rwObject) AttachToRwObject(dummy->m_rwObject); @@ -97,7 +97,7 @@ CObject::ProcessControl(void) m_vecMoveSpeed *= fTimeStep; m_vecTurnSpeed *= fTimeStep; } - if ((m_modelIndex == MI_EXPLODINGBARREL || m_modelIndex == MI_PETROLPUMP) && bHasBeenDamaged && bIsVisible + if ((GetModelIndex() == MI_EXPLODINGBARREL || GetModelIndex() == MI_PETROLPUMP) && bHasBeenDamaged && bIsVisible && (CGeneral::GetRandomNumber() & 0x1F) == 10) { bExplosionProof = true; bIsVisible = false; @@ -125,7 +125,7 @@ CObject::Render(void) if(m_nRefModelIndex != -1 && ObjectCreatedBy == TEMP_OBJECT && bUseVehicleColours){ CVehicleModelInfo *mi = (CVehicleModelInfo*)CModelInfo::GetModelInfo(m_nRefModelIndex); - assert(mi->m_type == MITYPE_VEHICLE); + assert(mi->GetModelType() == MITYPE_VEHICLE); mi->SetVehicleColour(m_colour1, m_colour2); } @@ -159,7 +159,7 @@ CObject::ObjectDamage(float amount) return; static int8 nFrameGen = 0; bool bBodyCastDamageEffect = false; - if (m_modelIndex == MI_BODYCAST){ + if (GetModelIndex() == MI_BODYCAST) { if (amount > 50.0f) nBodyCastHealth = (int16)(nBodyCastHealth - 0.5f * amount); if (nBodyCastHealth < 0) @@ -173,12 +173,12 @@ CObject::ObjectDamage(float amount) const float fDirectionZ = 0.0002f * amount; switch (m_nCollisionDamageEffect) { - case COLDAMAGE_EFFECT_CHANGE_MODEL: + case DAMAGE_EFFECT_CHANGE_MODEL: bRenderDamaged = true; break; - case COLDAMAGE_EFFECT_SPLIT_MODEL: + case DAMAGE_EFFECT_SPLIT_MODEL: break; - case COLDAMAGE_EFFECT_SMASH_COMPLETELY: + case DAMAGE_EFFECT_SMASH_COMPLETELY: bIsVisible = false; bUsesCollision = false; bIsStatic = true; @@ -186,7 +186,7 @@ CObject::ObjectDamage(float amount) SetMoveSpeed(0.0f, 0.0f, 0.0f); SetTurnSpeed(0.0f, 0.0f, 0.0f); break; - case COLDAMAGE_EFFECT_CHANGE_THEN_SMASH: + case DAMAGE_EFFECT_CHANGE_THEN_SMASH: if (!bRenderDamaged) { bRenderDamaged = true; } @@ -199,7 +199,7 @@ CObject::ObjectDamage(float amount) SetTurnSpeed(0.0f, 0.0f, 0.0f); } break; - case COLDAMAGE_EFFECT_SMASH_CARDBOX_COMPLETELY: { + case DAMAGE_EFFECT_SMASH_CARDBOARD_COMPLETELY: { bIsVisible = false; bUsesCollision = false; bIsStatic = true; @@ -222,7 +222,7 @@ CObject::ObjectDamage(float amount) PlayOneShotScriptObject(_SCRSOUND_CARDBOARD_BOX_SMASH, vecPos); break; } - case COLDAMAGE_EFFECT_SMASH_WOODENBOX_COMPLETELY: { + case DAMAGE_EFFECT_SMASH_WOODENBOX_COMPLETELY: { bIsVisible = false; bUsesCollision = false; bIsStatic = true; @@ -245,7 +245,7 @@ CObject::ObjectDamage(float amount) PlayOneShotScriptObject(_SCRSOUND_WOODEN_BOX_SMASH, vecPos); break; } - case COLDAMAGE_EFFECT_SMASH_TRAFFICCONE_COMPLETELY: { + case DAMAGE_EFFECT_SMASH_TRAFFICCONE_COMPLETELY: { bIsVisible = false; bUsesCollision = false; bIsStatic = true; @@ -270,7 +270,7 @@ CObject::ObjectDamage(float amount) PlayOneShotScriptObject(_SCRSOUND_TYRE_BUMP, vecPos); break; } - case COLDAMAGE_EFFECT_SMASH_BARPOST_COMPLETELY: { + case DAMAGE_EFFECT_SMASH_BARPOST_COMPLETELY: { bIsVisible = false; bUsesCollision = false; bIsStatic = true; @@ -309,8 +309,8 @@ CObject::RefModelInfo(int32 modelId) void CObject::Init(void) { - m_type = ENTITY_TYPE_OBJECT;; - CObjectData::SetObjectData(m_modelIndex, *this); + m_type = ENTITY_TYPE_OBJECT; + CObjectData::SetObjectData(GetModelIndex(), *this); m_nEndOfLifeTime = 0; ObjectCreatedBy = GAME_OBJECT; bIsStatic = true; @@ -333,9 +333,9 @@ CObject::Init(void) m_pCurSurface = outEntity; else m_pCurSurface = nil; - if (m_modelIndex == MI_BODYCAST) + if (GetModelIndex() == MI_BODYCAST) nBodyCastHealth = 1000; - else if (m_modelIndex == MI_BUOY) + else if (GetModelIndex() == MI_BUOY) bTouchingWater = true; } diff --git a/src/objects/Object.h b/src/objects/Object.h index 319ec4bc..79589dc9 100644 --- a/src/objects/Object.h +++ b/src/objects/Object.h @@ -10,31 +10,28 @@ enum { CUTSCENE_OBJECT = 4, }; -enum { - COLDAMAGE_EFFECT_NONE = 0, - COLDAMAGE_EFFECT_CHANGE_MODEL = 1, - COLDAMAGE_EFFECT_SPLIT_MODEL = 2, - COLDAMAGE_EFFECT_SMASH_COMPLETELY = 3, - COLDAMAGE_EFFECT_CHANGE_THEN_SMASH = 4, - COLDAMAGE_EFFECT_SMASH_CARDBOX_COMPLETELY = 50, - COLDAMAGE_EFFECT_SMASH_WOODENBOX_COMPLETELY = 60, - COLDAMAGE_EFFECT_SMASH_TRAFFICCONE_COMPLETELY = 70, - COLDAMAGE_EFFECT_SMASH_BARPOST_COMPLETELY = 80, -}; - -enum { +enum CollisionSpecialResponseCase +{ COLLRESPONSE_NONE, - COLLRESPONSE_CHANGE_MODEL, - COLLRESPONSE_SPLIT_MODEL, - COLLRESPONSE_SMASH_COMPLETELY, - COLLRESPONSE_CHANGE_THEN_SMASH, - COLLRESPONSE_UNKNOWN5, - - COLLRESPONSE_SMASH_CARDBOARD_COMPLETELY = 50, - COLLRESPONSE_SMASH_WOODENBOX_COMPLETELY = 60, - COLLRESPONSE_SMASH_TRAFFICCONE_COMPLETELY = 70, - COLLRESPONSE_SMASH_BARPOST_COMPLETELY = 80, + COLLRESPONSE_LAMPOST, + COLLRESPONSE_SMALLBOX, + COLLRESPONSE_BIGBOX, + COLLRESPONSE_FENCEPART, + COLLRESPONSE_UNKNOWN5 +}; +enum CollisionDamageEffect +{ + DAMAGE_EFFECT_NONE, + DAMAGE_EFFECT_CHANGE_MODEL, + DAMAGE_EFFECT_SPLIT_MODEL, + DAMAGE_EFFECT_SMASH_COMPLETELY, + DAMAGE_EFFECT_CHANGE_THEN_SMASH, + + DAMAGE_EFFECT_SMASH_CARDBOARD_COMPLETELY = 50, + DAMAGE_EFFECT_SMASH_WOODENBOX_COMPLETELY = 60, + DAMAGE_EFFECT_SMASH_TRAFFICCONE_COMPLETELY = 70, + DAMAGE_EFFECT_SMASH_BARPOST_COMPLETELY = 80 }; class CVehicle; @@ -100,4 +97,5 @@ public: static void DeleteAllTempObjects(); static void DeleteAllTempObjectsInArea(CVector point, float fRadius); }; -static_assert(sizeof(CObject) == 0x198, "CObject: error"); + +VALIDATE_SIZE(CObject, 0x198); diff --git a/src/objects/ObjectData.h b/src/objects/ObjectData.h index e3a5c1bd..e25c1aeb 100644 --- a/src/objects/ObjectData.h +++ b/src/objects/ObjectData.h @@ -16,7 +16,7 @@ public: uint8 m_nSpecialCollisionResponseCases; bool m_bCameraToAvoidThisObject; }; -static_assert(sizeof(CObjectInfo) == 0x20, "CObjectInfo: error"); +VALIDATE_SIZE(CObjectInfo, 0x20); class CObjectData { diff --git a/src/objects/ParticleObject.cpp b/src/objects/ParticleObject.cpp index 932a0b8a..3dd80546 100644 --- a/src/objects/ParticleObject.cpp +++ b/src/objects/ParticleObject.cpp @@ -7,6 +7,7 @@ #include "Particle.h" #include "Camera.h" #include "Game.h" +#include "DMAudio.h" CParticleObject gPObjectArray[MAX_PARTICLEOBJECTS]; @@ -136,7 +137,7 @@ CParticleObject::AddObject(uint16 type, CVector const &pos, CVector const &targe pobj->m_nState = POBJECTSTATE_UPDATE_CLOSE; pobj->m_Type = (eParticleObjectType)type; - pobj->GetPosition() = pos; + pobj->SetPosition(pos); pobj->m_vecTarget = target; pobj->m_nNumEffectCycles = 1; @@ -1173,7 +1174,7 @@ CParticleObject::LoadParticle(uint8 *buffer, uint32 length) dst->m_nState = POBJECTSTATE_UPDATE_CLOSE; dst->m_Type = src->m_Type; dst->m_ParticleType = src->m_ParticleType; - dst->GetPosition() = src->GetPosition(); + dst->SetPosition(src->GetPosition()); dst->m_vecTarget = src->m_vecTarget; dst->m_nFrameCounter = src->m_nFrameCounter; dst->m_bRemove = src->m_bRemove; |