summaryrefslogtreecommitdiffstats
path: root/src/render
diff options
context:
space:
mode:
Diffstat (limited to 'src/render')
-rw-r--r--src/render/Renderer.cpp24
-rw-r--r--src/render/Renderer.h4
-rw-r--r--src/render/Weather.cpp25
-rw-r--r--src/render/Weather.h6
4 files changed, 47 insertions, 12 deletions
diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp
index 562d5882..8322c22a 100644
--- a/src/render/Renderer.cpp
+++ b/src/render/Renderer.cpp
@@ -40,9 +40,9 @@ struct EntityInfo
CLinkList<EntityInfo> &gSortedVehiclesAndPeds = *(CLinkList<EntityInfo>*)0x629AC0;
int32 &CRenderer::ms_nNoOfVisibleEntities = *(int32*)0x940730;
-CEntity **CRenderer::ms_aVisibleEntityPtrs = (CEntity**)0x6E9920;
+CEntity *(&CRenderer::ms_aVisibleEntityPtrs)[NUMVISIBLEENTITIES] = *(CEntity * (*)[NUMVISIBLEENTITIES]) * (uintptr*)0x6E9920;
+CEntity *(&CRenderer::ms_aInVisibleEntityPtrs)[NUMINVISIBLEENTITIES] = *(CEntity * (*)[NUMINVISIBLEENTITIES]) * (uintptr*)0x880B50;
int32 &CRenderer::ms_nNoOfInVisibleEntities = *(int32*)0x8F1B78;
-CEntity **CRenderer::ms_aInVisibleEntityPtrs = (CEntity**)0x880B50;
CVector &CRenderer::ms_vecCameraPosition = *(CVector*)0x8E2C3C;
CVehicle *&CRenderer::m_pFirstPersonVehicle = *(CVehicle**)0x885B80;
@@ -73,9 +73,9 @@ CRenderer::PreRender(void)
for(i = 0; i < ms_nNoOfInVisibleEntities; i++)
ms_aInVisibleEntityPtrs[i]->PreRender();
- for(node = CVisibilityPlugins::m_alphaEntityList.tail.prev;
- node != &CVisibilityPlugins::m_alphaEntityList.head;
- node = node->prev)
+ for(node = CVisibilityPlugins::m_alphaEntityList.head.next;
+ node != &CVisibilityPlugins::m_alphaEntityList.tail;
+ node = node->next)
((CEntity*)node->item.entity)->PreRender();
CHeli::SpecialHeliPreRender();
@@ -983,7 +983,7 @@ CRenderer::ScanSectorList(CPtrList *lists)
dy = ms_vecCameraPosition.y - ent->GetPosition().y;
if(dx > -65.0f && dx < 65.0f &&
dy > -65.0f && dy < 65.0f &&
- ms_nNoOfInVisibleEntities < 150)
+ ms_nNoOfInVisibleEntities < NUMINVISIBLEENTITIES - 1)
ms_aInVisibleEntityPtrs[ms_nNoOfInVisibleEntities++] = ent;
break;
case VIS_STREAMME:
@@ -1033,7 +1033,7 @@ CRenderer::ScanSectorList_Priority(CPtrList *lists)
dy = ms_vecCameraPosition.y - ent->GetPosition().y;
if(dx > -65.0f && dx < 65.0f &&
dy > -65.0f && dy < 65.0f &&
- ms_nNoOfInVisibleEntities < 150)
+ ms_nNoOfInVisibleEntities < NUMINVISIBLEENTITIES - 1)
ms_aInVisibleEntityPtrs[ms_nNoOfInVisibleEntities++] = ent;
break;
case VIS_STREAMME:
@@ -1078,7 +1078,7 @@ CRenderer::ScanSectorList_Subway(CPtrList *lists)
dy = ms_vecCameraPosition.y - ent->GetPosition().y;
if(dx > -65.0f && dx < 65.0f &&
dy > -65.0f && dy < 65.0f &&
- ms_nNoOfInVisibleEntities < 150)
+ ms_nNoOfInVisibleEntities < NUMINVISIBLEENTITIES - 1)
ms_aInVisibleEntityPtrs[ms_nNoOfInVisibleEntities++] = ent;
break;
}
@@ -1160,8 +1160,12 @@ CRenderer::IsEntityCullZoneVisible(CEntity *ent)
return IsVehicleCullZoneVisible(ent);
case ENTITY_TYPE_PED:
ped = (CPed*)ent;
- if(ped->bInVehicle)
- return ped->m_pMyVehicle && IsVehicleCullZoneVisible(ped->m_pMyVehicle);
+ if (ped->bInVehicle) {
+ if (ped->m_pMyVehicle)
+ return IsVehicleCullZoneVisible(ped->m_pMyVehicle);
+ else
+ return true;
+ }
return !(ped->m_pCurSurface && ped->m_pCurSurface->bZoneCulled2);
case ENTITY_TYPE_OBJECT:
obj = (CObject*)ent;
diff --git a/src/render/Renderer.h b/src/render/Renderer.h
index 817cdaae..ea49ed4e 100644
--- a/src/render/Renderer.h
+++ b/src/render/Renderer.h
@@ -19,9 +19,9 @@ class CPtrList;
class CRenderer
{
static int32 &ms_nNoOfVisibleEntities;
- static CEntity **ms_aVisibleEntityPtrs; // [2000];
+ static CEntity *(&ms_aVisibleEntityPtrs)[NUMVISIBLEENTITIES];
static int32 &ms_nNoOfInVisibleEntities;
- static CEntity **ms_aInVisibleEntityPtrs; // [150];
+ static CEntity *(&ms_aInVisibleEntityPtrs)[NUMINVISIBLEENTITIES];
static CVector &ms_vecCameraPosition;
static CVehicle *&m_pFirstPersonVehicle;
diff --git a/src/render/Weather.cpp b/src/render/Weather.cpp
index db1bc80b..479f3404 100644
--- a/src/render/Weather.cpp
+++ b/src/render/Weather.cpp
@@ -27,6 +27,11 @@ float &CWeather::Rainbow = *(float*)0x940598;
bool &CWeather::bScriptsForceRain = *(bool*)0x95CD7D;
bool &CWeather::Stored_StateStored = *(bool*)0x95CDC1;
+float &CWeather::Stored_InterpolationValue = *(float*)0x942F54;
+int16 &CWeather::Stored_OldWeatherType = *(int16*)0x95CC68;
+int16 &CWeather::Stored_NewWeatherType = *(int16*)0x95CCAE;
+float &CWeather::Stored_Rain = *(float*)0x885B4C;
+
WRAPPER void CWeather::RenderRainStreaks(void) { EAXJMP(0x524550); }
WRAPPER void CWeather::Update(void) { EAXJMP(0x522C10); }
@@ -46,3 +51,23 @@ void CWeather::ForceWeatherNow(int16 weather)
NewWeatherType = weather;
ForcedWeatherType = weather;
}
+
+void CWeather::StoreWeatherState()
+{
+ Stored_StateStored = true;
+ Stored_InterpolationValue = InterpolationValue;
+ Stored_Rain = Rain;
+ Stored_NewWeatherType = NewWeatherType;
+ Stored_OldWeatherType = OldWeatherType;
+}
+
+void CWeather::RestoreWeatherState()
+{
+#ifdef FIX_BUGS // it's not used anyway though
+ Stored_StateStored = false;
+#endif
+ InterpolationValue = Stored_InterpolationValue;
+ Rain = Stored_Rain;
+ NewWeatherType = Stored_NewWeatherType;
+ OldWeatherType = Stored_OldWeatherType;
+} \ No newline at end of file
diff --git a/src/render/Weather.h b/src/render/Weather.h
index 41cc5c0e..b5704b01 100644
--- a/src/render/Weather.h
+++ b/src/render/Weather.h
@@ -32,6 +32,10 @@ public:
static bool &bScriptsForceRain;
static bool &Stored_StateStored;
+ static float &Stored_InterpolationValue;
+ static int16 &Stored_OldWeatherType;
+ static int16 &Stored_NewWeatherType;
+ static float &Stored_Rain;
static void RenderRainStreaks(void);
static void Update(void);
@@ -39,4 +43,6 @@ public:
static void ReleaseWeather();
static void ForceWeather(int16);
static void ForceWeatherNow(int16);
+ static void StoreWeatherState();
+ static void RestoreWeatherState();
};