diff options
author | aap <aap@papnet.eu> | 2019-07-07 13:09:11 +0200 |
---|---|---|
committer | aap <aap@papnet.eu> | 2019-07-07 13:09:11 +0200 |
commit | 53023eb65bdcde43e341c1ecb7cf0c7f8ee524fb (patch) | |
tree | fc65a6c40fa719f9d43be9e0e15be79c490135e0 /src/entities/Object.cpp | |
parent | finished CPhysical (diff) | |
download | re3-53023eb65bdcde43e341c1ecb7cf0c7f8ee524fb.tar re3-53023eb65bdcde43e341c1ecb7cf0c7f8ee524fb.tar.gz re3-53023eb65bdcde43e341c1ecb7cf0c7f8ee524fb.tar.bz2 re3-53023eb65bdcde43e341c1ecb7cf0c7f8ee524fb.tar.lz re3-53023eb65bdcde43e341c1ecb7cf0c7f8ee524fb.tar.xz re3-53023eb65bdcde43e341c1ecb7cf0c7f8ee524fb.tar.zst re3-53023eb65bdcde43e341c1ecb7cf0c7f8ee524fb.zip |
Diffstat (limited to 'src/entities/Object.cpp')
-rw-r--r-- | src/entities/Object.cpp | 93 |
1 files changed, 0 insertions, 93 deletions
diff --git a/src/entities/Object.cpp b/src/entities/Object.cpp deleted file mode 100644 index 6712d77b..00000000 --- a/src/entities/Object.cpp +++ /dev/null @@ -1,93 +0,0 @@ -#include "common.h" -#include "patcher.h" -#include "main.h" -#include "Lights.h" -#include "Pools.h" -#include "Radar.h" -#include "Object.h" - -WRAPPER void CObject::ObjectDamage(float amount) { EAXJMP(0x4BB240); } - -int16 &CObject::nNoTempObjects = *(int16*)0x95CCA2; - -void *CObject::operator new(size_t sz) { return CPools::GetObjectPool()->New(); } -void CObject::operator delete(void *p, size_t sz) { CPools::GetObjectPool()->Delete((CObject*)p); } - -CObject::CObject(void) -{ - m_type = ENTITY_TYPE_OBJECT; - m_fUprootLimit = 0.0f; - m_nCollisionDamageEffect = 0; - m_nSpecialCollisionResponseCases = COLLRESPONSE_NONE; - m_bCameraToAvoidThisObject = false; - ObjectCreatedBy = 0; - m_nEndOfLifeTime = 0; -// m_nRefModelIndex = -1; // duplicate -// bUseVehicleColours = false; // duplicate - m_colour2 = 0; - m_colour1 = m_colour2; - field_172 = 0; - bIsPickup = false; - m_obj_flag2 = false; - m_obj_flag4 = false; - m_obj_flag8 = false; - m_obj_flag10 = false; - bHasBeenDamaged = false; - m_nRefModelIndex = -1; - bUseVehicleColours = false; - m_pCurSurface = nil; - m_pCollidingEntity = nil; -} - -CObject::~CObject(void) -{ - CRadar::ClearBlipForEntity(BLIP_OBJECT, CPools::GetObjectPool()->GetIndex(this)); - - if(m_nRefModelIndex != -1) - CModelInfo::GetModelInfo(m_nRefModelIndex)->RemoveRef(); - - if(ObjectCreatedBy == TEMP_OBJECT && nNoTempObjects != 0) - nNoTempObjects--; -} - -void -CObject::Render(void) -{ - if(m_flagD80) - return; - - if(m_nRefModelIndex != -1 && ObjectCreatedBy == TEMP_OBJECT && bUseVehicleColours){ - CVehicleModelInfo *mi = (CVehicleModelInfo*)CModelInfo::GetModelInfo(m_nRefModelIndex); - assert(mi->m_type == MITYPE_VEHICLE); - mi->SetVehicleColour(m_colour1, m_colour2); - } - - CEntity::Render(); -} - -bool -CObject::SetupLighting(void) -{ - DeActivateDirectional(); - SetAmbientColours(); - - if(bRenderScorched){ - WorldReplaceNormalLightsWithScorched(Scene.world, 0.1f); - return true; - } - return false; -} - -void -CObject::RemoveLighting(bool reset) -{ - if(reset) - WorldReplaceScorchedLightsWithNormal(Scene.world); -} - -WRAPPER void CObject::DeleteAllTempObjectInArea(CVector, float) { EAXJMP(0x4BBED0); } - -STARTPATCHES - InjectHook(0x4BAE00, &CObject::dtor, PATCH_JUMP); - InjectHook(0x4BB1E0, &CObject::Render_, PATCH_JUMP); -ENDPATCHES |