summaryrefslogtreecommitdiffstats
path: root/src/render
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/render/Console.cpp43
-rw-r--r--src/render/Console.h24
-rw-r--r--src/render/Glass.cpp1
-rw-r--r--src/render/Glass.h1
-rw-r--r--src/render/Rubbish.cpp1
-rw-r--r--src/render/Rubbish.h1
-rw-r--r--src/render/Skidmarks.cpp2
-rw-r--r--src/render/Skidmarks.h1
-rw-r--r--src/render/SpecialFX.cpp1
-rw-r--r--src/render/SpecialFX.h1
-rw-r--r--src/render/WaterCannon.cpp1
-rw-r--r--src/render/WaterCannon.h1
-rw-r--r--src/render/WeaponEffects.cpp20
-rw-r--r--src/render/WeaponEffects.h1
-rw-r--r--src/render/Weather.cpp1
-rw-r--r--src/render/Weather.h1
16 files changed, 101 insertions, 0 deletions
diff --git a/src/render/Console.cpp b/src/render/Console.cpp
new file mode 100644
index 00000000..b4a10e54
--- /dev/null
+++ b/src/render/Console.cpp
@@ -0,0 +1,43 @@
+#include "Console.h"
+
+#include "Font.h"
+#include "Timer.h"
+
+#define CONSOLE_MESSAGE_SHOW_TIME 20000
+#define CONSOLE_MESSAGE_HEIGHT 12.0f
+#define CONSOLE_MESSAGE_X_OFFSET 30.0f
+#define CONSOLE_MESSAGE_Y_OFFSET 10.0f
+#define CONSOLE_MESSAGE_X_SHADOW_OFFSET 1.0f
+#define CONSOLE_MESSAGE_Y_SHADOW_OFFSET 1.0f
+
+CConsole& TheConsole = *(CConsole*)0x8F6498;
+
+void CConsole::Display()
+{
+ CFont::SetPropOn();
+ CFont::SetBackgroundOff();
+ CFont::SetScale(0.6f, 0.6f);
+ CFont::SetCentreOff();
+ CFont::SetRightJustifyOff();
+ CFont::SetBackGroundOnlyTextOff();
+ CFont::SetFontStyle(0);
+ CFont::SetPropOff();
+ CFont::SetWrapx(RsGlobal.width);
+ while (m_nActiveMessages != 0 && CTimer::GetTimeInMilliseconds() - m_anTimeStart[m_nCurrentMessage] > CONSOLE_MESSAGE_SHOW_TIME) {
+ m_nActiveMessages--;
+ m_nCurrentMessage = (m_nCurrentMessage + 1) % NUM_CONSOLEMESSAGES;
+ }
+ for (int i = 0; i < m_nActiveMessages; i++) {
+ int actualIndex = (i + m_nCurrentMessage) % NUM_CONSOLEMESSAGES;
+ CFont::SetColor(CRGBA(0, 0, 0, 200));
+ CFont::PrintString(
+ CONSOLE_MESSAGE_X_OFFSET + CONSOLE_MESSAGE_X_SHADOW_OFFSET,
+ CONSOLE_MESSAGE_Y_OFFSET + CONSOLE_MESSAGE_Y_SHADOW_OFFSET + i * CONSOLE_MESSAGE_HEIGHT,
+ m_asMessages[actualIndex]);
+ CFont::SetColor(CRGBA(m_anColourRed[actualIndex], m_anColourGreen[actualIndex], m_anColourBlue[actualIndex], 200));
+ CFont::PrintString(
+ CONSOLE_MESSAGE_X_OFFSET,
+ CONSOLE_MESSAGE_Y_OFFSET + i * CONSOLE_MESSAGE_HEIGHT,
+ m_asMessages[actualIndex]);
+ }
+} \ No newline at end of file
diff --git a/src/render/Console.h b/src/render/Console.h
new file mode 100644
index 00000000..726f96cf
--- /dev/null
+++ b/src/render/Console.h
@@ -0,0 +1,24 @@
+#pragma once
+#include "common.h"
+
+class CConsole
+{
+ enum {
+ MAX_MESSAGE_LENGTH = 40
+ };
+ uint8 m_nActiveMessages;
+ uint8 m_nCurrentMessage;
+ wchar m_asMessages[NUM_CONSOLEMESSAGES][MAX_MESSAGE_LENGTH];
+ uint32 m_anTimeStart[NUM_CONSOLEMESSAGES];
+ uint8 m_anColourRed[NUM_CONSOLEMESSAGES];
+ uint8 m_anColourGreen[NUM_CONSOLEMESSAGES];
+ uint8 m_anColourBlue[NUM_CONSOLEMESSAGES];
+
+public:
+ void Init() { m_nCurrentMessage = 0; m_nActiveMessages = 0; }
+ void Display();
+};
+
+extern CConsole& TheConsole;
+
+static_assert(sizeof(CConsole) == 0x2BC, "CConsole: error"); \ No newline at end of file
diff --git a/src/render/Glass.cpp b/src/render/Glass.cpp
index 5d7dcc86..ac04032b 100644
--- a/src/render/Glass.cpp
+++ b/src/render/Glass.cpp
@@ -18,3 +18,4 @@ CGlass::WindowRespondsToSoftCollision(CEntity *ent, float amount)
WRAPPER void CGlass::Render(void) { EAXJMP(0x502350); }
WRAPPER void CGlass::Update(void) { EAXJMP(0x502050); }
+WRAPPER void CGlass::Init(void) { EAXJMP(0x501F20); }
diff --git a/src/render/Glass.h b/src/render/Glass.h
index b29cf173..ad4d50f2 100644
--- a/src/render/Glass.h
+++ b/src/render/Glass.h
@@ -10,4 +10,5 @@ public:
static void WindowRespondsToSoftCollision(CEntity *ent, float amount);
static void Render(void);
static void Update(void);
+ static void Init(void);
};
diff --git a/src/render/Rubbish.cpp b/src/render/Rubbish.cpp
index 5fa695ea..c336eb47 100644
--- a/src/render/Rubbish.cpp
+++ b/src/render/Rubbish.cpp
@@ -6,3 +6,4 @@ WRAPPER void CRubbish::Render(void) { EAXJMP(0x512190); }
WRAPPER void CRubbish::StirUp(CVehicle *veh) { EAXJMP(0x512690); }
WRAPPER void CRubbish::Update(void) { EAXJMP(0x511B90); }
WRAPPER void CRubbish::SetVisibility(bool) { EAXJMP(0x512AA0); }
+WRAPPER void CRubbish::Init(void) { EAXJMP(0x511940); }
diff --git a/src/render/Rubbish.h b/src/render/Rubbish.h
index 7ed0978b..c94ff303 100644
--- a/src/render/Rubbish.h
+++ b/src/render/Rubbish.h
@@ -9,4 +9,5 @@ public:
static void StirUp(CVehicle *veh); // CAutomobile on PS2
static void Update(void);
static void SetVisibility(bool);
+ static void Init(void);
};
diff --git a/src/render/Skidmarks.cpp b/src/render/Skidmarks.cpp
index 7489f7cd..deb5a648 100644
--- a/src/render/Skidmarks.cpp
+++ b/src/render/Skidmarks.cpp
@@ -7,3 +7,5 @@ WRAPPER void CSkidmarks::Update() { EAXJMP(0x518200); }
WRAPPER void CSkidmarks::Render(void) { EAXJMP(0x5182E0); }
WRAPPER void CSkidmarks::RegisterOne(uint32 id, CVector pos, float fwdx, float fwdY, bool *isMuddy, bool *isBloddy) { EAXJMP(0x5185C0); }
+
+WRAPPER void CSkidmarks::Init(void) { EAXJMP(0x517D70); }
diff --git a/src/render/Skidmarks.h b/src/render/Skidmarks.h
index e5372136..2f669575 100644
--- a/src/render/Skidmarks.h
+++ b/src/render/Skidmarks.h
@@ -7,4 +7,5 @@ public:
static void Update(void);
static void Render(void);
static void RegisterOne(uint32 id, CVector pos, float fwdx, float fwdY, bool *isMuddy, bool *isBloddy);
+ static void Init(void);
};
diff --git a/src/render/SpecialFX.cpp b/src/render/SpecialFX.cpp
index e0b3313f..804fedf5 100644
--- a/src/render/SpecialFX.cpp
+++ b/src/render/SpecialFX.cpp
@@ -19,6 +19,7 @@
WRAPPER void CSpecialFX::Render(void) { EAXJMP(0x518DC0); }
WRAPPER void CSpecialFX::Update(void) { EAXJMP(0x518D40); }
+WRAPPER void CSpecialFX::Init(void) { EAXJMP(0x5189E0); }
WRAPPER void CMotionBlurStreaks::RegisterStreak(int32 id, uint8 r, uint8 g, uint8 b, CVector p1, CVector p2) { EAXJMP(0x519460); }
diff --git a/src/render/SpecialFX.h b/src/render/SpecialFX.h
index ecd3ad87..701b89a0 100644
--- a/src/render/SpecialFX.h
+++ b/src/render/SpecialFX.h
@@ -5,6 +5,7 @@ class CSpecialFX
public:
static void Render(void);
static void Update(void);
+ static void Init(void);
};
class CMotionBlurStreaks
diff --git a/src/render/WaterCannon.cpp b/src/render/WaterCannon.cpp
index c2af73f0..03aa8f0e 100644
--- a/src/render/WaterCannon.cpp
+++ b/src/render/WaterCannon.cpp
@@ -7,3 +7,4 @@ CWaterCannon* aCannons = (CWaterCannon*)0x8F2CA8;
WRAPPER void CWaterCannons::Update(void) { EAXJMP(0x522510); }
WRAPPER void CWaterCannons::UpdateOne(uint32 id, CVector *pos, CVector *dir) { EAXJMP(0x522470); }
WRAPPER void CWaterCannons::Render(void) { EAXJMP(0x522550); }
+WRAPPER void CWaterCannons::Init(void) { EAXJMP(0x522440); }
diff --git a/src/render/WaterCannon.h b/src/render/WaterCannon.h
index 16df63db..2fbde6bf 100644
--- a/src/render/WaterCannon.h
+++ b/src/render/WaterCannon.h
@@ -20,6 +20,7 @@ public:
static void Update();
static void UpdateOne(uint32 id, CVector *pos, CVector *dir);
static void Render(void);
+ static void Init(void);
};
extern CWaterCannon *aCannons;
diff --git a/src/render/WeaponEffects.cpp b/src/render/WeaponEffects.cpp
index 11fb3d2e..932c661e 100644
--- a/src/render/WeaponEffects.cpp
+++ b/src/render/WeaponEffects.cpp
@@ -2,6 +2,8 @@
#include "patcher.h"
#include "WeaponEffects.h"
+#include "TxdStore.h"
+
WRAPPER void CWeaponEffects::Render(void) { EAXJMP(0x564D70); }
CWeaponEffects &gCrossHair = *(CWeaponEffects*)0x6503BC;
@@ -23,3 +25,21 @@ CWeaponEffects::MarkTarget(CVector pos, uint8 red, uint8 green, uint8 blue, uint
gCrossHair.m_alpha = alpha;
gCrossHair.m_size = size;
}
+
+void
+CWeaponEffects::Init()
+{
+ gCrossHair.m_bCrosshair = false;
+ gCrossHair.m_vecPos = CVector(0.0f, 0.0f, 0.0f);
+ gCrossHair.m_red = 0;
+ gCrossHair.m_green = 0;
+ gCrossHair.m_blue = 0;
+ gCrossHair.m_alpha = 255;
+ gCrossHair.m_size = 1.0f;
+ gCrossHair.field_24 = 0;
+ CTxdStore::PushCurrentTxd();
+ CTxdStore::SetCurrentTxd(CTxdStore::FindTxdSlot("particle"));
+ gCrossHair.m_pTexture = RwTextureRead("crosshair", nil);
+ gCrossHair.m_pRaster = gCrossHair.m_pTexture->raster;
+ CTxdStore::PopCurrentTxd();
+}
diff --git a/src/render/WeaponEffects.h b/src/render/WeaponEffects.h
index 6edcd60b..e4d0461a 100644
--- a/src/render/WeaponEffects.h
+++ b/src/render/WeaponEffects.h
@@ -19,4 +19,5 @@ public:
static void Render(void);
static void ClearCrossHair();
static void MarkTarget(CVector, uint8, uint8, uint8, uint8, float);
+ static void Init(void);
};
diff --git a/src/render/Weather.cpp b/src/render/Weather.cpp
index 479f3404..c1988ab4 100644
--- a/src/render/Weather.cpp
+++ b/src/render/Weather.cpp
@@ -34,6 +34,7 @@ float &CWeather::Stored_Rain = *(float*)0x885B4C;
WRAPPER void CWeather::RenderRainStreaks(void) { EAXJMP(0x524550); }
WRAPPER void CWeather::Update(void) { EAXJMP(0x522C10); }
+WRAPPER void CWeather::Init(void) { EAXJMP(0x522BA0); }
void CWeather::ReleaseWeather()
{
diff --git a/src/render/Weather.h b/src/render/Weather.h
index b5704b01..63def9b9 100644
--- a/src/render/Weather.h
+++ b/src/render/Weather.h
@@ -39,6 +39,7 @@ public:
static void RenderRainStreaks(void);
static void Update(void);
+ static void Init(void);
static void ReleaseWeather();
static void ForceWeather(int16);