summaryrefslogtreecommitdiffstats
path: root/src/render
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2020-04-17 17:08:26 +0200
committerGitHub <noreply@github.com>2020-04-17 17:08:26 +0200
commit1c74d111e8cafa4ad70837725c71f6d478390f01 (patch)
tree818918190bf4403c32137d7348a77e23b643a669 /src/render
parentimplemented CVector2D::NormaliseSafe for SkidMarks (diff)
parentappveyor setup (diff)
downloadre3-1c74d111e8cafa4ad70837725c71f6d478390f01.tar
re3-1c74d111e8cafa4ad70837725c71f6d478390f01.tar.gz
re3-1c74d111e8cafa4ad70837725c71f6d478390f01.tar.bz2
re3-1c74d111e8cafa4ad70837725c71f6d478390f01.tar.lz
re3-1c74d111e8cafa4ad70837725c71f6d478390f01.tar.xz
re3-1c74d111e8cafa4ad70837725c71f6d478390f01.tar.zst
re3-1c74d111e8cafa4ad70837725c71f6d478390f01.zip
Diffstat (limited to 'src/render')
-rw-r--r--src/render/Antennas.cpp16
-rw-r--r--src/render/Clouds.cpp11
-rw-r--r--src/render/Console.cpp2
-rw-r--r--src/render/Coronas.cpp16
-rw-r--r--src/render/Credits.cpp16
-rw-r--r--src/render/Credits.h4
-rw-r--r--src/render/Draw.cpp25
-rw-r--r--src/render/Draw.h16
-rw-r--r--src/render/Fluff.cpp30
-rw-r--r--src/render/Font.cpp57
-rw-r--r--src/render/Font.h11
-rw-r--r--src/render/Glass.cpp25
-rw-r--r--src/render/Hud.cpp95
-rw-r--r--src/render/Instance.cpp13
-rw-r--r--src/render/Lines.cpp2
-rw-r--r--src/render/MBlur.cpp16
-rw-r--r--src/render/MBlur.h6
-rw-r--r--src/render/Particle.cpp33
-rw-r--r--src/render/Particle.h7
-rw-r--r--src/render/ParticleMgr.cpp8
-rw-r--r--src/render/PlayerSkin.cpp11
-rw-r--r--src/render/PointLights.cpp15
-rw-r--r--src/render/PointLights.h4
-rw-r--r--src/render/RenderBuffer.cpp21
-rw-r--r--src/render/RenderBuffer.h12
-rw-r--r--src/render/Renderer.cpp39
-rw-r--r--src/render/Rubbish.cpp2
-rw-r--r--src/render/Shadows.cpp81
-rw-r--r--src/render/Shadows.h30
-rw-r--r--src/render/Skidmarks.cpp2
-rw-r--r--src/render/SpecialFX.cpp31
-rw-r--r--src/render/Sprite.cpp32
-rw-r--r--src/render/Sprite.h8
-rw-r--r--src/render/Sprite2d.cpp36
-rw-r--r--src/render/Timecycle.cpp197
-rw-r--r--src/render/Timecycle.h184
-rw-r--r--src/render/WaterCannon.cpp16
-rw-r--r--src/render/WaterLevel.cpp25
-rw-r--r--src/render/WaterLevel.h2
-rw-r--r--src/render/Weather.cpp60
-rw-r--r--src/render/Weather.h50
41 files changed, 415 insertions, 852 deletions
diff --git a/src/render/Antennas.cpp b/src/render/Antennas.cpp
index d564c196..452069a0 100644
--- a/src/render/Antennas.cpp
+++ b/src/render/Antennas.cpp
@@ -1,5 +1,5 @@
#include "common.h"
-#include "patcher.h"
+
#include "Antennas.h"
CAntenna CAntennas::aAntennas[NUMANTENNAS];
@@ -123,17 +123,3 @@ CAntenna::Update(CVector dir, CVector basepos)
pos[i] = newpos;
}
}
-
-STARTPATCHES
- InjectHook(0x4F64D0, &CAntennas::Init, PATCH_JUMP);
- InjectHook(0x4F6550, &CAntennas::Update, PATCH_JUMP);
- InjectHook(0x4F66C0, &CAntennas::RegisterOne, PATCH_JUMP);
- InjectHook(0x4F6590, &CAntennas::Render, PATCH_JUMP);
- InjectHook(0x4F6830, &CAntenna::Update, PATCH_JUMP);
-
- // give to cheetah for testing
-// Patch<int>(0x535B50+1, 105);
-// Patch<float>(0x535B57+7, -0.84);
-// Patch<float>(0x535B74+7, 0.78);
-// Patch<float>(0x535B69+7, 0.24);
-ENDPATCHES
diff --git a/src/render/Clouds.cpp b/src/render/Clouds.cpp
index 02035896..58dc3f93 100644
--- a/src/render/Clouds.cpp
+++ b/src/render/Clouds.cpp
@@ -1,5 +1,5 @@
#include "common.h"
-#include "patcher.h"
+
#include "Sprite.h"
#include "Sprite2d.h"
#include "General.h"
@@ -430,12 +430,3 @@ CClouds::RenderHorizon(void)
CSprite2d::DrawRect(CRect(0, z1, SCREEN_WIDTH, z2),
ms_colourBottom, ms_colourBottom, ms_colourTop, ms_colourTop);
}
-
-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);
- InjectHook(0x4F85F0, CClouds::RenderHorizon, PATCH_JUMP);
-ENDPATCHES
diff --git a/src/render/Console.cpp b/src/render/Console.cpp
index bfdb2701..5ae5d763 100644
--- a/src/render/Console.cpp
+++ b/src/render/Console.cpp
@@ -1,6 +1,6 @@
#include "common.h"
#include <stdarg.h>
-#include "patcher.h"
+
#include "Console.h"
#include "Font.h"
#include "Timer.h"
diff --git a/src/render/Coronas.cpp b/src/render/Coronas.cpp
index d70f70d6..b21e087b 100644
--- a/src/render/Coronas.cpp
+++ b/src/render/Coronas.cpp
@@ -1,5 +1,5 @@
#include "common.h"
-#include "patcher.h"
+
#include "main.h"
#include "General.h"
#include "TxdStore.h"
@@ -572,17 +572,3 @@ CRegisteredCorona::Update(void)
firstUpdate = false;
registeredThisFrame = false;
}
-
-STARTPATCHES
- InjectHook(0x4F9F90, CCoronas::Init, PATCH_JUMP);
- InjectHook(0x4FA050, CCoronas::Shutdown, PATCH_JUMP);
- InjectHook(0x4F8EC0, CCoronas::Update, PATCH_JUMP);
- InjectHook(0x4FA0E0, (void (*)(uint32, uint8, uint8, uint8, uint8, const CVector&, float, float, RwTexture*, int8, uint8, uint8, uint8, float))CCoronas::RegisterCorona, PATCH_JUMP);
- InjectHook(0x4FA080, (void (*)(uint32, uint8, uint8, uint8, uint8, const CVector&, float, float, uint8, int8, uint8, uint8, uint8, float))CCoronas::RegisterCorona, PATCH_JUMP);
- InjectHook(0x4FA2D0, CCoronas::UpdateCoronaCoors, PATCH_JUMP);
- InjectHook(0x4F8FB0, CCoronas::Render, PATCH_JUMP);
- InjectHook(0x4F9B40, CCoronas::RenderReflections, PATCH_JUMP);
- InjectHook(0x4FA380, CCoronas::DoSunAndMoon, PATCH_JUMP);
-
- InjectHook(0x4F8C40, &CRegisteredCorona::Update, PATCH_JUMP);
-ENDPATCHES
diff --git a/src/render/Credits.cpp b/src/render/Credits.cpp
index b423fcc0..dc0b0252 100644
--- a/src/render/Credits.cpp
+++ b/src/render/Credits.cpp
@@ -1,5 +1,5 @@
#include "common.h"
-#include "patcher.h"
+
#include "Timer.h"
#include "Font.h"
#include "Frontend.h"
@@ -8,8 +8,8 @@
#include "Text.h"
#include "Credits.h"
-bool &CCredits::bCreditsGoing = *(bool*)0x95CDD3;
-uint32 &CCredits::CreditsStartTime = *(uint32*)0x8F2528;
+bool CCredits::bCreditsGoing;
+uint32 CCredits::CreditsStartTime;
void
CCredits::Init(void)
@@ -497,13 +497,3 @@ bool CCredits::AreCreditsDone(void)
{
return !bCreditsGoing;
}
-
-STARTPATCHES
- InjectHook(0x4FE7A0, CCredits::Init, PATCH_JUMP);
- InjectHook(0x4FE760, CCredits::Start, PATCH_JUMP);
- InjectHook(0x4FE780, CCredits::Stop, PATCH_JUMP);
- InjectHook(0x4FE790, CCredits::AreCreditsDone, PATCH_JUMP);
- InjectHook(0x4FADF0, CCredits::Render, PATCH_JUMP);
- InjectHook(0x4FE710, CCredits::PrintCreditSpace, PATCH_JUMP);
- InjectHook(0x4FE620, CCredits::PrintCreditText, PATCH_JUMP);
-ENDPATCHES
diff --git a/src/render/Credits.h b/src/render/Credits.h
index c39fb035..e049ce76 100644
--- a/src/render/Credits.h
+++ b/src/render/Credits.h
@@ -2,8 +2,8 @@
class CCredits
{
- static bool &bCreditsGoing;
- static uint32 &CreditsStartTime;
+ static bool bCreditsGoing;
+ static uint32 CreditsStartTime;
public:
static void Init(void);
static void Start(void);
diff --git a/src/render/Draw.cpp b/src/render/Draw.cpp
index 862fc024..b31cc624 100644
--- a/src/render/Draw.cpp
+++ b/src/render/Draw.cpp
@@ -1,5 +1,5 @@
#include "common.h"
-#include "patcher.h"
+
#include "Draw.h"
#include "Frontend.h"
#include "Camera.h"
@@ -8,15 +8,15 @@
float CDraw::ms_fAspectRatio = DEFAULT_ASPECT_RATIO;
#endif
-float &CDraw::ms_fNearClipZ = *(float*)0x8E2DC4;
-float &CDraw::ms_fFarClipZ = *(float*)0x9434F0;
-float &CDraw::ms_fFOV = *(float*)0x5FBC6C;
-float &CDraw::ms_fLODDistance = *(float*)0x8F2C30;
+float CDraw::ms_fNearClipZ;
+float CDraw::ms_fFarClipZ;
+float CDraw::ms_fFOV = 45.0f;
+float CDraw::ms_fLODDistance;
-uint8 &CDraw::FadeValue = *(uint8*)0x95CD68;
-uint8 &CDraw::FadeRed = *(uint8*)0x95CD90;
-uint8 &CDraw::FadeGreen = *(uint8*)0x95CD71;
-uint8 &CDraw::FadeBlue = *(uint8*)0x95CD53;
+uint8 CDraw::FadeValue;
+uint8 CDraw::FadeRed;
+uint8 CDraw::FadeGreen;
+uint8 CDraw::FadeBlue;
float
CDraw::FindAspectRatio(void)
@@ -66,10 +66,3 @@ CDraw::SetFOV(float fov)
ms_fFOV = fov;
#endif
}
-
-STARTPATCHES
- InjectHook(0x4FE7B0, CDraw::SetFOV, PATCH_JUMP);
-
- Nop(0x46B618, 2);
- Patch<float>(0x5F0A64, 1.3333334f);
-ENDPATCHES
diff --git a/src/render/Draw.h b/src/render/Draw.h
index 50e1e294..55958a2a 100644
--- a/src/render/Draw.h
+++ b/src/render/Draw.h
@@ -13,11 +13,11 @@ enum eAspectRatio
class CDraw
{
private:
- static float &ms_fNearClipZ;
- static float &ms_fFarClipZ;
- static float &ms_fFOV;
+ static float ms_fNearClipZ;
+ static float ms_fFarClipZ;
+ static float ms_fFOV;
public:
- static float &ms_fLODDistance; // set but unused?
+ static float ms_fLODDistance; // set but unused?
#ifdef ASPECT_RATIO_SCALE
// we use this variable to scale a lot of 2D elements
@@ -25,10 +25,10 @@ public:
static float ms_fAspectRatio;
#endif
- static uint8 &FadeValue;
- static uint8 &FadeRed;
- static uint8 &FadeGreen;
- static uint8 &FadeBlue;
+ static uint8 FadeValue;
+ static uint8 FadeRed;
+ static uint8 FadeGreen;
+ static uint8 FadeBlue;
static void SetNearClipZ(float nearclip) { ms_fNearClipZ = nearclip; }
static float GetNearClipZ(void) { return ms_fNearClipZ; }
diff --git a/src/render/Fluff.cpp b/src/render/Fluff.cpp
index e2899532..e068747e 100644
--- a/src/render/Fluff.cpp
+++ b/src/render/Fluff.cpp
@@ -1,6 +1,6 @@
#include "common.h"
#include "main.h"
-#include "patcher.h"
+
#include "Entity.h"
#include "Fluff.h"
#include "Camera.h"
@@ -864,31 +864,3 @@ void CDigitalClock::Render()
CSprite::FlushSpriteBuffer();
}
}
-
-STARTPATCHES
-InjectHook(0x4FF290, &CMovingThing::Update, PATCH_JUMP);
-InjectHook(0x4FF320, &CMovingThing::AddToList, PATCH_JUMP);
-InjectHook(0x4FF340, &CMovingThing::RemoveFromList, PATCH_JUMP);
-
-InjectHook(0x4FE7C0, &CMovingThings::Init, PATCH_JUMP);
-InjectHook(0x4FF020, &CMovingThings::Shutdown, PATCH_JUMP);
-InjectHook(0x4FF0D0, &CMovingThings::Update, PATCH_JUMP);
-InjectHook(0x4FF210, &CMovingThings::Render, PATCH_JUMP);
-
-InjectHook(0x4FF360, &FindTunnelMessage, PATCH_JUMP);
-InjectHook(0x4FF390, &FindBridgeMessage, PATCH_JUMP);
-InjectHook(0x4FF3C0, &FindTimeMessage, PATCH_JUMP);
-InjectHook(0x4FF450, &FindDigitalClockMessage, PATCH_JUMP);
-
-InjectHook(0x4FF610, &CScrollBar::Init, PATCH_JUMP);
-InjectHook(0x4FF6E0, &CScrollBar::Update, PATCH_JUMP);
-InjectHook(0x4FFCE0, &CScrollBar::Render, PATCH_JUMP);
-
-InjectHook(0x5000D0, &CTowerClock::Init, PATCH_JUMP);
-InjectHook(0x500130, &CTowerClock::Update, PATCH_JUMP);
-InjectHook(0x5001D0, &CTowerClock::Render, PATCH_JUMP);
-
-InjectHook(0x5004F0, &CDigitalClock::Init, PATCH_JUMP);
-InjectHook(0x500550, &CDigitalClock::Update, PATCH_JUMP);
-InjectHook(0x5005F0, &CDigitalClock::Render, PATCH_JUMP);
-ENDPATCHES
diff --git a/src/render/Font.cpp b/src/render/Font.cpp
index ca15cba7..14a678b8 100644
--- a/src/render/Font.cpp
+++ b/src/render/Font.cpp
@@ -1,21 +1,21 @@
#include "common.h"
-#include "patcher.h"
+
#include "Sprite2d.h"
#include "TxdStore.h"
#include "Font.h"
-CFontDetails &CFont::Details = *(CFontDetails*)0x8F317C;
-int16 &CFont::NewLine = *(int16*)0x95CC94;
-CSprite2d *CFont::Sprite = (CSprite2d*)0x95CC04;
+CFontDetails CFont::Details;
+int16 CFont::NewLine;
+CSprite2d CFont::Sprite[MAX_FONTS];
#ifdef MORE_LANGUAGES
uint8 CFont::LanguageSet = FONT_LANGSET_EFIGS;
int32 CFont::Slot = -1;
-int16 CFont::Size[2][3][193] = {
+int16 CFont::Size[2][MAX_FONTS][193] = {
{
#else
-int16 CFont::Size[3][193] = {
+int16 CFont::Size[MAX_FONTS][193] = {
#endif
{
13, 12, 31, 35, 23, 35, 31, 9, 14, 15, 25, 30, 11, 17, 13, 31,
@@ -589,48 +589,3 @@ CFont::character_code(uint8 c)
return c;
return foreign_table[c-128];
}
-
-STARTPATCHES
-
- InjectHook(0x500A40, CFont::Initialise, PATCH_JUMP);
- InjectHook(0x500BA0, CFont::Shutdown, PATCH_JUMP);
- InjectHook(0x500BE0, CFont::InitPerFrame, PATCH_JUMP);
- InjectHook(0x500C30, CFont::PrintChar, PATCH_JUMP);
- InjectHook(0x500F50, (void (*)(float, float, wchar*))CFont::PrintString, PATCH_JUMP);
- InjectHook(0x501260, CFont::GetNumberLines, PATCH_JUMP);
- InjectHook(0x5013B0, CFont::GetTextRect, PATCH_JUMP);
- InjectHook(0x501730, (void (*)(float, float, wchar*, wchar*, float))CFont::PrintString, PATCH_JUMP);
- InjectHook(0x5017E0, CFont::GetCharacterWidth, PATCH_JUMP);
- InjectHook(0x501840, CFont::GetCharacterSize, PATCH_JUMP);
- InjectHook(0x5018A0, CFont::GetStringWidth, PATCH_JUMP);
- InjectHook(0x501960, CFont::GetNextSpace, PATCH_JUMP);
- InjectHook(0x5019A0, CFont::ParseToken, PATCH_JUMP);
- InjectHook(0x501B50, CFont::DrawFonts, PATCH_JUMP);
- InjectHook(0x501E80, CFont::character_code, PATCH_JUMP);
-
- InjectHook(0x501B80, CFont::SetScale, PATCH_JUMP);
- InjectHook(0x501BA0, CFont::SetSlantRefPoint, PATCH_JUMP);
- InjectHook(0x501BC0, CFont::SetSlant, PATCH_JUMP);
- InjectHook(0x501BD0, CFont::SetColor, PATCH_JUMP);
- InjectHook(0x501C60, CFont::SetJustifyOn, PATCH_JUMP);
- InjectHook(0x501C80, CFont::SetJustifyOff, PATCH_JUMP);
- InjectHook(0x501C90, CFont::SetCentreOn, PATCH_JUMP);
- InjectHook(0x501CB0, CFont::SetCentreOff, PATCH_JUMP);
- InjectHook(0x501CC0, CFont::SetWrapx, PATCH_JUMP);
- InjectHook(0x501CD0, CFont::SetCentreSize, PATCH_JUMP);
- InjectHook(0x501CE0, CFont::SetBackgroundOn, PATCH_JUMP);
- InjectHook(0x501CF0, CFont::SetBackgroundOff, PATCH_JUMP);
- InjectHook(0x501D00, CFont::SetBackgroundColor, PATCH_JUMP);
- InjectHook(0x501D30, CFont::SetBackGroundOnlyTextOn, PATCH_JUMP);
- InjectHook(0x501D40, CFont::SetBackGroundOnlyTextOff, PATCH_JUMP);
- InjectHook(0x501D50, CFont::SetRightJustifyOn, PATCH_JUMP);
- InjectHook(0x501D70, CFont::SetRightJustifyOff, PATCH_JUMP);
- InjectHook(0x501D90, CFont::SetPropOff, PATCH_JUMP);
- InjectHook(0x501DA0, CFont::SetPropOn, PATCH_JUMP);
- InjectHook(0x501DB0, CFont::SetFontStyle, PATCH_JUMP);
- InjectHook(0x501DC0, CFont::SetRightJustifyWrap, PATCH_JUMP);
- InjectHook(0x501DD0, CFont::SetAlphaFade, PATCH_JUMP);
- InjectHook(0x501DE0, CFont::SetDropColor, PATCH_JUMP);
- InjectHook(0x501E70, CFont::SetDropShadowPosition, PATCH_JUMP);
-
-ENDPATCHES
diff --git a/src/render/Font.h b/src/render/Font.h
index 0659dda1..ebf5e292 100644
--- a/src/render/Font.h
+++ b/src/render/Font.h
@@ -31,6 +31,7 @@ enum {
FONT_BANK,
FONT_PAGER,
FONT_HEADING,
+ MAX_FONTS
};
enum {
@@ -50,16 +51,16 @@ enum
class CFont
{
#ifdef MORE_LANGUAGES
- static int16 Size[2][3][193];
+ static int16 Size[2][MAX_FONTS][193];
static uint8 LanguageSet;
static int32 Slot;
#else
- static int16 Size[3][193];
+ static int16 Size[MAX_FONTS][193];
#endif
- static int16 &NewLine;
- static CSprite2d *Sprite; //[3]
+ static int16 NewLine;
+ static CSprite2d Sprite[MAX_FONTS];
public:
- static CFontDetails& Details;
+ static CFontDetails Details;
static void Initialise(void);
static void Shutdown(void);
diff --git a/src/render/Glass.cpp b/src/render/Glass.cpp
index ac6c1728..33e22c87 100644
--- a/src/render/Glass.cpp
+++ b/src/render/Glass.cpp
@@ -1,5 +1,5 @@
#include "common.h"
-#include "patcher.h"
+
#include "Glass.h"
#include "Timer.h"
#include "Object.h"
@@ -708,26 +708,3 @@ CGlass::WindowRespondsToExplosion(CEntity *entity, CVector point)
object->bGlassCracked = true;
}
}
-
-STARTPATCHES
- InjectHook(0x501F20, CGlass::Init, PATCH_JUMP);
- InjectHook(0x502050, CGlass::Update, PATCH_JUMP);
- InjectHook(0x502080, &CFallingGlassPane::Update, PATCH_JUMP);
- InjectHook(0x502350, CGlass::Render, PATCH_JUMP);
- InjectHook(0x502490, CGlass::FindFreePane, PATCH_JUMP);
- InjectHook(0x5024C0, &CFallingGlassPane::Render, PATCH_JUMP);
- InjectHook(0x502AC0, CGlass::GeneratePanesForWindow, PATCH_JUMP);
- InjectHook(0x5033F0, CGlass::AskForObjectToBeRenderedInGlass, PATCH_JUMP);
- InjectHook(0x503420, CGlass::RenderEntityInGlass, PATCH_JUMP);
- InjectHook(0x503C90, CGlass::CalcAlphaWithNormal, PATCH_JUMP);
- InjectHook(0x503D60, CGlass::RenderHiLightPolys, PATCH_JUMP);
- InjectHook(0x503DE0, CGlass::RenderShatteredPolys, PATCH_JUMP);
- InjectHook(0x503E70, CGlass::RenderReflectionPolys, PATCH_JUMP);
- InjectHook(0x503F10, CGlass::WindowRespondsToCollision, PATCH_JUMP);
- InjectHook(0x504630, CGlass::WindowRespondsToSoftCollision, PATCH_JUMP);
- InjectHook(0x504670, CGlass::WasGlassHitByBullet, PATCH_JUMP);
- InjectHook(0x504790, CGlass::WindowRespondsToExplosion, PATCH_JUMP);
- //InjectHook(0x504880, `global constructor keyed to'glass.cpp, PATCH_JUMP);
- //InjectHook(0x5048D0, CFallingGlassPane::~CFallingGlassPane, PATCH_JUMP);
- //InjectHook(0x5048E0, CFallingGlassPane::CFallingGlassPane, PATCH_JUMP);
-ENDPATCHES
diff --git a/src/render/Hud.cpp b/src/render/Hud.cpp
index 9529c4c1..03ffe59a 100644
--- a/src/render/Hud.cpp
+++ b/src/render/Hud.cpp
@@ -1,5 +1,5 @@
#include "common.h"
-#include "patcher.h"
+
#include "Camera.h"
#include "DMAudio.h"
#include "Clock.h"
@@ -21,52 +21,52 @@
#include "User.h"
#include "World.h"
-wchar CHud::m_HelpMessage[256]; // = (wchar*)0x86B888;
-wchar CHud::m_LastHelpMessage[256]; // = (wchar*)0x6E8F28;
-uint32 CHud::m_HelpMessageState; // = *(int32*)0x880E1C;
-uint32 CHud::m_HelpMessageTimer; // = *(int32*)0x880FA4;
-int32 CHud::m_HelpMessageFadeTimer; // = *(int32*)0x8F6258;
-wchar CHud::m_HelpMessageToPrint[256]; // = (wchar*)0x664480;
-float CHud::m_fHelpMessageTime; // *(float *)0x8E2C28;
-bool CHud::m_HelpMessageQuick; // = *(bool*)0x95CCF7;
-uint32 CHud::m_ZoneState; // = *(int32*)0x8F29AC;
+wchar CHud::m_HelpMessage[256];
+wchar CHud::m_LastHelpMessage[256];
+uint32 CHud::m_HelpMessageState;
+uint32 CHud::m_HelpMessageTimer;
+int32 CHud::m_HelpMessageFadeTimer;
+wchar CHud::m_HelpMessageToPrint[256];
+float CHud::m_fHelpMessageTime;
+bool CHud::m_HelpMessageQuick;
+uint32 CHud::m_ZoneState;
int32 CHud::m_ZoneFadeTimer;
-uint32 CHud::m_ZoneNameTimer; // = *(int32*)0x8F1A50;
-wchar *CHud::m_pZoneName; // = *(wchar**)0x8E2C2C;
-wchar *CHud::m_pLastZoneName; // = (wchar*)0x8F432C;
+uint32 CHud::m_ZoneNameTimer;
+wchar *CHud::m_pZoneName;
+wchar *CHud::m_pLastZoneName;
wchar *CHud::m_ZoneToPrint;
-uint32 CHud::m_VehicleState; // = *(int32*)0x940560;
+uint32 CHud::m_VehicleState;
int32 CHud::m_VehicleFadeTimer;
-uint32 CHud::m_VehicleNameTimer; // = *(int32*)0x8F2A14;
-wchar *CHud::m_VehicleName; // = *(wchar**)0x942FB4;
-wchar *CHud::m_pLastVehicleName; // = *(wchar**)0x8E2DD8;
+uint32 CHud::m_VehicleNameTimer;
+wchar *CHud::m_VehicleName;
+wchar *CHud::m_pLastVehicleName;
wchar *CHud::m_pVehicleNameToPrint;
-wchar CHud::m_Message[256];// = (wchar*)0x72E318;
-wchar CHud::m_PagerMessage[256]; // = (wchar*)0x878840;
-bool CHud::m_Wants_To_Draw_Hud; // (bool*)0x95CD89;
-bool CHud::m_Wants_To_Draw_3dMarkers; // = *(bool*)0x95CD62;
-wchar CHud::m_BigMessage[6][128]; // = *(wchar(*)[6][128]) * (uintptr*)0x664CE0;
-int16 CHud::m_ItemToFlash; // = *(int16*)0x95CC82;
+wchar CHud::m_Message[256];
+wchar CHud::m_PagerMessage[256];
+bool CHud::m_Wants_To_Draw_Hud;
+bool CHud::m_Wants_To_Draw_3dMarkers;
+wchar CHud::m_BigMessage[6][128];
+int16 CHud::m_ItemToFlash;
// These aren't really in CHud
float CHud::BigMessageInUse[6];
float CHud::BigMessageAlpha[6];
float CHud::BigMessageX[6];
-float CHud::OddJob2OffTimer; // = *(float*)0x942FA0;
-bool CHud::CounterOnLastFrame; // = *(int8*)0x95CD67;
-float CHud::OddJob2XOffset; // = *(float*)0x8F1B5C;
-uint16 CHud::CounterFlashTimer; // = *(int16*)0x95CC20;
-uint16 CHud::OddJob2Timer; // = *(int16*)0x95CC52;
-bool CHud::TimerOnLastFrame; //= *(int8*)0x95CDA7;
-int16 CHud::OddJob2On; //= *(int16*)0x95CC78;
-uint16 CHud::TimerFlashTimer; //= *(int16*)0x95CC6C;
-int16 CHud::PagerSoundPlayed; //= *(int16*)0x95CC4A;
-int32 CHud::SpriteBrightness; //= *(int32*)0x95CC54;
-float CHud::PagerXOffset; //= *(float*)0x941590;
-int16 CHud::PagerTimer; //= *(int16*)0x95CC3A;
-int16 CHud::PagerOn; //= *(int16*)0x95CCA0;
-
-CSprite2d CHud::Sprites[NUM_HUD_SPRITES]; // = (CSprite2d*)0x95CB9C;
+float CHud::OddJob2OffTimer;
+bool CHud::CounterOnLastFrame;
+float CHud::OddJob2XOffset;
+uint16 CHud::CounterFlashTimer;
+uint16 CHud::OddJob2Timer;
+bool CHud::TimerOnLastFrame;
+int16 CHud::OddJob2On;
+uint16 CHud::TimerFlashTimer;
+int16 CHud::PagerSoundPlayed;
+int32 CHud::SpriteBrightness;
+float CHud::PagerXOffset;
+int16 CHud::PagerTimer;
+int16 CHud::PagerOn;
+
+CSprite2d CHud::Sprites[NUM_HUD_SPRITES];
struct
{
@@ -98,8 +98,8 @@ struct
{"siterocket", "siterocket"}
};
-RwTexture *&gpSniperSightTex = *(RwTexture**)0x8F5834;
-RwTexture *&gpRocketSightTex = *(RwTexture**)0x8E2C20;
+RwTexture *gpSniperSightTex;
+RwTexture *gpRocketSightTex;
void CHud::Draw()
{
@@ -1483,18 +1483,3 @@ void CHud::Shutdown()
int HudTXD = CTxdStore::FindTxdSlot("hud");
CTxdStore::RemoveTxdSlot(HudTXD);
}
-
-STARTPATCHES
- InjectHook(0x5052A0, &CHud::Draw, PATCH_JUMP);
- InjectHook(0x509030, &CHud::DrawAfterFade, PATCH_JUMP);
- InjectHook(0x504F90, &CHud::GetRidOfAllHudMessages, PATCH_JUMP);
- InjectHook(0x5048F0, &CHud::Initialise, PATCH_JUMP);
- InjectHook(0x504CC0, &CHud::ReInitialise, PATCH_JUMP);
- InjectHook(0x50A250, &CHud::SetBigMessage, PATCH_JUMP);
- InjectHook(0x5051E0, &CHud::SetHelpMessage, PATCH_JUMP);
- InjectHook(0x50A210, &CHud::SetMessage, PATCH_JUMP);
- InjectHook(0x50A320, &CHud::SetPagerMessage, PATCH_JUMP);
- InjectHook(0x505290, &CHud::SetVehicleName, PATCH_JUMP);
- InjectHook(0x5051D0, &CHud::SetZoneName, PATCH_JUMP);
- InjectHook(0x504C50, &CHud::Shutdown, PATCH_JUMP);
-ENDPATCHES
diff --git a/src/render/Instance.cpp b/src/render/Instance.cpp
index 775341be..be6d73d6 100644
--- a/src/render/Instance.cpp
+++ b/src/render/Instance.cpp
@@ -1,5 +1,5 @@
#include "common.h"
-#include "patcher.h"
+
#include "Instance.h"
void
@@ -7,14 +7,3 @@ CInstance::Shutdown()
{
GetMatrix().Detach();
}
-
-class CInstance_ : public CInstance
-{
-public:
- void dtor() { CInstance::~CInstance(); }
-};
-
-STARTPATCHES
- InjectHook(0x50BE90, &CInstance_::dtor, PATCH_JUMP);
- InjectHook(0x50B850, &CInstance::Shutdown, PATCH_JUMP);
-ENDPATCHES
diff --git a/src/render/Lines.cpp b/src/render/Lines.cpp
index ea433048..b5c85149 100644
--- a/src/render/Lines.cpp
+++ b/src/render/Lines.cpp
@@ -1,5 +1,5 @@
#include "common.h"
-#include "patcher.h"
+
#include "main.h"
#include "Lines.h"
diff --git a/src/render/MBlur.cpp b/src/render/MBlur.cpp
index d28671fa..c3a25bce 100644
--- a/src/render/MBlur.cpp
+++ b/src/render/MBlur.cpp
@@ -1,14 +1,14 @@
#include "common.h"
-#include "patcher.h"
+
#include "RwHelper.h"
#include "Camera.h"
#include "MBlur.h"
// Originally taken from RW example 'mblur'
-RwRaster *&CMBlur::pFrontBuffer = *(RwRaster**)0x8E2C48;
-bool &CMBlur::ms_bJustInitialised = *(bool*)0x95CDAB;
-bool &CMBlur::BlurOn = *(bool*)0x95CDAD;
+RwRaster *CMBlur::pFrontBuffer;
+bool CMBlur::ms_bJustInitialised;
+bool CMBlur::BlurOn;
static RwIm2DVertex Vertex[4];
static RwImVertexIndex Index[6] = { 0, 1, 2, 0, 2, 3 };
@@ -213,11 +213,3 @@ CMBlur::OverlayRender(RwCamera *cam, RwRaster *raster, RwRGBA color, int32 type,
RwRenderStateSet(rwRENDERSTATESRCBLEND, (void*)rwBLENDSRCALPHA);
RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void*)rwBLENDINVSRCALPHA);
}
-
-STARTPATCHES
- InjectHook(0x50AE40, CMBlur::MotionBlurOpen, PATCH_JUMP);
- InjectHook(0x50B170, CMBlur::MotionBlurClose, PATCH_JUMP);
- InjectHook(0x50A800, CMBlur::CreateImmediateModeData, PATCH_JUMP);
- InjectHook(0x50AD70, CMBlur::MotionBlurRender, PATCH_JUMP);
- InjectHook(0x50A9C0, CMBlur::OverlayRender, PATCH_JUMP);
-ENDPATCHES
diff --git a/src/render/MBlur.h b/src/render/MBlur.h
index 42827f99..e8a5bef8 100644
--- a/src/render/MBlur.h
+++ b/src/render/MBlur.h
@@ -3,9 +3,9 @@
class CMBlur
{
public:
- static RwRaster *&pFrontBuffer;
- static bool &ms_bJustInitialised;
- static bool &BlurOn;
+ static RwRaster *pFrontBuffer;
+ static bool ms_bJustInitialised;
+ static bool BlurOn;
public:
static void MotionBlurOpen(RwCamera *cam);
diff --git a/src/render/Particle.cpp b/src/render/Particle.cpp
index 6956a887..0388e779 100644
--- a/src/render/Particle.cpp
+++ b/src/render/Particle.cpp
@@ -1,5 +1,5 @@
#include "common.h"
-#include "patcher.h"
+
#include "General.h"
#include "Timer.h"
#include "TxdStore.h"
@@ -204,26 +204,21 @@ RwRaster *gpGunShellRaster;
RwRaster *gpWakeOldRaster;
-//RwRaster *gpPointlightRaster; // CPointLights::RenderFogEffect
-RwRaster *&gpPointlightRaster = *(RwRaster **)0x8F5FE0;
+RwRaster *gpPointlightRaster; // CPointLights::RenderFogEffect
-//RwTexture *gpRainDropTex[MAX_RAINDROP_FILES]; // CWeather::RenderRainStreaks
-RwTexture * (&gpRainDropTex)[MAX_RAINDROP_FILES] = *(RwTexture * (*)[MAX_RAINDROP_FILES])*(int *)0x880660;
+RwTexture *gpRainDropTex[MAX_RAINDROP_FILES]; // CWeather::RenderRainStreaks
RwRaster *gpRainDropRaster[MAX_RAINDROP_FILES];
-//Float CParticle::ms_afRandTable[CParticle::RAND_TABLE_SIZE]; //
-float (&CParticle::ms_afRandTable)[CParticle::RAND_TABLE_SIZE] = *(float (*)[CParticle::RAND_TABLE_SIZE])*(int *)0x6E98C8;
+float CParticle::ms_afRandTable[CParticle::RAND_TABLE_SIZE];
CParticle *CParticle::m_pUnusedListHead;
-//Float CParticle::m_SinTable[CParticle::SIN_COS_TABLE_SIZE]; //
-//Float CParticle::m_CosTable[CParticle::SIN_COS_TABLE_SIZE]; /
-float (&CParticle::m_SinTable)[CParticle::SIN_COS_TABLE_SIZE] = *(float (*)[CParticle::SIN_COS_TABLE_SIZE])*(int *)0x877358;
-float (&CParticle::m_CosTable)[CParticle::SIN_COS_TABLE_SIZE] = *(float (*)[CParticle::SIN_COS_TABLE_SIZE])*(int *)0x70DA18;
+float CParticle::m_SinTable[CParticle::SIN_COS_TABLE_SIZE];
+float CParticle::m_CosTable[CParticle::SIN_COS_TABLE_SIZE];
int32 Randomizer;
@@ -1854,19 +1849,3 @@ void CParticle::AddYardieDoorSmoke(CVector const &vecPos, CMatrix const &matMatr
0.3f, color, 0, 0, 0, 0);
}
}
-
-STARTPATCHES
- //InjectHook(0x50C410, &CParticle::ctor, PATCH_JUMP);
- //InjectHook(0x50C420, &CParticle::dtor, PATCH_JUMP);
- InjectHook(0x50C430, CParticle::ReloadConfig, PATCH_JUMP);
- InjectHook(0x50C570, CParticle::Initialise, PATCH_JUMP);
- InjectHook(0x50CF40, CParticle::Shutdown, PATCH_JUMP);
- //InjectHook(0x50D140, CParticle::AddParticle, PATCH_JUMP);
- InjectHook(0x50D190, (CParticle *(*)(tParticleType, CVector const&, CVector const&, CEntity*, float, RwRGBA const&, int, int, int, int))CParticle::AddParticle, PATCH_JUMP);
- InjectHook(0x50DCF0, CParticle::Update, PATCH_JUMP);
- InjectHook(0x50EE20, CParticle::Render, PATCH_JUMP);
- InjectHook(0x50F6E0, CParticle::RemovePSystem, PATCH_JUMP);
- InjectHook(0x50F720, CParticle::RemoveParticle, PATCH_JUMP);
- InjectHook(0x50F760, CParticle::AddJetExplosion, PATCH_JUMP);
- InjectHook(0x50FAA0, CParticle::AddYardieDoorSmoke, PATCH_JUMP);
-ENDPATCHES
diff --git a/src/render/Particle.h b/src/render/Particle.h
index 310ef0d4..604fbb82 100644
--- a/src/render/Particle.h
+++ b/src/render/Particle.h
@@ -49,16 +49,11 @@ public:
;
}
- //static float ms_afRandTable[RAND_TABLE_SIZE];
- static float (&ms_afRandTable)[RAND_TABLE_SIZE];
+ static float ms_afRandTable[RAND_TABLE_SIZE];
static CParticle *m_pUnusedListHead;
- /*
static float m_SinTable[SIN_COS_TABLE_SIZE];
static float m_CosTable[SIN_COS_TABLE_SIZE];
- */
- static float (&m_SinTable)[SIN_COS_TABLE_SIZE];
- static float (&m_CosTable)[SIN_COS_TABLE_SIZE];
static float Sin(int32 value) { return m_SinTable[value]; }
static float Cos(int32 value) { return m_CosTable[value]; }
diff --git a/src/render/ParticleMgr.cpp b/src/render/ParticleMgr.cpp
index 7a1804de..4bfb6380 100644
--- a/src/render/ParticleMgr.cpp
+++ b/src/render/ParticleMgr.cpp
@@ -1,5 +1,5 @@
#include "common.h"
-#include "patcher.h"
+
#include "main.h"
#include "FileMgr.h"
#include "ParticleMgr.h"
@@ -242,9 +242,3 @@ void cParticleSystemMgr::LoadParticleData()
lineEnd++;
}
}
-
-STARTPATCHES
- InjectHook(0x50FCB0, &cParticleSystemMgr::ctor, PATCH_JUMP);
- InjectHook(0x50FCD0, &cParticleSystemMgr::Initialise, PATCH_JUMP);
- InjectHook(0x50FDF0, &cParticleSystemMgr::LoadParticleData, PATCH_JUMP);
-ENDPATCHES \ No newline at end of file
diff --git a/src/render/PlayerSkin.cpp b/src/render/PlayerSkin.cpp
index 2cba45fe..94af1fd1 100644
--- a/src/render/PlayerSkin.cpp
+++ b/src/render/PlayerSkin.cpp
@@ -1,5 +1,5 @@
#include "common.h"
-#include "patcher.h"
+
#include "main.h"
#include "PlayerSkin.h"
#include "TxdStore.h"
@@ -163,12 +163,3 @@ CPlayerSkin::RenderFrontendSkinEdit(void)
SetAmbientColours(&AmbientColor);
RpClumpRender(gpPlayerClump);
}
-
-STARTPATCHES
-InjectHook(0x59B9B0, &CPlayerSkin::Initialise, PATCH_JUMP);
-InjectHook(0x59B9E0, &CPlayerSkin::Shutdown, PATCH_JUMP);
-InjectHook(0x59B9F0, &CPlayerSkin::GetSkinTexture, PATCH_JUMP);
-InjectHook(0x59BC70, &CPlayerSkin::BeginFrontendSkinEdit, PATCH_JUMP);
-InjectHook(0x59BCB0, &CPlayerSkin::EndFrontendSkinEdit, PATCH_JUMP);
-InjectHook(0x59BCE0, &CPlayerSkin::RenderFrontendSkinEdit, PATCH_JUMP);
-ENDPATCHES \ No newline at end of file
diff --git a/src/render/PointLights.cpp b/src/render/PointLights.cpp
index a015ec54..55be40b2 100644
--- a/src/render/PointLights.cpp
+++ b/src/render/PointLights.cpp
@@ -1,5 +1,5 @@
#include "common.h"
-#include "patcher.h"
+
#include "main.h"
#include "Lights.h"
#include "Camera.h"
@@ -10,8 +10,8 @@
#include "Timer.h"
#include "PointLights.h"
-int16 &CPointLights::NumLights = *(int16*)0x95CC3E;
-CRegisteredPointLight *CPointLights::aLights = (CRegisteredPointLight*)0x7096D0;
+int16 CPointLights::NumLights;
+CRegisteredPointLight CPointLights::aLights[NUMPOINTLIGHTS];
void
CPointLights::InitPerFrame(void)
@@ -114,7 +114,7 @@ CPointLights::GenerateLightsAffectingObject(CVector *objCoors)
return ret;
}
-extern RwRaster *&gpPointlightRaster;
+extern RwRaster *gpPointlightRaster;
void
CPointLights::RemoveLightsAffectingObject(void)
@@ -284,10 +284,3 @@ CPointLights::RenderFogEffect(void)
}
}
}
-
-STARTPATCHES
- InjectHook(0x510790, CPointLights::AddLight, PATCH_JUMP);
- InjectHook(0x510960, CPointLights::GenerateLightsAffectingObject, PATCH_JUMP);
- InjectHook(0x510C20, CPointLights::RemoveLightsAffectingObject, PATCH_JUMP);
- InjectHook(0x510C30, CPointLights::RenderFogEffect, PATCH_JUMP);
-ENDPATCHES
diff --git a/src/render/PointLights.h b/src/render/PointLights.h
index c1dad87f..215e1dc9 100644
--- a/src/render/PointLights.h
+++ b/src/render/PointLights.h
@@ -18,8 +18,8 @@ static_assert(sizeof(CRegisteredPointLight) == 0x2C, "CRegisteredPointLight: err
class CPointLights
{
public:
- static int16 &NumLights;
- static CRegisteredPointLight *aLights; //[NUMPOINTLIGHTS]
+ static int16 NumLights;
+ static CRegisteredPointLight aLights[NUMPOINTLIGHTS];
enum {
LIGHT_POINT,
diff --git a/src/render/RenderBuffer.cpp b/src/render/RenderBuffer.cpp
index f6499451..6120dfe2 100644
--- a/src/render/RenderBuffer.cpp
+++ b/src/render/RenderBuffer.cpp
@@ -1,15 +1,15 @@
#include "common.h"
-#include "patcher.h"
+
#include "RenderBuffer.h"
-int32 &TempBufferVerticesStored = *(int32*)0x8F5F78;
-int32 &TempBufferIndicesStored = *(int32*)0x8F1A4C;
+int32 TempBufferVerticesStored;
+int32 TempBufferIndicesStored;
-RwIm3DVertex *TempBufferRenderVertices = (RwIm3DVertex*)0x862330;
-RwImVertexIndex *TempBufferRenderIndexList = (RwImVertexIndex*)0x846288;
+RwIm3DVertex TempBufferRenderVertices[TEMPBUFFERVERTSIZE];
+RwImVertexIndex TempBufferRenderIndexList[TEMPBUFFERINDEXSIZE];
-int &RenderBuffer::VerticesToBeStored = *(int*)0x8F59C4;
-int &RenderBuffer::IndicesToBeStored = *(int*)0x8E28B0;
+int RenderBuffer::VerticesToBeStored;
+int RenderBuffer::IndicesToBeStored;
void
RenderBuffer::ClearRenderBuffer(void)
@@ -50,10 +50,3 @@ RenderBuffer::RenderStuffInBuffer(void)
}
ClearRenderBuffer();
}
-
-STARTPATCHES
- InjectHook(0x517620, RenderBuffer::ClearRenderBuffer, PATCH_JUMP);
- InjectHook(0x517640, RenderBuffer::StartStoring, PATCH_JUMP);
- InjectHook(0x5176B0, RenderBuffer::StopStoring, PATCH_JUMP);
- InjectHook(0x5177C0, RenderBuffer::RenderStuffInBuffer, PATCH_JUMP);
-ENDPATCHES
diff --git a/src/render/RenderBuffer.h b/src/render/RenderBuffer.h
index 2b8a9f86..485d24e3 100644
--- a/src/render/RenderBuffer.h
+++ b/src/render/RenderBuffer.h
@@ -1,8 +1,8 @@
class RenderBuffer
{
public:
- static int &VerticesToBeStored;
- static int &IndicesToBeStored;
+ static int VerticesToBeStored;
+ static int IndicesToBeStored;
static void ClearRenderBuffer(void);
static void StartStoring(int numIndices, int numVertices, RwImVertexIndex **indexStart, RwIm3DVertex **vertexStart);
static void StopStoring(void);
@@ -12,7 +12,7 @@ public:
#define TEMPBUFFERVERTSIZE 256
#define TEMPBUFFERINDEXSIZE 1024
-extern int32 &TempBufferVerticesStored;
-extern int32 &TempBufferIndicesStored;
-extern RwIm3DVertex *TempBufferRenderVertices;
-extern RwImVertexIndex *TempBufferRenderIndexList; \ No newline at end of file
+extern int32 TempBufferVerticesStored;
+extern int32 TempBufferIndicesStored;
+extern RwIm3DVertex TempBufferRenderVertices[TEMPBUFFERVERTSIZE];
+extern RwImVertexIndex TempBufferRenderIndexList[TEMPBUFFERINDEXSIZE]; \ No newline at end of file
diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp
index 7b2f90e8..9c78853f 100644
--- a/src/render/Renderer.cpp
+++ b/src/render/Renderer.cpp
@@ -1,5 +1,5 @@
#include "common.h"
-#include "patcher.h"
+
#include "main.h"
#include "Lights.h"
#include "ModelInfo.h"
@@ -1207,40 +1207,3 @@ CRenderer::RemoveVehiclePedLights(CEntity *ent, bool reset)
if(reset)
ReSetAmbientAndDirectionalColours();
}
-
-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);
- InjectHook(0x4A7B20, CRenderer::RenderFirstPersonVehicle, PATCH_JUMP);
- InjectHook(0x4A78B0, CRenderer::RenderRoads, PATCH_JUMP);
- InjectHook(0x4A7930, CRenderer::RenderEverythingBarRoads, PATCH_JUMP);
- InjectHook(0x4A7AA0, CRenderer::RenderVehiclesButNotBoats, PATCH_JUMP);
- InjectHook(0x4A7AE0, CRenderer::RenderBoats, PATCH_JUMP);
- InjectHook(0x4A7910, CRenderer::RenderFadingInEntities, PATCH_JUMP);
-
- InjectHook(0x4A9350, CRenderer::SetupEntityVisibility, PATCH_JUMP);
- InjectHook(0x4A9920, CRenderer::SetupBigBuildingVisibility, PATCH_JUMP);
-
- InjectHook(0x4A76B0, CRenderer::ConstructRenderList, PATCH_JUMP);
- InjectHook(0x4A7840, CRenderer::PreRender, PATCH_JUMP);
- InjectHook(0x4A8970, CRenderer::ScanWorld, PATCH_JUMP);
- InjectHook(0x4AA240, CRenderer::RequestObjectsInFrustum, PATCH_JUMP);
- InjectHook(0x4A7F30, CRenderer::ScanSectorPoly, PATCH_JUMP);
- InjectHook(0x4A9300, CRenderer::ScanBigBuildingList, PATCH_JUMP);
- InjectHook(0x4A9BB0, CRenderer::ScanSectorList, PATCH_JUMP);
- InjectHook(0x4A9E30, CRenderer::ScanSectorList_Priority, PATCH_JUMP);
- InjectHook(0x4AA0A0, CRenderer::ScanSectorList_Subway, PATCH_JUMP);
- InjectHook(0x4AA1D0, CRenderer::ScanSectorList_RequestModels, PATCH_JUMP);
-
- InjectHook(0x4AA940, CRenderer::SortBIGBuildings, PATCH_JUMP);
- InjectHook(0x4AA990, CRenderer::SortBIGBuildingsForSectorList, PATCH_JUMP);
-
- InjectHook(0x4A9840, CRenderer::ShouldModelBeStreamed, PATCH_JUMP);
- InjectHook(0x4AAA00, CRenderer::IsEntityCullZoneVisible, PATCH_JUMP);
- InjectHook(0x4AAAA0, CRenderer::IsVehicleCullZoneVisible, PATCH_JUMP);
-
- InjectHook(0x4A7CF0, CRenderer::RemoveVehiclePedLights, PATCH_JUMP);
-ENDPATCHES
diff --git a/src/render/Rubbish.cpp b/src/render/Rubbish.cpp
index 65d8b2dd..31110046 100644
--- a/src/render/Rubbish.cpp
+++ b/src/render/Rubbish.cpp
@@ -1,6 +1,6 @@
#include "common.h"
#include "main.h"
-#include "patcher.h"
+
#include "General.h"
#include "Timer.h"
#include "Weather.h"
diff --git a/src/render/Shadows.cpp b/src/render/Shadows.cpp
index e14b0453..8685b93a 100644
--- a/src/render/Shadows.cpp
+++ b/src/render/Shadows.cpp
@@ -1,5 +1,5 @@
#include "common.h"
-#include "patcher.h"
+
#include "main.h"
#include "TxdStore.h"
#include "Timer.h"
@@ -20,43 +20,31 @@
SETTWEAKPATH("Shadows");
TWEAKBOOL(gbPrintShite);
-#if 1
RwImVertexIndex ShadowIndexList[24];
-#else
-RwImVertexIndex (&ShadowIndexList)[24] = *(RwImVertexIndex (*)[24])*(int *)0x649188;
-#endif
-RwTexture *&gpShadowCarTex = *(RwTexture **)0x8F2C90;
-RwTexture *&gpShadowPedTex = *(RwTexture **)0x8F59D0;
-RwTexture *&gpShadowHeliTex = *(RwTexture **)0x8E2A90;
-RwTexture *&gpShadowExplosionTex = *(RwTexture **)0x8F2A00;
-RwTexture *&gpShadowHeadLightsTex = *(RwTexture **)0x95CB98;
-RwTexture *&gpOutline1Tex = *(RwTexture **)0x8F1B24;
-RwTexture *&gpOutline2Tex = *(RwTexture **)0x8F1B04;
-RwTexture *&gpOutline3Tex = *(RwTexture **)0x8F1B08;
-RwTexture *&gpBloodPoolTex = *(RwTexture **)0x9415F8;
-RwTexture *&gpReflectionTex = *(RwTexture **)0x8F582C;
-RwTexture *&gpGoalMarkerTex = *(RwTexture **)0x94142C;
-RwTexture *&gpWalkDontTex = *(RwTexture **)0x95CB4C;
-RwTexture *&gpCrackedGlassTex = *(RwTexture **)0x95CB94;
-RwTexture *&gpPostShadowTex = *(RwTexture **)0x8F59D4;
-RwTexture *&gpGoalTex = *(RwTexture**)0x94142C;
-
-#if 1
+RwTexture *gpShadowCarTex;
+RwTexture *gpShadowPedTex;
+RwTexture *gpShadowHeliTex;
+RwTexture *gpShadowExplosionTex;
+RwTexture *gpShadowHeadLightsTex;
+RwTexture *gpOutline1Tex;
+RwTexture *gpOutline2Tex;
+RwTexture *gpOutline3Tex;
+RwTexture *gpBloodPoolTex;
+RwTexture *gpReflectionTex;
+RwTexture *gpGoalMarkerTex;
+RwTexture *gpWalkDontTex;
+RwTexture *gpCrackedGlassTex;
+RwTexture *gpPostShadowTex;
+RwTexture *gpGoalTex;
+
int16 CShadows::ShadowsStoredToBeRendered;
CStoredShadow CShadows::asShadowsStored [MAX_STOREDSHADOWS];
CPolyBunch CShadows::aPolyBunches [MAX_POLYBUNCHES];
CStaticShadow CShadows::aStaticShadows [MAX_STATICSHADOWS];
CPolyBunch *CShadows::pEmptyBunchList;
CPermanentShadow CShadows::aPermanentShadows[MAX_PERMAMENTSHADOWS];
-#else
-int16 &CShadows::ShadowsStoredToBeRendered = *(int16*)0x95CCEE;
-CStoredShadow (&CShadows::asShadowsStored)[MAX_STOREDSHADOWS] = *(CStoredShadow (*)[MAX_STOREDSHADOWS])*(int *)0x779058;
-CPolyBunch (&CShadows::aPolyBunches)[MAX_POLYBUNCHES] = *(CPolyBunch (*)[MAX_POLYBUNCHES])*(int *)0x86F4C8;
-CStaticShadow (&CShadows::aStaticShadows)[MAX_STATICSHADOWS] = *(CStaticShadow (*)[MAX_STATICSHADOWS])*(int *)0x773BE8;
-CPolyBunch *&CShadows::pEmptyBunchList = *(CPolyBunch**)0x8F435C;
-CPermanentShadow (&CShadows::aPermanentShadows)[MAX_PERMAMENTSHADOWS] = *(CPermanentShadow (*)[MAX_PERMAMENTSHADOWS])*(int *)0x712040;
-#endif
+
void
CShadows::Init(void)
@@ -1772,36 +1760,3 @@ CShadows::RenderIndicatorShadow(uint32 nID, uint8 ShadowType, RwTexture *pTextur
0, 128, 255, 128,
2048, 0.2f, 0);
}
-
-
-STARTPATCHES
- InjectHook(0x512AB0, CShadows::Init, PATCH_JUMP);
- InjectHook(0x512F20, CShadows::Shutdown, PATCH_JUMP);
- InjectHook(0x512FD0, CShadows::AddPermanentShadow, PATCH_JUMP);
- InjectHook(0x5130A0, CShadows::StoreStaticShadow, PATCH_JUMP);
- InjectHook(0x513550, (void(*)(uint8, CVector *, float, float, float, float, int16, uint8, uint8, uint8))CShadows::StoreShadowToBeRendered, PATCH_JUMP);
- InjectHook(0x513750, (void(*)(uint8, RwTexture *, CVector *, float, float, float, float, int16, uint8, uint8, uint8, float, bool, float))CShadows::StoreShadowToBeRendered, PATCH_JUMP);
- InjectHook(0x513830, CShadows::StoreShadowForCar, PATCH_JUMP);
- InjectHook(0x513A70, CShadows::StoreCarLightShadow, PATCH_JUMP);
- InjectHook(0x513C50, CShadows::StoreShadowForPed, PATCH_JUMP);
- InjectHook(0x513CB0, CShadows::StoreShadowForPedObject, PATCH_JUMP);
- InjectHook(0x513E00, CShadows::StoreShadowForTree, PATCH_JUMP);
- InjectHook(0x513E10, CShadows::StoreShadowForPole, PATCH_JUMP);
- InjectHook(0x513FC0, CShadows::SetRenderModeForShadowType, PATCH_JUMP);
- InjectHook(0x514010, CShadows::RenderStoredShadows, PATCH_JUMP);
- InjectHook(0x5145F0, CShadows::RenderStaticShadows, PATCH_JUMP);
- InjectHook(0x514910, CShadows::GeneratePolysForStaticShadow, PATCH_JUMP);
- InjectHook(0x514C90, CShadows::CastShadowSectorList, PATCH_JUMP);
- InjectHook(0x514E30, CShadows::CastShadowEntity, PATCH_JUMP);
- InjectHook(0x516BE0, CShadows::UpdateStaticShadows, PATCH_JUMP);
- InjectHook(0x516C40, CShadows::UpdatePermanentShadows, PATCH_JUMP);
- InjectHook(0x516E70, &CStaticShadow::Free, PATCH_JUMP);
- InjectHook(0x516EB0, CShadows::CalcPedShadowValues, PATCH_JUMP);
- InjectHook(0x516F90, CShadows::RenderExtraPlayerShadows, PATCH_JUMP);
- InjectHook(0x517570, CShadows::TidyUpShadows, PATCH_JUMP);
- InjectHook(0x517810, CShadows::RenderIndicatorShadow, PATCH_JUMP);
- //InjectHook(0x517900, &CPermanentShadow::CPermanentShadow, PATCH_JUMP);
- //InjectHook(0x517910, &CStaticShadow::CStaticShadow, PATCH_JUMP);
- //InjectHook(0x517920, &CPolyBunch::CPolyBunch, PATCH_JUMP);
- //InjectHook(0x517940, &CStoredShadow::CStoredShadow, PATCH_JUMP);
-ENDPATCHES \ No newline at end of file
diff --git a/src/render/Shadows.h b/src/render/Shadows.h
index ced9f11b..d209fe90 100644
--- a/src/render/Shadows.h
+++ b/src/render/Shadows.h
@@ -174,18 +174,18 @@ public:
static void RenderIndicatorShadow (uint32 nID, uint8 ShadowType, RwTexture *pTexture, CVector *pPosn, float fFrontX, float fFrontY, float fSideX, float fSideY, int16 nIntensity);
};
-extern RwTexture *&gpShadowCarTex;
-extern RwTexture *&gpShadowPedTex;
-extern RwTexture *&gpShadowHeliTex;
-extern RwTexture *&gpShadowExplosionTex;
-extern RwTexture *&gpShadowHeadLightsTex;
-extern RwTexture *&gpOutline1Tex;
-extern RwTexture *&gpOutline2Tex;
-extern RwTexture *&gpOutline3Tex;
-extern RwTexture *&gpBloodPoolTex;
-extern RwTexture *&gpReflectionTex;
-extern RwTexture *&gpGoalMarkerTex;
-extern RwTexture *&gpWalkDontTex;
-extern RwTexture *&gpCrackedGlassTex;
-extern RwTexture *&gpPostShadowTex;
-extern RwTexture *&gpGoalTex;
+extern RwTexture *gpShadowCarTex;
+extern RwTexture *gpShadowPedTex;
+extern RwTexture *gpShadowHeliTex;
+extern RwTexture *gpShadowExplosionTex;
+extern RwTexture *gpShadowHeadLightsTex;
+extern RwTexture *gpOutline1Tex;
+extern RwTexture *gpOutline2Tex;
+extern RwTexture *gpOutline3Tex;
+extern RwTexture *gpBloodPoolTex;
+extern RwTexture *gpReflectionTex;
+extern RwTexture *gpGoalMarkerTex;
+extern RwTexture *gpWalkDontTex;
+extern RwTexture *gpCrackedGlassTex;
+extern RwTexture *gpPostShadowTex;
+extern RwTexture *gpGoalTex;
diff --git a/src/render/Skidmarks.cpp b/src/render/Skidmarks.cpp
index e003079e..f3479536 100644
--- a/src/render/Skidmarks.cpp
+++ b/src/render/Skidmarks.cpp
@@ -1,5 +1,5 @@
#include "common.h"
-#include "patcher.h"
+
#include "main.h"
#include "TxdStore.h"
#include "Timer.h"
diff --git a/src/render/SpecialFX.cpp b/src/render/SpecialFX.cpp
index 9189a7c2..16057420 100644
--- a/src/render/SpecialFX.cpp
+++ b/src/render/SpecialFX.cpp
@@ -1,5 +1,5 @@
#include "common.h"
-#include "patcher.h"
+
#include "SpecialFX.h"
#include "RenderBuffer.h"
#include "Timer.h"
@@ -1151,32 +1151,3 @@ CSpecialParticleStuff::UpdateBoatFoamAnimation(CMatrix* pMatrix)
dZ = 2.0f;
}
}
-
-STARTPATCHES
- InjectHook(0x518DE0, &CBulletTraces::Init, PATCH_JUMP);
- InjectHook(0x518E90, &CBulletTraces::AddTrace, PATCH_JUMP);
- InjectHook(0x518F20, &CBulletTraces::Render, PATCH_JUMP);
- InjectHook(0x519240, &CBulletTraces::Update, PATCH_JUMP);
-
- InjectHook(0x51B070, &C3dMarker::AddMarker, PATCH_JUMP);
- InjectHook(0x51B170, &C3dMarker::DeleteMarkerObject, PATCH_JUMP);
- InjectHook(0x51B1B0, &C3dMarker::Render, PATCH_JUMP);
- InjectHook(0x51B2B0, C3dMarkers::Init, PATCH_JUMP);
- InjectHook(0x51B480, C3dMarkers::PlaceMarker, PATCH_JUMP);
- InjectHook(0x51BB80, C3dMarkers::PlaceMarkerSet, PATCH_JUMP);
- InjectHook(0x51B400, C3dMarkers::Render, PATCH_JUMP);
- InjectHook(0x51B3B0, C3dMarkers::Shutdown, PATCH_JUMP);
-
- InjectHook(0x5197A0, CBrightLights::Init, PATCH_JUMP);
- InjectHook(0x51A410, CBrightLights::RegisterOne, PATCH_JUMP);
- InjectHook(0x5197B0, CBrightLights::Render, PATCH_JUMP);
- InjectHook(0x51A3B0, CBrightLights::RenderOutGeometryBuffer, PATCH_JUMP);
-
- InjectHook(0x51A5A0, CShinyTexts::Init, PATCH_JUMP);
- InjectHook(0x51AAB0, CShinyTexts::RegisterOne, PATCH_JUMP);
- InjectHook(0x51A5B0, CShinyTexts::Render, PATCH_JUMP);
- InjectHook(0x51AA50, CShinyTexts::RenderOutGeometryBuffer, PATCH_JUMP);
-
- InjectHook(0x51AF70, CMoneyMessages::Init, PATCH_JUMP);
- InjectHook(0x51B030, CMoneyMessages::Render, PATCH_JUMP);
-ENDPATCHES
diff --git a/src/render/Sprite.cpp b/src/render/Sprite.cpp
index 82754121..30eaf840 100644
--- a/src/render/Sprite.cpp
+++ b/src/render/Sprite.cpp
@@ -1,14 +1,14 @@
#include "common.h"
-#include "patcher.h"
+
#include "main.h"
#include "Draw.h"
#include "Camera.h"
#include "Sprite.h"
-float &CSprite::m_f2DNearScreenZ = *(float*)0x8F1ABC;
-float &CSprite::m_f2DFarScreenZ = *(float*)0x8F2C94;
-float &CSprite::m_fRecipNearClipPlane = *(float*)0x8F5FFC;
-int32 &CSprite::m_bFlushSpriteBufferSwitchZTest = *(int32*)0x8F5FB0;
+float CSprite::m_f2DNearScreenZ;
+float CSprite::m_f2DFarScreenZ;
+float CSprite::m_fRecipNearClipPlane;
+int32 CSprite::m_bFlushSpriteBufferSwitchZTest;
float
CSprite::CalcHorizonCoors(void)
@@ -40,9 +40,9 @@ CSprite::CalcScreenCoors(const RwV3d &in, RwV3d *out, float *outw, float *outh,
}
#define SPRITEBUFFERSIZE 64
-static int32 &nSpriteBufferIndex = *(int32*)0x649A80;
-static RwIm2DVertex *SpriteBufferVerts = (RwIm2DVertex*)0x649A84; //[SPRITEBUFFERSIZE*6];
-static RwIm2DVertex *verts = (RwIm2DVertex*)0x64C484; //[4];
+static int32 nSpriteBufferIndex;
+static RwIm2DVertex SpriteBufferVerts[SPRITEBUFFERSIZE*6];
+static RwIm2DVertex verts[4];
void
CSprite::InitSpriteBuffer(void)
@@ -593,19 +593,3 @@ CSprite::RenderBufferedOneXLUSprite2D_Rotate_Dimension(float x, float y, float w
if(nSpriteBufferIndex >= SPRITEBUFFERSIZE)
FlushSpriteBuffer();
}
-
-STARTPATCHES
- InjectHook(0x51C4A0, CSprite::CalcHorizonCoors, PATCH_JUMP);
- InjectHook(0x51C3A0, CSprite::CalcScreenCoors, PATCH_JUMP);
- InjectHook(0x51C590, CSprite::InitSpriteBuffer, PATCH_JUMP);
- InjectHook(0x51C5B0, CSprite::InitSpriteBuffer2D, PATCH_JUMP);
- InjectHook(0x51C520, CSprite::FlushSpriteBuffer, PATCH_JUMP);
- InjectHook(0x51C960, CSprite::RenderOneXLUSprite, PATCH_JUMP);
- InjectHook(0x51D110, CSprite::RenderOneXLUSprite_Rotate_Aspect, PATCH_JUMP);
- InjectHook(0x51C5D0, CSprite::RenderBufferedOneXLUSprite, PATCH_JUMP);
- InjectHook(0x51D5B0, CSprite::RenderBufferedOneXLUSprite_Rotate_Dimension, PATCH_JUMP);
- InjectHook(0x51CCD0, CSprite::RenderBufferedOneXLUSprite_Rotate_Aspect, PATCH_JUMP);
- InjectHook(0x51D9E0, CSprite::RenderBufferedOneXLUSprite_Rotate_2Colours, PATCH_JUMP);
- InjectHook(0x51E3C0, CSprite::RenderBufferedOneXLUSprite2D, PATCH_JUMP);
- InjectHook(0x51E490, CSprite::RenderBufferedOneXLUSprite2D_Rotate_Dimension, PATCH_JUMP);
-ENDPATCHES
diff --git a/src/render/Sprite.h b/src/render/Sprite.h
index 33953ff3..ec4c1d1b 100644
--- a/src/render/Sprite.h
+++ b/src/render/Sprite.h
@@ -2,10 +2,10 @@
class CSprite
{
- static float &m_f2DNearScreenZ;
- static float &m_f2DFarScreenZ;
- static float &m_fRecipNearClipPlane;
- static int32 &m_bFlushSpriteBufferSwitchZTest;
+ static float m_f2DNearScreenZ;
+ static float m_f2DFarScreenZ;
+ static float m_fRecipNearClipPlane;
+ static int32 m_bFlushSpriteBufferSwitchZTest;
public:
static float CalcHorizonCoors(void);
static bool CalcScreenCoors(const RwV3d &in, RwV3d *out, float *outw, float *outh, bool farclip);
diff --git a/src/render/Sprite2d.cpp b/src/render/Sprite2d.cpp
index 655fd841..52b85018 100644
--- a/src/render/Sprite2d.cpp
+++ b/src/render/Sprite2d.cpp
@@ -1,5 +1,5 @@
#include "common.h"
-#include "patcher.h"
+
#include "main.h"
#include "Draw.h"
#include "Camera.h"
@@ -474,37 +474,3 @@ void CSprite2d::Draw2DPolygon(float x1, float y1, float x2, float y2, float x3,
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)TRUE);
RwRenderStateSet(rwRENDERSTATESHADEMODE, (void*)rwSHADEMODEGOURAUD);
}
-
-STARTPATCHES
-#define C4 const CRGBA&, const CRGBA&, const CRGBA&, const CRGBA&
-#define F8 float, float, float, float, float, float, float, float
-
- InjectHook(0x51EA20, CSprite2d::SetRecipNearClip, PATCH_JUMP);
- InjectHook(0x51EAE0, CSprite2d::InitPerFrame, PATCH_JUMP);
- InjectHook(0x51EB70, CSprite2d::GetBank, PATCH_JUMP);
- InjectHook(0x51EBC0, CSprite2d::AddSpriteToBank, PATCH_JUMP);
- InjectHook(0x51EC50, CSprite2d::DrawBank, PATCH_JUMP);
-
- InjectHook(0x51EA00, &CSprite2d::Delete, PATCH_JUMP);
- InjectHook(0x51F950, &CSprite2d::SetRenderState, PATCH_JUMP);
- InjectHook(0x51EA40, (void (CSprite2d::*)(const char*))&CSprite2d::SetTexture, PATCH_JUMP);
- InjectHook(0x51EA70, (void (CSprite2d::*)(const char*,const char*))&CSprite2d::SetTexture, PATCH_JUMP);
- InjectHook(0x51EAA0, &CSprite2d::SetAddressing, PATCH_JUMP);
-
- InjectHook(0x51EE90, (void (*)(const CRect&, C4, uint32))CSprite2d::SetVertices, PATCH_JUMP);
- InjectHook(0x51F220, (void (*)(const CRect&, C4, F8))CSprite2d::SetVertices, PATCH_JUMP);
- InjectHook(0x51F070, (void (*)(F8, C4))CSprite2d::SetVertices, PATCH_JUMP);
- InjectHook(0x51F3E0, (void (*)(int, float*, float*, const CRGBA&))CSprite2d::SetVertices, PATCH_JUMP);
- InjectHook(0x51F490, CSprite2d::SetMaskVertices, PATCH_JUMP);
- InjectHook(0x51F720, (void (*)(RwIm2DVertex*, const CRect&, C4, F8))CSprite2d::SetVertices, PATCH_JUMP);
-
- InjectHook(0x51ECE0, (void (CSprite2d::*)(float, float, float, float, const CRGBA &))&CSprite2d::Draw, PATCH_JUMP);
- InjectHook(0x51ED50, (void (CSprite2d::*)(const CRect &, const CRGBA &))&CSprite2d::Draw, PATCH_JUMP);
- InjectHook(0x51ED90, (void (CSprite2d::*)(const CRect &, const CRGBA &, F8))&CSprite2d::Draw, PATCH_JUMP);
- InjectHook(0x51EDF0, (void (CSprite2d::*)(const CRect &, C4))&CSprite2d::Draw, PATCH_JUMP);
- InjectHook(0x51EE40, (void (CSprite2d::*)(F8, const CRGBA &))&CSprite2d::Draw, PATCH_JUMP);
-
- InjectHook(0x51F970, (void (*)(const CRect&, const CRGBA&))CSprite2d::DrawRect, PATCH_JUMP);
- InjectHook(0x51FA00, (void (*)(const CRect&, C4))CSprite2d::DrawRect, PATCH_JUMP);
- InjectHook(0x51FA80, CSprite2d::DrawRectXLU, PATCH_JUMP);
-ENDPATCHES
diff --git a/src/render/Timecycle.cpp b/src/render/Timecycle.cpp
index 7ab3e91e..e47015a0 100644
--- a/src/render/Timecycle.cpp
+++ b/src/render/Timecycle.cpp
@@ -1,5 +1,5 @@
#include "common.h"
-#include "patcher.h"
+
#include "main.h"
#include "Clock.h"
#include "Weather.h"
@@ -10,101 +10,101 @@
#include "FileMgr.h"
#include "Timecycle.h"
-int (*CTimeCycle::m_nAmbientRed)[NUMWEATHERS] = (int(*)[NUMWEATHERS])0x86AF78;
-int (*CTimeCycle::m_nAmbientGreen)[NUMWEATHERS] = (int(*)[NUMWEATHERS])0x665308;
-int (*CTimeCycle::m_nAmbientBlue)[NUMWEATHERS] = (int(*)[NUMWEATHERS])0x72CF88;
-int (*CTimeCycle::m_nDirectionalRed)[NUMWEATHERS] = (int(*)[NUMWEATHERS])0x6FAB78;
-int (*CTimeCycle::m_nDirectionalGreen)[NUMWEATHERS] = (int(*)[NUMWEATHERS])0x6F4528;
-int (*CTimeCycle::m_nDirectionalBlue)[NUMWEATHERS] = (int(*)[NUMWEATHERS])0x83CE58;
-int (*CTimeCycle::m_nSkyTopRed)[NUMWEATHERS] = (int(*)[NUMWEATHERS])0x87FB90;
-int (*CTimeCycle::m_nSkyTopGreen)[NUMWEATHERS] = (int(*)[NUMWEATHERS])0x8460A8;
-int (*CTimeCycle::m_nSkyTopBlue)[NUMWEATHERS] = (int(*)[NUMWEATHERS])0x87B158;
-int (*CTimeCycle::m_nSkyBottomRed)[NUMWEATHERS] = (int(*)[NUMWEATHERS])0x6FA960;
-int (*CTimeCycle::m_nSkyBottomGreen)[NUMWEATHERS] = (int(*)[NUMWEATHERS])0x70D6A8;
-int (*CTimeCycle::m_nSkyBottomBlue)[NUMWEATHERS] = (int(*)[NUMWEATHERS])0x83D288;
-int (*CTimeCycle::m_nSunCoreRed)[NUMWEATHERS] = (int(*)[NUMWEATHERS])0x878360;
-int (*CTimeCycle::m_nSunCoreGreen)[NUMWEATHERS] = (int(*)[NUMWEATHERS])0x6EE088;
-int (*CTimeCycle::m_nSunCoreBlue)[NUMWEATHERS] = (int(*)[NUMWEATHERS])0x773A68;
-int (*CTimeCycle::m_nSunCoronaRed)[NUMWEATHERS] = (int(*)[NUMWEATHERS])0x664B60;
-int (*CTimeCycle::m_nSunCoronaGreen)[NUMWEATHERS] = (int(*)[NUMWEATHERS])0x6F01E0;
-int (*CTimeCycle::m_nSunCoronaBlue)[NUMWEATHERS] = (int(*)[NUMWEATHERS])0x6E6340;
-float (*CTimeCycle::m_fSunSize)[NUMWEATHERS] = (float(*)[NUMWEATHERS])0x733510;
-float (*CTimeCycle::m_fSpriteSize)[NUMWEATHERS] = (float(*)[NUMWEATHERS])0x87F820;
-float (*CTimeCycle::m_fSpriteBrightness)[NUMWEATHERS] = (float(*)[NUMWEATHERS])0x6E96F0;
-short (*CTimeCycle::m_nShadowStrength)[NUMWEATHERS] = (short(*)[NUMWEATHERS])0x83CFD8;
-short (*CTimeCycle::m_nLightShadowStrength)[NUMWEATHERS] = (short(*)[NUMWEATHERS])0x72B0F8;
-short (*CTimeCycle::m_nTreeShadowStrength)[NUMWEATHERS] = (short(*)[NUMWEATHERS])0x733450;
-float (*CTimeCycle::m_fFogStart)[NUMWEATHERS] = (float(*)[NUMWEATHERS])0x8806C8;
-float (*CTimeCycle::m_fFarClip)[NUMWEATHERS] = (float(*)[NUMWEATHERS])0x8804E0;
-float (*CTimeCycle::m_fLightsOnGroundBrightness)[NUMWEATHERS] = (float(*)[NUMWEATHERS])0x83D108;
-int (*CTimeCycle::m_nLowCloudsRed)[NUMWEATHERS] = (int(*)[NUMWEATHERS])0x726770;
-int (*CTimeCycle::m_nLowCloudsGreen)[NUMWEATHERS] = (int(*)[NUMWEATHERS])0x87BF08;
-int (*CTimeCycle::m_nLowCloudsBlue)[NUMWEATHERS] = (int(*)[NUMWEATHERS])0x87FA10;
-int (*CTimeCycle::m_nFluffyCloudsTopRed)[NUMWEATHERS] = (int(*)[NUMWEATHERS])0x70F2B0;
-int (*CTimeCycle::m_nFluffyCloudsTopGreen)[NUMWEATHERS] = (int(*)[NUMWEATHERS])0x72D288;
-int (*CTimeCycle::m_nFluffyCloudsTopBlue)[NUMWEATHERS] = (int(*)[NUMWEATHERS])0x86B108;
-int (*CTimeCycle::m_nFluffyCloudsBottomRed)[NUMWEATHERS] = (int(*)[NUMWEATHERS])0x6E8DA8;
-int (*CTimeCycle::m_nFluffyCloudsBottomGreen)[NUMWEATHERS] = (int(*)[NUMWEATHERS])0x715AA8;
-int (*CTimeCycle::m_nFluffyCloudsBottomBlue)[NUMWEATHERS] = (int(*)[NUMWEATHERS])0x6EE2D0;
-float (*CTimeCycle::m_fBlurRed)[NUMWEATHERS] = (float(*)[NUMWEATHERS])0x87C7E0;
-float (*CTimeCycle::m_fBlurGreen)[NUMWEATHERS] = (float(*)[NUMWEATHERS])0x774C10;
-float (*CTimeCycle::m_fBlurBlue)[NUMWEATHERS] = (float(*)[NUMWEATHERS])0x8784E0;
-float (*CTimeCycle::m_fBlurAlpha)[NUMWEATHERS] = (float(*)[NUMWEATHERS])0x733690;
-
-float &CTimeCycle::m_fCurrentAmbientRed = *(float*)0x8F29B4;
-float &CTimeCycle::m_fCurrentAmbientGreen = *(float*)0x94144C;
-float &CTimeCycle::m_fCurrentAmbientBlue = *(float*)0x942FC0;
-float &CTimeCycle::m_fCurrentDirectionalRed = *(float*)0x8F29D8;
-float &CTimeCycle::m_fCurrentDirectionalGreen = *(float*)0x940594;
-float &CTimeCycle::m_fCurrentDirectionalBlue = *(float*)0x942FAC;
-int &CTimeCycle::m_nCurrentSkyTopRed = *(int*)0x9403C0;
-int &CTimeCycle::m_nCurrentSkyTopGreen = *(int*)0x943074;
-int &CTimeCycle::m_nCurrentSkyTopBlue = *(int*)0x8F29B8;
-int &CTimeCycle::m_nCurrentSkyBottomRed = *(int*)0x9414D0;
-int &CTimeCycle::m_nCurrentSkyBottomGreen = *(int*)0x8F2BD0;
-int &CTimeCycle::m_nCurrentSkyBottomBlue = *(int*)0x8F625C;
-int &CTimeCycle::m_nCurrentSunCoreRed = *(int*)0x8F2534;
-int &CTimeCycle::m_nCurrentSunCoreGreen = *(int*)0x8F6264;
-int &CTimeCycle::m_nCurrentSunCoreBlue = *(int*)0x94149C;
-int &CTimeCycle::m_nCurrentSunCoronaRed = *(int*)0x8F2C1C;
-int &CTimeCycle::m_nCurrentSunCoronaGreen = *(int*)0x885B54;
-int &CTimeCycle::m_nCurrentSunCoronaBlue = *(int*)0x880F60;
-float &CTimeCycle::m_fCurrentSunSize = *(float*)0x940588;
-float &CTimeCycle::m_fCurrentSpriteSize = *(float*)0x8F1AA8;
-float &CTimeCycle::m_fCurrentSpriteBrightness = *(float*)0x8F5FDC;
-int &CTimeCycle::m_nCurrentShadowStrength = *(int*)0x95CC76;
-int &CTimeCycle::m_nCurrentLightShadowStrength = *(int*)0x95CC66;
-int &CTimeCycle::m_nCurrentTreeShadowStrength = *(int*)0x95CC86;
-float &CTimeCycle::m_fCurrentFogStart = *(float*)0x8F1AE0;
-float &CTimeCycle::m_fCurrentFarClip = *(float*)0x8F5FD8;
-float &CTimeCycle::m_fCurrentLightsOnGroundBrightness = *(float*)0x8F1B60;
-int &CTimeCycle::m_nCurrentLowCloudsRed = *(int*)0x95CB54;
-int &CTimeCycle::m_nCurrentLowCloudsGreen = *(int*)0x95CB48;
-int &CTimeCycle::m_nCurrentLowCloudsBlue = *(int*)0x95CC1C;
-int &CTimeCycle::m_nCurrentFluffyCloudsTopRed = *(int*)0x8F2550;
-int &CTimeCycle::m_nCurrentFluffyCloudsTopGreen = *(int*)0x8F59CC;
-int &CTimeCycle::m_nCurrentFluffyCloudsTopBlue = *(int*)0x941434;
-int &CTimeCycle::m_nCurrentFluffyCloudsBottomRed = *(int*)0x8F1A38;
-int &CTimeCycle::m_nCurrentFluffyCloudsBottomGreen = *(int*)0x8E28B8;
-int &CTimeCycle::m_nCurrentFluffyCloudsBottomBlue = *(int*)0x8F3960;
-float &CTimeCycle::m_fCurrentBlurRed = *(float*)0x8F6000;
-float &CTimeCycle::m_fCurrentBlurGreen = *(float*)0x9405A0;
-float &CTimeCycle::m_fCurrentBlurBlue = *(float*)0x8F250C;
-float &CTimeCycle::m_fCurrentBlurAlpha = *(float*)0x940728;
-int &CTimeCycle::m_nCurrentFogColourRed = *(int*)0x940714;
-int &CTimeCycle::m_nCurrentFogColourGreen = *(int*)0x8E2A60;
-int &CTimeCycle::m_nCurrentFogColourBlue = *(int*)0x8F57EC;
-
-int &CTimeCycle::m_FogReduction = *(int*)0x880FB8;
-
-int &CTimeCycle::m_CurrentStoredValue = *(int*)0x94057C;
-CVector *CTimeCycle::m_VectorToSun = (CVector*)0x665548; // [16]
-float *CTimeCycle::m_fShadowFrontX = (float*)0x72CE90;
-float *CTimeCycle::m_fShadowFrontY = (float*)0x72CE50;
-float *CTimeCycle::m_fShadowSideX = (float*)0x87C708;
-float *CTimeCycle::m_fShadowSideY = (float*)0x87C6C8;
-float *CTimeCycle::m_fShadowDisplacementX = (float*)0x6F0748;
-float *CTimeCycle::m_fShadowDisplacementY = (float*)0x6F0788;
+int CTimeCycle::m_nAmbientRed[NUMHOURS][NUMWEATHERS];
+int CTimeCycle::m_nAmbientGreen[NUMHOURS][NUMWEATHERS];
+int CTimeCycle::m_nAmbientBlue[NUMHOURS][NUMWEATHERS];
+int CTimeCycle::m_nDirectionalRed[NUMHOURS][NUMWEATHERS];
+int CTimeCycle::m_nDirectionalGreen[NUMHOURS][NUMWEATHERS];
+int CTimeCycle::m_nDirectionalBlue[NUMHOURS][NUMWEATHERS];
+int CTimeCycle::m_nSkyTopRed[NUMHOURS][NUMWEATHERS];
+int CTimeCycle::m_nSkyTopGreen[NUMHOURS][NUMWEATHERS];
+int CTimeCycle::m_nSkyTopBlue[NUMHOURS][NUMWEATHERS];
+int CTimeCycle::m_nSkyBottomRed[NUMHOURS][NUMWEATHERS];
+int CTimeCycle::m_nSkyBottomGreen[NUMHOURS][NUMWEATHERS];
+int CTimeCycle::m_nSkyBottomBlue[NUMHOURS][NUMWEATHERS];
+int CTimeCycle::m_nSunCoreRed[NUMHOURS][NUMWEATHERS];
+int CTimeCycle::m_nSunCoreGreen[NUMHOURS][NUMWEATHERS];
+int CTimeCycle::m_nSunCoreBlue[NUMHOURS][NUMWEATHERS];
+int CTimeCycle::m_nSunCoronaRed[NUMHOURS][NUMWEATHERS];
+int CTimeCycle::m_nSunCoronaGreen[NUMHOURS][NUMWEATHERS];
+int CTimeCycle::m_nSunCoronaBlue[NUMHOURS][NUMWEATHERS];
+float CTimeCycle::m_fSunSize[NUMHOURS][NUMWEATHERS];
+float CTimeCycle::m_fSpriteSize[NUMHOURS][NUMWEATHERS];
+float CTimeCycle::m_fSpriteBrightness[NUMHOURS][NUMWEATHERS];
+short CTimeCycle::m_nShadowStrength[NUMHOURS][NUMWEATHERS];
+short CTimeCycle::m_nLightShadowStrength[NUMHOURS][NUMWEATHERS];
+short CTimeCycle::m_nTreeShadowStrength[NUMHOURS][NUMWEATHERS];
+float CTimeCycle::m_fFogStart[NUMHOURS][NUMWEATHERS];
+float CTimeCycle::m_fFarClip[NUMHOURS][NUMWEATHERS];
+float CTimeCycle::m_fLightsOnGroundBrightness[NUMHOURS][NUMWEATHERS];
+int CTimeCycle::m_nLowCloudsRed[NUMHOURS][NUMWEATHERS];
+int CTimeCycle::m_nLowCloudsGreen[NUMHOURS][NUMWEATHERS];
+int CTimeCycle::m_nLowCloudsBlue[NUMHOURS][NUMWEATHERS];
+int CTimeCycle::m_nFluffyCloudsTopRed[NUMHOURS][NUMWEATHERS];
+int CTimeCycle::m_nFluffyCloudsTopGreen[NUMHOURS][NUMWEATHERS];
+int CTimeCycle::m_nFluffyCloudsTopBlue[NUMHOURS][NUMWEATHERS];
+int CTimeCycle::m_nFluffyCloudsBottomRed[NUMHOURS][NUMWEATHERS];
+int CTimeCycle::m_nFluffyCloudsBottomGreen[NUMHOURS][NUMWEATHERS];
+int CTimeCycle::m_nFluffyCloudsBottomBlue[NUMHOURS][NUMWEATHERS];
+float CTimeCycle::m_fBlurRed[NUMHOURS][NUMWEATHERS];
+float CTimeCycle::m_fBlurGreen[NUMHOURS][NUMWEATHERS];
+float CTimeCycle::m_fBlurBlue[NUMHOURS][NUMWEATHERS];
+float CTimeCycle::m_fBlurAlpha[NUMHOURS][NUMWEATHERS];
+
+float CTimeCycle::m_fCurrentAmbientRed;
+float CTimeCycle::m_fCurrentAmbientGreen;
+float CTimeCycle::m_fCurrentAmbientBlue;
+float CTimeCycle::m_fCurrentDirectionalRed;
+float CTimeCycle::m_fCurrentDirectionalGreen;
+float CTimeCycle::m_fCurrentDirectionalBlue;
+int CTimeCycle::m_nCurrentSkyTopRed;
+int CTimeCycle::m_nCurrentSkyTopGreen;
+int CTimeCycle::m_nCurrentSkyTopBlue;
+int CTimeCycle::m_nCurrentSkyBottomRed;
+int CTimeCycle::m_nCurrentSkyBottomGreen;
+int CTimeCycle::m_nCurrentSkyBottomBlue;
+int CTimeCycle::m_nCurrentSunCoreRed;
+int CTimeCycle::m_nCurrentSunCoreGreen;
+int CTimeCycle::m_nCurrentSunCoreBlue;
+int CTimeCycle::m_nCurrentSunCoronaRed;
+int CTimeCycle::m_nCurrentSunCoronaGreen;
+int CTimeCycle::m_nCurrentSunCoronaBlue;
+float CTimeCycle::m_fCurrentSunSize;
+float CTimeCycle::m_fCurrentSpriteSize;
+float CTimeCycle::m_fCurrentSpriteBrightness;
+int CTimeCycle::m_nCurrentShadowStrength;
+int CTimeCycle::m_nCurrentLightShadowStrength;
+int CTimeCycle::m_nCurrentTreeShadowStrength;
+float CTimeCycle::m_fCurrentFogStart;
+float CTimeCycle::m_fCurrentFarClip;
+float CTimeCycle::m_fCurrentLightsOnGroundBrightness;
+int CTimeCycle::m_nCurrentLowCloudsRed;
+int CTimeCycle::m_nCurrentLowCloudsGreen;
+int CTimeCycle::m_nCurrentLowCloudsBlue;
+int CTimeCycle::m_nCurrentFluffyCloudsTopRed;
+int CTimeCycle::m_nCurrentFluffyCloudsTopGreen;
+int CTimeCycle::m_nCurrentFluffyCloudsTopBlue;
+int CTimeCycle::m_nCurrentFluffyCloudsBottomRed;
+int CTimeCycle::m_nCurrentFluffyCloudsBottomGreen;
+int CTimeCycle::m_nCurrentFluffyCloudsBottomBlue;
+float CTimeCycle::m_fCurrentBlurRed;
+float CTimeCycle::m_fCurrentBlurGreen;
+float CTimeCycle::m_fCurrentBlurBlue;
+float CTimeCycle::m_fCurrentBlurAlpha;
+int CTimeCycle::m_nCurrentFogColourRed;
+int CTimeCycle::m_nCurrentFogColourGreen;
+int CTimeCycle::m_nCurrentFogColourBlue;
+
+int CTimeCycle::m_FogReduction;
+
+int CTimeCycle::m_CurrentStoredValue;
+CVector CTimeCycle::m_VectorToSun[16];
+float CTimeCycle::m_fShadowFrontX[16];
+float CTimeCycle::m_fShadowFrontY[16];
+float CTimeCycle::m_fShadowSideX[16];
+float CTimeCycle::m_fShadowSideY[16];
+float CTimeCycle::m_fShadowDisplacementX[16];
+float CTimeCycle::m_fShadowDisplacementY[16];
void
@@ -315,8 +315,3 @@ CTimeCycle::Update(void)
else
m_FogReduction = max(m_FogReduction-1, 0);
}
-
-STARTPATCHES
- InjectHook(0x4ABAE0, CTimeCycle::Initialise, PATCH_JUMP);
- InjectHook(0x4ABF40, CTimeCycle::Update, PATCH_JUMP);
-ENDPATCHES
diff --git a/src/render/Timecycle.h b/src/render/Timecycle.h
index ed4a026b..28a0b7dd 100644
--- a/src/render/Timecycle.h
+++ b/src/render/Timecycle.h
@@ -2,102 +2,102 @@
class CTimeCycle
{
- static int (*m_nAmbientRed)[NUMWEATHERS];
- static int (*m_nAmbientGreen)[NUMWEATHERS];
- static int (*m_nAmbientBlue)[NUMWEATHERS];
- static int (*m_nDirectionalRed)[NUMWEATHERS];
- static int (*m_nDirectionalGreen)[NUMWEATHERS];
- static int (*m_nDirectionalBlue)[NUMWEATHERS];
- static int (*m_nSkyTopRed)[NUMWEATHERS];
- static int (*m_nSkyTopGreen)[NUMWEATHERS];
- static int (*m_nSkyTopBlue)[NUMWEATHERS];
- static int (*m_nSkyBottomRed)[NUMWEATHERS];
- static int (*m_nSkyBottomGreen)[NUMWEATHERS];
- static int (*m_nSkyBottomBlue)[NUMWEATHERS];
- static int (*m_nSunCoreRed)[NUMWEATHERS];
- static int (*m_nSunCoreGreen)[NUMWEATHERS];
- static int (*m_nSunCoreBlue)[NUMWEATHERS];
- static int (*m_nSunCoronaRed)[NUMWEATHERS];
- static int (*m_nSunCoronaGreen)[NUMWEATHERS];
- static int (*m_nSunCoronaBlue)[NUMWEATHERS];
- static float (*m_fSunSize)[NUMWEATHERS];
- static float (*m_fSpriteSize)[NUMWEATHERS];
- static float (*m_fSpriteBrightness)[NUMWEATHERS];
- static short (*m_nShadowStrength)[NUMWEATHERS];
- static short (*m_nLightShadowStrength)[NUMWEATHERS];
- static short (*m_nTreeShadowStrength)[NUMWEATHERS];
- static float (*m_fFogStart)[NUMWEATHERS];
- static float (*m_fFarClip)[NUMWEATHERS];
- static float (*m_fLightsOnGroundBrightness)[NUMWEATHERS];
- static int (*m_nLowCloudsRed)[NUMWEATHERS];
- static int (*m_nLowCloudsGreen)[NUMWEATHERS];
- static int (*m_nLowCloudsBlue)[NUMWEATHERS];
- static int (*m_nFluffyCloudsTopRed)[NUMWEATHERS];
- static int (*m_nFluffyCloudsTopGreen)[NUMWEATHERS];
- static int (*m_nFluffyCloudsTopBlue)[NUMWEATHERS];
- static int (*m_nFluffyCloudsBottomRed)[NUMWEATHERS];
- static int (*m_nFluffyCloudsBottomGreen)[NUMWEATHERS];
- static int (*m_nFluffyCloudsBottomBlue)[NUMWEATHERS];
- static float (*m_fBlurRed)[NUMWEATHERS];
- static float (*m_fBlurGreen)[NUMWEATHERS];
- static float (*m_fBlurBlue)[NUMWEATHERS];
- static float (*m_fBlurAlpha)[NUMWEATHERS];
+ static int m_nAmbientRed[NUMHOURS][NUMWEATHERS];
+ static int m_nAmbientGreen[NUMHOURS][NUMWEATHERS];
+ static int m_nAmbientBlue[NUMHOURS][NUMWEATHERS];
+ static int m_nDirectionalRed[NUMHOURS][NUMWEATHERS];
+ static int m_nDirectionalGreen[NUMHOURS][NUMWEATHERS];
+ static int m_nDirectionalBlue[NUMHOURS][NUMWEATHERS];
+ static int m_nSkyTopRed[NUMHOURS][NUMWEATHERS];
+ static int m_nSkyTopGreen[NUMHOURS][NUMWEATHERS];
+ static int m_nSkyTopBlue[NUMHOURS][NUMWEATHERS];
+ static int m_nSkyBottomRed[NUMHOURS][NUMWEATHERS];
+ static int m_nSkyBottomGreen[NUMHOURS][NUMWEATHERS];
+ static int m_nSkyBottomBlue[NUMHOURS][NUMWEATHERS];
+ static int m_nSunCoreRed[NUMHOURS][NUMWEATHERS];
+ static int m_nSunCoreGreen[NUMHOURS][NUMWEATHERS];
+ static int m_nSunCoreBlue[NUMHOURS][NUMWEATHERS];
+ static int m_nSunCoronaRed[NUMHOURS][NUMWEATHERS];
+ static int m_nSunCoronaGreen[NUMHOURS][NUMWEATHERS];
+ static int m_nSunCoronaBlue[NUMHOURS][NUMWEATHERS];
+ static float m_fSunSize[NUMHOURS][NUMWEATHERS];
+ static float m_fSpriteSize[NUMHOURS][NUMWEATHERS];
+ static float m_fSpriteBrightness[NUMHOURS][NUMWEATHERS];
+ static short m_nShadowStrength[NUMHOURS][NUMWEATHERS];
+ static short m_nLightShadowStrength[NUMHOURS][NUMWEATHERS];
+ static short m_nTreeShadowStrength[NUMHOURS][NUMWEATHERS];
+ static float m_fFogStart[NUMHOURS][NUMWEATHERS];
+ static float m_fFarClip[NUMHOURS][NUMWEATHERS];
+ static float m_fLightsOnGroundBrightness[NUMHOURS][NUMWEATHERS];
+ static int m_nLowCloudsRed[NUMHOURS][NUMWEATHERS];
+ static int m_nLowCloudsGreen[NUMHOURS][NUMWEATHERS];
+ static int m_nLowCloudsBlue[NUMHOURS][NUMWEATHERS];
+ static int m_nFluffyCloudsTopRed[NUMHOURS][NUMWEATHERS];
+ static int m_nFluffyCloudsTopGreen[NUMHOURS][NUMWEATHERS];
+ static int m_nFluffyCloudsTopBlue[NUMHOURS][NUMWEATHERS];
+ static int m_nFluffyCloudsBottomRed[NUMHOURS][NUMWEATHERS];
+ static int m_nFluffyCloudsBottomGreen[NUMHOURS][NUMWEATHERS];
+ static int m_nFluffyCloudsBottomBlue[NUMHOURS][NUMWEATHERS];
+ static float m_fBlurRed[NUMHOURS][NUMWEATHERS];
+ static float m_fBlurGreen[NUMHOURS][NUMWEATHERS];
+ static float m_fBlurBlue[NUMHOURS][NUMWEATHERS];
+ static float m_fBlurAlpha[NUMHOURS][NUMWEATHERS];
- static float &m_fCurrentAmbientRed;
- static float &m_fCurrentAmbientGreen;
- static float &m_fCurrentAmbientBlue;
- static float &m_fCurrentDirectionalRed;
- static float &m_fCurrentDirectionalGreen;
- static float &m_fCurrentDirectionalBlue;
- static int &m_nCurrentSkyTopRed;
- static int &m_nCurrentSkyTopGreen;
- static int &m_nCurrentSkyTopBlue;
- static int &m_nCurrentSkyBottomRed;
- static int &m_nCurrentSkyBottomGreen;
- static int &m_nCurrentSkyBottomBlue;
- static int &m_nCurrentSunCoreRed;
- static int &m_nCurrentSunCoreGreen;
- static int &m_nCurrentSunCoreBlue;
- static int &m_nCurrentSunCoronaRed;
- static int &m_nCurrentSunCoronaGreen;
- static int &m_nCurrentSunCoronaBlue;
- static float &m_fCurrentSunSize;
- static float &m_fCurrentSpriteSize;
- static float &m_fCurrentSpriteBrightness;
- static int &m_nCurrentShadowStrength;
- static int &m_nCurrentLightShadowStrength;
- static int &m_nCurrentTreeShadowStrength;
- static float &m_fCurrentFogStart;
- static float &m_fCurrentFarClip;
- static float &m_fCurrentLightsOnGroundBrightness;
- static int &m_nCurrentLowCloudsRed;
- static int &m_nCurrentLowCloudsGreen;
- static int &m_nCurrentLowCloudsBlue;
- static int &m_nCurrentFluffyCloudsTopRed;
- static int &m_nCurrentFluffyCloudsTopGreen;
- static int &m_nCurrentFluffyCloudsTopBlue;
- static int &m_nCurrentFluffyCloudsBottomRed;
- static int &m_nCurrentFluffyCloudsBottomGreen;
- static int &m_nCurrentFluffyCloudsBottomBlue;
- static float &m_fCurrentBlurRed;
- static float &m_fCurrentBlurGreen;
- static float &m_fCurrentBlurBlue;
- static float &m_fCurrentBlurAlpha;
- static int &m_nCurrentFogColourRed;
- static int &m_nCurrentFogColourGreen;
- static int &m_nCurrentFogColourBlue;
+ static float m_fCurrentAmbientRed;
+ static float m_fCurrentAmbientGreen;
+ static float m_fCurrentAmbientBlue;
+ static float m_fCurrentDirectionalRed;
+ static float m_fCurrentDirectionalGreen;
+ static float m_fCurrentDirectionalBlue;
+ static int m_nCurrentSkyTopRed;
+ static int m_nCurrentSkyTopGreen;
+ static int m_nCurrentSkyTopBlue;
+ static int m_nCurrentSkyBottomRed;
+ static int m_nCurrentSkyBottomGreen;
+ static int m_nCurrentSkyBottomBlue;
+ static int m_nCurrentSunCoreRed;
+ static int m_nCurrentSunCoreGreen;
+ static int m_nCurrentSunCoreBlue;
+ static int m_nCurrentSunCoronaRed;
+ static int m_nCurrentSunCoronaGreen;
+ static int m_nCurrentSunCoronaBlue;
+ static float m_fCurrentSunSize;
+ static float m_fCurrentSpriteSize;
+ static float m_fCurrentSpriteBrightness;
+ static int m_nCurrentShadowStrength;
+ static int m_nCurrentLightShadowStrength;
+ static int m_nCurrentTreeShadowStrength;
+ static float m_fCurrentFogStart;
+ static float m_fCurrentFarClip;
+ static float m_fCurrentLightsOnGroundBrightness;
+ static int m_nCurrentLowCloudsRed;
+ static int m_nCurrentLowCloudsGreen;
+ static int m_nCurrentLowCloudsBlue;
+ static int m_nCurrentFluffyCloudsTopRed;
+ static int m_nCurrentFluffyCloudsTopGreen;
+ static int m_nCurrentFluffyCloudsTopBlue;
+ static int m_nCurrentFluffyCloudsBottomRed;
+ static int m_nCurrentFluffyCloudsBottomGreen;
+ static int m_nCurrentFluffyCloudsBottomBlue;
+ static float m_fCurrentBlurRed;
+ static float m_fCurrentBlurGreen;
+ static float m_fCurrentBlurBlue;
+ static float m_fCurrentBlurAlpha;
+ static int m_nCurrentFogColourRed;
+ static int m_nCurrentFogColourGreen;
+ static int m_nCurrentFogColourBlue;
- static int &m_FogReduction;
+ static int m_FogReduction;
public:
- static int &m_CurrentStoredValue;
- static CVector *m_VectorToSun; // [16]
- static float *m_fShadowFrontX; // [16]
- static float *m_fShadowFrontY; // [16]
- static float *m_fShadowSideX; // [16]
- static float *m_fShadowSideY; // [16]
- static float *m_fShadowDisplacementX; // [16]
- static float *m_fShadowDisplacementY; // [16]
+ static int m_CurrentStoredValue;
+ static CVector m_VectorToSun[16];
+ static float m_fShadowFrontX[16];
+ static float m_fShadowFrontY[16];
+ static float m_fShadowSideX[16];
+ static float m_fShadowSideY[16];
+ static float m_fShadowDisplacementX[16];
+ static float m_fShadowDisplacementY[16];
static float GetAmbientRed(void) { return m_fCurrentAmbientRed; }
static float GetAmbientGreen(void) { return m_fCurrentAmbientGreen; }
diff --git a/src/render/WaterCannon.cpp b/src/render/WaterCannon.cpp
index e848fb43..1a9b983f 100644
--- a/src/render/WaterCannon.cpp
+++ b/src/render/WaterCannon.cpp
@@ -1,5 +1,5 @@
#include "common.h"
-#include "patcher.h"
+
#include "WaterCannon.h"
#include "Vector.h"
#include "General.h"
@@ -304,17 +304,3 @@ void CWaterCannons::Render(void)
aCannons[i].Render();
}
}
-
-STARTPATCHES
- InjectHook(0x521A30, &CWaterCannon::Init, PATCH_JUMP);
- InjectHook(0x521B80, &CWaterCannon::Update_OncePerFrame, PATCH_JUMP);
- InjectHook(0x521CC0, &CWaterCannon::Update_NewInput, PATCH_JUMP);
- InjectHook(0x521D30, &CWaterCannon::Render, PATCH_JUMP);
- InjectHook(0x5220B0, &CWaterCannon::PushPeds, PATCH_JUMP);
- InjectHook(0x522440, CWaterCannons::Init, PATCH_JUMP);
- InjectHook(0x522470, CWaterCannons::UpdateOne, PATCH_JUMP);
- InjectHook(0x522510, CWaterCannons::Update, PATCH_JUMP);
- InjectHook(0x522550, CWaterCannons::Render, PATCH_JUMP);
- //InjectHook(0x522B40, `global constructor keyed to'watercannon.cpp, PATCH_JUMP);
- //InjectHook(0x522B60, CWaterCannon::CWaterCannon, PATCH_JUMP);
-ENDPATCHES \ No newline at end of file
diff --git a/src/render/WaterLevel.cpp b/src/render/WaterLevel.cpp
index a1c2af93..ad0b3ec4 100644
--- a/src/render/WaterLevel.cpp
+++ b/src/render/WaterLevel.cpp
@@ -21,7 +21,7 @@
#include "RenderBuffer.h"
#include <rpworld.h>
#include "WaterLevel.h"
-#include "patcher.h"
+
float TEXTURE_ADDU;
float TEXTURE_ADDV;
@@ -39,8 +39,8 @@ int16 CWaterLevel::nGeomUsed;
//RwTexture *gpWaterTex;
//RwRaster *gpWaterRaster;
-RwTexture *&gpWaterTex = *(RwTexture **)0x64D070;
-RwRaster *&gpWaterRaster = *(RwRaster **)0x8F5FD4;
+RwTexture *gpWaterTex;
+RwRaster *gpWaterRaster;
const float fAdd1 = 180.0f;
@@ -1234,22 +1234,3 @@ CWaterLevel::FreeBoatWakeArray()
nGeomUsed = 0;
}
-
-STARTPATCHES
- InjectHook(0x554EA0, &CWaterLevel::Initialise, PATCH_JUMP);
- InjectHook(0x554FE0, &CWaterLevel::Shutdown, PATCH_JUMP);
- InjectHook(0x555010, &CWaterLevel::CreateWavyAtomic, PATCH_JUMP);
- InjectHook(0x5552A0, &CWaterLevel::DestroyWavyAtomic, PATCH_JUMP);
- InjectHook(0x5552C0, (bool (*)(float,float,float,float*,bool))&CWaterLevel::GetWaterLevel, PATCH_JUMP);
- InjectHook(0x555440, &CWaterLevel::GetWaterLevelNoWaves, PATCH_JUMP);
- InjectHook(0x5554E0, &CWaterLevel::RenderWater, PATCH_JUMP);
- InjectHook(0x556C30, &CWaterLevel::RenderOneFlatSmallWaterPoly, PATCH_JUMP);
- InjectHook(0x556E80, &CWaterLevel::RenderOneFlatLargeWaterPoly, PATCH_JUMP);
- InjectHook(0x5570D0, &CWaterLevel::RenderOneFlatHugeWaterPoly, PATCH_JUMP);
- InjectHook(0x557320, &CWaterLevel::RenderOneFlatExtraHugeWaterPoly, PATCH_JUMP);
- InjectHook(0x557570, &CWaterLevel::RenderOneWavySector, PATCH_JUMP);
- InjectHook(0x557C30, &CWaterLevel::CalcDistanceToWater, PATCH_JUMP);
- InjectHook(0x557EA0, &CWaterLevel::RenderAndEmptyRenderBuffer, PATCH_JUMP);
- InjectHook(0x557F00, &CWaterLevel::AllocateBoatWakeArray, PATCH_JUMP);
- InjectHook(0x5581C0, &CWaterLevel::FreeBoatWakeArray, PATCH_JUMP);
-ENDPATCHES
diff --git a/src/render/WaterLevel.h b/src/render/WaterLevel.h
index 827e83d2..a471bc52 100644
--- a/src/render/WaterLevel.h
+++ b/src/render/WaterLevel.h
@@ -64,7 +64,7 @@
#define MAX_BOAT_WAKES 8
-extern RwRaster*& gpWaterRaster;
+extern RwRaster* gpWaterRaster;
class CWaterLevel
{
diff --git a/src/render/Weather.cpp b/src/render/Weather.cpp
index 7aa2778f..8bc544c6 100644
--- a/src/render/Weather.cpp
+++ b/src/render/Weather.cpp
@@ -1,5 +1,5 @@
#include "common.h"
-#include "patcher.h"
+
#include "Weather.h"
#include "Camera.h"
@@ -18,35 +18,35 @@
#include "World.h"
#include "ZoneCull.h"
-int32 &CWeather::SoundHandle = *(int32*)0x5FFBC4;
-
-int32 &CWeather::WeatherTypeInList = *(int32*)0x8F626C;
-int16 &CWeather::OldWeatherType = *(int16*)0x95CCEC;
-int16 &CWeather::NewWeatherType = *(int16*)0x95CC70;
-int16 &CWeather::ForcedWeatherType = *(int16*)0x95CC80;
-
-bool &CWeather::LightningFlash = *(bool*)0x95CDA3;
-bool &CWeather::LightningBurst = *(bool*)0x95CDAC;
-uint32 &CWeather::LightningStart = *(uint32*)0x8F5F84;
-uint32 &CWeather::LightningFlashLastChange = *(uint32*)0x8E2C0C;
-uint32 &CWeather::WhenToPlayLightningSound = *(uint32*)0x8F57E4;
-uint32 &CWeather::LightningDuration = *(uint32*)0x940578;
-
-float &CWeather::Foggyness = *(float*)0x885AF4;
-float &CWeather::CloudCoverage = *(float*)0x8E2818;
-float &CWeather::Wind = *(float*)0x8E2BF8;
-float &CWeather::Rain = *(float*)0x8E2BFC;
-float &CWeather::InterpolationValue = *(float*)0x8F2520;
-float &CWeather::WetRoads = *(float*)0x8F5FF8;
-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;
+int32 CWeather::SoundHandle = -1;
+
+int32 CWeather::WeatherTypeInList;
+int16 CWeather::OldWeatherType;
+int16 CWeather::NewWeatherType;
+int16 CWeather::ForcedWeatherType;
+
+bool CWeather::LightningFlash;
+bool CWeather::LightningBurst;
+uint32 CWeather::LightningStart;
+uint32 CWeather::LightningFlashLastChange;
+uint32 CWeather::WhenToPlayLightningSound;
+uint32 CWeather::LightningDuration;
+
+float CWeather::Foggyness;
+float CWeather::CloudCoverage;
+float CWeather::Wind;
+float CWeather::Rain;
+float CWeather::InterpolationValue;
+float CWeather::WetRoads;
+float CWeather::Rainbow;
+
+bool CWeather::bScriptsForceRain;
+bool CWeather::Stored_StateStored;
+
+float CWeather::Stored_InterpolationValue;
+int16 CWeather::Stored_OldWeatherType;
+int16 CWeather::Stored_NewWeatherType;
+float CWeather::Stored_Rain;
tRainStreak Streaks[NUM_RAIN_STREAKS];
diff --git a/src/render/Weather.h b/src/render/Weather.h
index 9e4ea378..9c670317 100644
--- a/src/render/Weather.h
+++ b/src/render/Weather.h
@@ -16,34 +16,34 @@ public:
WEATHER_FOGGY = 3,
WEATHER_TOTAL = 4
};
- static int32 &SoundHandle;
+ static int32 SoundHandle;
- static int32 &WeatherTypeInList;
- static int16 &OldWeatherType;
- static int16 &NewWeatherType;
- static int16 &ForcedWeatherType;
+ static int32 WeatherTypeInList;
+ static int16 OldWeatherType;
+ static int16 NewWeatherType;
+ static int16 ForcedWeatherType;
- static bool &LightningFlash;
- static bool &LightningBurst;
- static uint32 &LightningStart;
- static uint32 &LightningFlashLastChange;
- static uint32 &WhenToPlayLightningSound;
- static uint32 &LightningDuration;
+ static bool LightningFlash;
+ static bool LightningBurst;
+ static uint32 LightningStart;
+ static uint32 LightningFlashLastChange;
+ static uint32 WhenToPlayLightningSound;
+ static uint32 LightningDuration;
- static float &Foggyness;
- static float &CloudCoverage;
- static float &Wind;
- static float &Rain;
- static float &InterpolationValue;
- static float &WetRoads;
- static float &Rainbow;
+ static float Foggyness;
+ static float CloudCoverage;
+ static float Wind;
+ static float Rain;
+ static float InterpolationValue;
+ static float WetRoads;
+ static float Rainbow;
- static bool &bScriptsForceRain;
- static bool &Stored_StateStored;
- static float &Stored_InterpolationValue;
- static int16 &Stored_OldWeatherType;
- static int16 &Stored_NewWeatherType;
- static float &Stored_Rain;
+ 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);
@@ -68,4 +68,4 @@ struct tRainStreak
uint32 timer;
};
-extern RwTexture* (&gpRainDropTex)[4]; \ No newline at end of file
+extern RwTexture* gpRainDropTex[4]; \ No newline at end of file