summaryrefslogtreecommitdiffstats
path: root/src/render
diff options
context:
space:
mode:
Diffstat (limited to 'src/render')
-rw-r--r--src/render/Clouds.cpp12
-rw-r--r--src/render/Clouds.h1
-rw-r--r--src/render/Renderer.cpp7
-rw-r--r--src/render/Renderer.h1
4 files changed, 20 insertions, 1 deletions
diff --git a/src/render/Clouds.cpp b/src/render/Clouds.cpp
index bf572841..d582bff8 100644
--- a/src/render/Clouds.cpp
+++ b/src/render/Clouds.cpp
@@ -41,6 +41,16 @@ CClouds::Init(void)
}
void
+CClouds::Shutdown(void)
+{
+ RwTextureDestroy(gpCloudTex[0]);
+ RwTextureDestroy(gpCloudTex[1]);
+ RwTextureDestroy(gpCloudTex[2]);
+ RwTextureDestroy(gpCloudTex[3]);
+ RwTextureDestroy(gpCloudTex[4]);
+}
+
+void
CClouds::Update(void)
{
float s = sin(TheCamera.Orientation - 0.85f);
@@ -48,7 +58,6 @@ CClouds::Update(void)
IndividualRotation += (CWeather::Wind*CTimer::GetTimeStep() + 0.3f) * 60.0f;
}
-
void
CClouds::Render(void)
{
@@ -424,6 +433,7 @@ CClouds::RenderHorizon(void)
STARTPATCHES
InjectHook(0x4F6C10, CClouds::Init, PATCH_JUMP);
+ InjectHook(0x4F6CA0, CClouds::Shutdown, PATCH_JUMP);
InjectHook(0x4F6CE0, CClouds::Update, PATCH_JUMP);
InjectHook(0x4F6D90, CClouds::Render, PATCH_JUMP);
InjectHook(0x4F7F00, CClouds::RenderBackground, PATCH_JUMP);
diff --git a/src/render/Clouds.h b/src/render/Clouds.h
index 96f04bb1..c8000569 100644
--- a/src/render/Clouds.h
+++ b/src/render/Clouds.h
@@ -12,6 +12,7 @@ public:
static CRGBA &ms_colourBottom;
static void Init(void);
+ static void Shutdown(void);
static void Update(void);
static void Render(void);
static void RenderBackground(int16 topred, int16 topgreen, int16 topblue,
diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp
index 405b9bb2..a6f28443 100644
--- a/src/render/Renderer.cpp
+++ b/src/render/Renderer.cpp
@@ -54,6 +54,12 @@ CRenderer::Init(void)
}
void
+CRenderer::Shutdown(void)
+{
+ gSortedVehiclesAndPeds.Shutdown();
+}
+
+void
CRenderer::PreRender(void)
{
int i;
@@ -1170,6 +1176,7 @@ CRenderer::RemoveVehiclePedLights(CEntity *ent, bool reset)
STARTPATCHES
InjectHook(0x4A7680, CRenderer::Init, PATCH_JUMP);
+ InjectHook(0x4A76A0, CRenderer::Shutdown, PATCH_JUMP);
InjectHook(0x4A7B90, CRenderer::RenderOneRoad, PATCH_JUMP);
InjectHook(0x4A7BA0, CRenderer::RenderOneNonRoad, PATCH_JUMP);
diff --git a/src/render/Renderer.h b/src/render/Renderer.h
index 433035a0..4b96c775 100644
--- a/src/render/Renderer.h
+++ b/src/render/Renderer.h
@@ -27,6 +27,7 @@ public:
static bool &m_loadingPriority;
static void Init(void);
+ static void Shutdown(void);
static void PreRender(void);
static void RenderRoads(void);