diff --git a/Runtime/CStateManager.cpp b/Runtime/CStateManager.cpp index 3714915d9..22e3e4f8d 100644 --- a/Runtime/CStateManager.cpp +++ b/Runtime/CStateManager.cpp @@ -477,7 +477,7 @@ void CStateManager::DrawWorld() const int areaCount = 0; CGameArea* areaArr[10]; - for (CGameArea* area = x850_world->x4c_chainHeads[3]; + for (CGameArea* area = x850_world->GetChainHead(EChain::Alive); area != CWorld::AliveAreasEnd() && areaCount != 10; area = area->x130_next) { @@ -671,7 +671,7 @@ void CStateManager::PreRender() proj.setPersp(zeus::SProjPersp{zeus::degToRad(cam->GetFov()), cam->GetAspectRatio(), cam->GetNearClipDistance(), cam->GetFarClipDistance()}); frustum.updatePlanes(x870_cameraManager->GetCurrentCameraTransform(*this), proj); - for (CGameArea* area = x850_world->x4c_chainHeads[3]; + for (CGameArea* area = x850_world->GetChainHead(EChain::Alive); area != CWorld::AliveAreasEnd(); area = area->x130_next) { diff --git a/Runtime/Graphics/CGraphics.cpp b/Runtime/Graphics/CGraphics.cpp index 0d11040e9..76930e192 100644 --- a/Runtime/Graphics/CGraphics.cpp +++ b/Runtime/Graphics/CGraphics.cpp @@ -378,8 +378,9 @@ void CGraphics::FlushProjection() zeus::CVector2i CGraphics::ProjectPoint(const zeus::CVector3f& point) { zeus::CVector3f projPt = GetPerspectiveProjectionMatrix(false).multiplyOneOverW(point); - return {int(projPt.x * g_Viewport.x10_halfWidth) + g_Viewport.x10_halfWidth, - g_Viewport.x14_halfHeight - (int(projPt.y * g_Viewport.x14_halfHeight) + g_Viewport.x14_halfHeight)}; + return {int(projPt.x * g_Viewport.x10_halfWidth) + int(g_Viewport.x10_halfWidth), + int(g_Viewport.x14_halfHeight) - (int(projPt.y * g_Viewport.x14_halfHeight) + + int(g_Viewport.x14_halfHeight))}; } SClipScreenRect CGraphics::ClipScreenRectFromMS(const zeus::CVector3f& p1, diff --git a/Runtime/World/CActorModelParticles.cpp b/Runtime/World/CActorModelParticles.cpp index 70a144a80..cbdda89d8 100644 --- a/Runtime/World/CActorModelParticles.cpp +++ b/Runtime/World/CActorModelParticles.cpp @@ -6,6 +6,7 @@ #include "Particle/CElementGen.hpp" #include "Particle/CParticleElectric.hpp" #include "Particle/CParticleSwoosh.hpp" +#include "Particle/CGenDescription.hpp" #include "World/CWorld.hpp" #include "Graphics/CBooRenderer.hpp" diff --git a/Runtime/World/CScriptAreaAttributes.cpp b/Runtime/World/CScriptAreaAttributes.cpp index faf0f85f6..08445aeab 100644 --- a/Runtime/World/CScriptAreaAttributes.cpp +++ b/Runtime/World/CScriptAreaAttributes.cpp @@ -29,7 +29,7 @@ void CScriptAreaAttributes::Accept(IVisitor& visitor) void CScriptAreaAttributes::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId objId, CStateManager& stateMgr) { - AcceptScriptMsg(msg, objId, stateMgr); + CEntity::AcceptScriptMsg(msg, objId, stateMgr); if (x4_areaId == kInvalidAreaId) return; diff --git a/Runtime/World/CWorld.cpp b/Runtime/World/CWorld.cpp index b4005ccd3..c7dce8fc9 100644 --- a/Runtime/World/CWorld.cpp +++ b/Runtime/World/CWorld.cpp @@ -541,34 +541,24 @@ void CWorld::PropogateAreaChain(CGameArea::EOcclusionState occlusionState, CGame if (occlusionState == CGameArea::EOcclusionState::Occluded) area->SetOcclusionState(CGameArea::EOcclusionState::Occluded); - CGameArea* areaItr = world->x4c_chainHeads[3]; - - while (areaItr != skGlobalNonConstEnd) + for (CGameArea* areaItr = world->GetChainHead(EChain::Alive); + areaItr != skGlobalNonConstEnd; + areaItr = areaItr->x130_next) { if (areaItr == area) - { - areaItr = areaItr->x130_next; continue; - } if (areaItr->IsPostConstructed() && areaItr->GetOcclusionState() == CGameArea::EOcclusionState::Occluded) areaItr->PrepTokens(); - areaItr = areaItr->x130_next; } - areaItr = world->x4c_chainHeads[3]; - - while (areaItr != skGlobalNonConstEnd) + for (CGameArea* areaItr = world->GetChainHead(EChain::Alive); + areaItr != skGlobalNonConstEnd; + areaItr = areaItr->x130_next) { if (areaItr == area) - { - areaItr = areaItr->x130_next; continue; - } - - if (area->IsPostConstructed() && areaItr->GetOcclusionState() == CGameArea::EOcclusionState::NotOccluded) areaItr->PrepTokens(); - areaItr = areaItr->x130_next; } if (occlusionState == CGameArea::EOcclusionState::NotOccluded) @@ -577,7 +567,9 @@ void CWorld::PropogateAreaChain(CGameArea::EOcclusionState occlusionState, CGame void CWorld::PreRender() { - for (CGameArea* head = x4c_chainHeads[3] ; head != skGlobalNonConstEnd ; head = head->x130_next) + for (CGameArea* head = x4c_chainHeads[3] ; + head != skGlobalNonConstEnd ; + head = head->x130_next) { head->PreRender(); }