summaryrefslogtreecommitdiffstats
path: root/src/render
diff options
context:
space:
mode:
authorFire_Head <Fire-Head@users.noreply.github.com>2020-06-29 08:37:53 +0200
committerGitHub <noreply@github.com>2020-06-29 08:37:53 +0200
commit860f75d66ce51f2f5f3ea2b4b2b582f6d161a2bb (patch)
tree6a8f83b0d46e97b198f095b7624deecca75051e7 /src/render
parentrestore Text.cpp (diff)
parentMerge remote-tracking branch 'upstream/master' (diff)
downloadre3-860f75d66ce51f2f5f3ea2b4b2b582f6d161a2bb.tar
re3-860f75d66ce51f2f5f3ea2b4b2b582f6d161a2bb.tar.gz
re3-860f75d66ce51f2f5f3ea2b4b2b582f6d161a2bb.tar.bz2
re3-860f75d66ce51f2f5f3ea2b4b2b582f6d161a2bb.tar.lz
re3-860f75d66ce51f2f5f3ea2b4b2b582f6d161a2bb.tar.xz
re3-860f75d66ce51f2f5f3ea2b4b2b582f6d161a2bb.tar.zst
re3-860f75d66ce51f2f5f3ea2b4b2b582f6d161a2bb.zip
Diffstat (limited to 'src/render')
-rw-r--r--src/render/2dEffect.h8
-rw-r--r--src/render/Clouds.cpp5
-rw-r--r--src/render/Coronas.cpp6
-rw-r--r--src/render/Draw.cpp6
-rw-r--r--src/render/Draw.h12
-rw-r--r--src/render/Fluff.cpp35
-rw-r--r--src/render/Font.cpp2
-rw-r--r--src/render/Glass.cpp11
-rw-r--r--src/render/Hud.cpp74
-rw-r--r--src/render/Particle.cpp5
-rw-r--r--src/render/Shadows.cpp8
-rw-r--r--src/render/Skidmarks.h2
-rw-r--r--src/render/Sprite.cpp4
-rw-r--r--src/render/Timecycle.cpp2
-rw-r--r--src/render/Timecycle.h4
-rw-r--r--src/render/WaterLevel.cpp7
-rw-r--r--src/render/WaterLevel.h1
17 files changed, 118 insertions, 74 deletions
diff --git a/src/render/2dEffect.h b/src/render/2dEffect.h
index 2a71a8d5..628d64c2 100644
--- a/src/render/2dEffect.h
+++ b/src/render/2dEffect.h
@@ -25,8 +25,8 @@ enum {
};
enum {
- ATTRACTORFLAG_ICECREAM,
- ATTRACTORFLAG_STARE
+ ATTRACTORTYPE_ICECREAM,
+ ATTRACTORTYPE_STARE
};
enum {
@@ -44,7 +44,7 @@ public:
float dist;
float range; // of pointlight
float size;
- float shadowRange;
+ float shadowSize;
uint8 lightType; // LIGHT_
uint8 roadReflection;
uint8 flareType;
@@ -60,7 +60,7 @@ public:
};
struct Attractor {
CVector dir;
- uint8 flags;
+ int8 type;
uint8 probability;
};
diff --git a/src/render/Clouds.cpp b/src/render/Clouds.cpp
index 9c0fde0f..60450213 100644
--- a/src/render/Clouds.cpp
+++ b/src/render/Clouds.cpp
@@ -69,8 +69,13 @@ void
CClouds::Update(void)
{
float s = Sin(TheCamera.Orientation - 0.85f);
+#ifdef FIX_BUGS
+ CloudRotation += CWeather::Wind*s*0.0025f*CTimer::GetTimeStepFix();
+ IndividualRotation += (CWeather::Wind*CTimer::GetTimeStep() + 0.3f*CTimer::GetTimeStepFix()) * 60.0f;
+#else
CloudRotation += CWeather::Wind*s*0.0025f;
IndividualRotation += (CWeather::Wind*CTimer::GetTimeStep() + 0.3f) * 60.0f;
+#endif
}
void
diff --git a/src/render/Coronas.cpp b/src/render/Coronas.cpp
index de3b5c78..5bf89403 100644
--- a/src/render/Coronas.cpp
+++ b/src/render/Coronas.cpp
@@ -506,18 +506,18 @@ CCoronas::DoSunAndMoon(void)
{
// yeah, moon is done somewhere else....
- CVector sunCoors = CTimeCycle::GetSunPosition();
+ CVector sunCoors = CTimeCycle::GetSunDirection();
sunCoors *= 150.0f;
sunCoors += TheCamera.GetPosition();
- if(CTimeCycle::GetSunPosition().z > -0.2f){
+ if(CTimeCycle::GetSunDirection().z > -0.2f){
float size = ((CGeneral::GetRandomNumber()&0xFF) * 0.005f + 10.0f) * CTimeCycle::GetSunSize();
RegisterCorona(SUN_CORE,
CTimeCycle::GetSunCoreRed(), CTimeCycle::GetSunCoreGreen(), CTimeCycle::GetSunCoreBlue(),
255, sunCoors, size,
999999.88f, TYPE_STAR, FLARE_NONE, REFLECTION_OFF, LOSCHECK_OFF, STREAK_OFF, 0.0f);
- if(CTimeCycle::GetSunPosition().z > 0.0f)
+ if(CTimeCycle::GetSunDirection().z > 0.0f)
RegisterCorona(SUN_CORONA,
CTimeCycle::GetSunCoronaRed(), CTimeCycle::GetSunCoronaGreen(), CTimeCycle::GetSunCoronaBlue(),
255, sunCoors, 25.0f * CTimeCycle::GetSunSize(),
diff --git a/src/render/Draw.cpp b/src/render/Draw.cpp
index b31cc624..bb37a3a3 100644
--- a/src/render/Draw.cpp
+++ b/src/render/Draw.cpp
@@ -6,6 +6,7 @@
#ifdef ASPECT_RATIO_SCALE
float CDraw::ms_fAspectRatio = DEFAULT_ASPECT_RATIO;
+float CDraw::ms_fScaledFOV = 45.0f;
#endif
float CDraw::ms_fNearClipZ;
@@ -61,8 +62,7 @@ void
CDraw::SetFOV(float fov)
{
#ifdef ASPECT_RATIO_SCALE
- ms_fFOV = ConvertFOV(fov);
-#else
- ms_fFOV = fov;
+ ms_fScaledFOV = ConvertFOV(fov);
#endif
+ ms_fFOV = fov;
}
diff --git a/src/render/Draw.h b/src/render/Draw.h
index 55958a2a..5c4f95b1 100644
--- a/src/render/Draw.h
+++ b/src/render/Draw.h
@@ -16,14 +16,15 @@ private:
static float ms_fNearClipZ;
static float ms_fFarClipZ;
static float ms_fFOV;
-public:
- static float ms_fLODDistance; // set but unused?
-
#ifdef ASPECT_RATIO_SCALE
// we use this variable to scale a lot of 2D elements
// so better cache it
static float ms_fAspectRatio;
+ // similar thing for 3D rendering
+ static float ms_fScaledFOV;
#endif
+public:
+ static float ms_fLODDistance; // set but unused?
static uint8 FadeValue;
static uint8 FadeRed;
@@ -37,6 +38,11 @@ public:
static void SetFOV(float fov);
static float GetFOV(void) { return ms_fFOV; }
+#ifdef ASPECT_RATIO_SCALE
+ static float GetScaledFOV(void) { return ms_fScaledFOV; }
+#else
+ static float GetScaledFOV(void) { return ms_fFOV; }
+#endif
static float FindAspectRatio(void);
#ifdef ASPECT_RATIO_SCALE
diff --git a/src/render/Fluff.cpp b/src/render/Fluff.cpp
index 1be53825..da29daec 100644
--- a/src/render/Fluff.cpp
+++ b/src/render/Fluff.cpp
@@ -142,11 +142,11 @@ void CMovingThings::Init()
void CMovingThings::Shutdown()
{
int i;
- for (i = 0; i < 11; ++i)
+ for (i = 0; i < ARRAY_SIZE(aScrollBars); ++i)
aScrollBars[i].SetVisibility(false);
- for (i = 0; i < 2; ++i)
+ for (i = 0; i < ARRAY_SIZE(aTowerClocks); ++i)
aTowerClocks[i].SetVisibility(false);
- for (i = 0; i < 3; ++i)
+ for (i = 0; i < ARRAY_SIZE(aDigitalClocks); ++i)
aDigitalClocks[i].SetVisibility(false);
}
@@ -168,17 +168,17 @@ void CMovingThings::Update()
aMovingThings[i].Update();
}
- for (i = 0; i < 11; ++i)
+ for (i = 0; i < ARRAY_SIZE(aScrollBars); ++i)
{
if (aScrollBars[i].IsVisible() || (CTimer::GetFrameCounter() + i) % 8 == 0)
aScrollBars[i].Update();
}
- for (i = 0; i < 2; ++i)
+ for (i = 0; i < ARRAY_SIZE(aTowerClocks); ++i)
{
if (aTowerClocks[i].IsVisible() || (CTimer::GetFrameCounter() + i) % 8 == 0)
aTowerClocks[i].Update();
}
- for (i = 0; i < 3; ++i)
+ for (i = 0; i < ARRAY_SIZE(aDigitalClocks); ++i)
{
if (aDigitalClocks[i].IsVisible() || (CTimer::GetFrameCounter() + i) % 8 == 0)
aDigitalClocks[i].Update();
@@ -188,17 +188,17 @@ void CMovingThings::Update()
void CMovingThings::Render()
{
int i;
- for (i = 0; i < 11; ++i)
+ for (i = 0; i < ARRAY_SIZE(aScrollBars); ++i)
{
if (aScrollBars[i].IsVisible())
aScrollBars[i].Render();
}
- for (i = 0; i < 2; ++i)
+ for (i = 0; i < ARRAY_SIZE(aTowerClocks); ++i)
{
if (aTowerClocks[i].IsVisible())
aTowerClocks[i].Render();
}
- for (i = 0; i < 3; ++i)
+ for (i = 0; i < ARRAY_SIZE(aDigitalClocks); ++i)
{
if (aDigitalClocks[i].IsVisible())
aDigitalClocks[i].Render();
@@ -297,7 +297,8 @@ const char* FindDigitalClockMessage()
}
else
{
- int temperature = 13.0f - 6.0f * Cos((CClock::GetMinutes() + 60.0f * CClock::GetHours()) * 0.0043611112f - 1.0f);
+ // they didn't use rad2deg here because of 3.14
+ int temperature = 13.0f - 6.0f * Cos((CClock::GetMinutes() + 60.0f * CClock::GetHours()) / (4.0f * 180.0f / 3.14f) - 1.0f);
String_DigitalClock[0] = '0' + temperature / 10;
if (String_DigitalClock[0] == '0')
String_DigitalClock[0] = ' ';
@@ -312,7 +313,7 @@ const char* FindDigitalClockMessage()
// ---------- CScrollBar ----------
void CScrollBar::Init(CVector position, uint8 type, float sizeX, float sizeY, float sizeZ, uint8 red, uint8 green, uint8 blue, float scale)
{
- for (int i = 0; i < 40; ++i)
+ for (int i = 0; i < ARRAY_SIZE(m_MessageBar); ++i)
m_MessageBar[i] = 0;
m_pMessage = ". ";
@@ -618,16 +619,16 @@ void CScrollBar::Update()
}
// Scroll
- for (int i = 0; i < 39; i++)
+ for (int i = 0; i < ARRAY_SIZE(m_MessageBar)-1; i++)
m_MessageBar[i] = m_MessageBar[i + 1];
- m_MessageBar[39] = m_Counter < 5 ? ScrollCharSet[m_pMessage[m_MessageCurrentChar] - ' '][m_Counter] : 0;
+ m_MessageBar[ARRAY_SIZE(m_MessageBar)-1] = m_Counter < 5 ? ScrollCharSet[m_pMessage[m_MessageCurrentChar] - ' '][m_Counter] : 0;
// Introduce some random displaying glitches; signs aren't supposed to be perfect :P
switch (CGeneral::GetRandomNumber() & 0xFF)
{
- case 0x0D: m_MessageBar[39] = 0; break;
- case 0xE3: m_MessageBar[39] = 0xE3; break;
- case 0x64: m_MessageBar[39] = ~m_MessageBar[39]; break;
+ case 0x0D: m_MessageBar[ARRAY_SIZE(m_MessageBar)-1] = 0; break;
+ case 0xE3: m_MessageBar[ARRAY_SIZE(m_MessageBar)-1] = 0xE3; break;
+ case 0x64: m_MessageBar[ARRAY_SIZE(m_MessageBar)-1] = ~m_MessageBar[ARRAY_SIZE(m_MessageBar)-1]; break;
}
}
@@ -654,7 +655,7 @@ void CScrollBar::Render()
CVector coronaCoord, screenCoord;
float screenW, screenH;
- for (int i = 1; i < 40; ++i)
+ for (int i = 1; i < ARRAY_SIZE(m_MessageBar); ++i)
{
for (int j = 0; j < 5; ++j)
{
diff --git a/src/render/Font.cpp b/src/render/Font.cpp
index ef665fae..de7de81a 100644
--- a/src/render/Font.cpp
+++ b/src/render/Font.cpp
@@ -483,6 +483,8 @@ CFont::PrintString(float xstart, float ystart, wchar *s)
xstart;
#ifdef MORE_LANGUAGES
PrintString(xleft, y, start, s, spaceWidth, xstart);
+#else
+ PrintString(xleft, y, start, s, spaceWidth);
#endif
// reset things
lineLength = 0.0f;
diff --git a/src/render/Glass.cpp b/src/render/Glass.cpp
index 6f17013c..ac892ddb 100644
--- a/src/render/Glass.cpp
+++ b/src/render/Glass.cpp
@@ -13,6 +13,7 @@
#include "Shadows.h"
#include "ModelIndices.h"
#include "main.h"
+#include "soundlist.h"
uint32 CGlass::NumGlassEntities;
@@ -101,7 +102,7 @@ CFallingGlassPane::Update(void)
pos = CVector(GetPosition().x, GetPosition().y, m_fGroundZ);
- PlayOneShotScriptObject(_SCRSOUND_GLASS_SHARD, pos);
+ PlayOneShotScriptObject(SCRIPT_SOUND_GLASS_LIGHT_BREAK, pos);
RwRGBA color = { 255, 255, 255, 255 };
@@ -627,7 +628,7 @@ CGlass::WindowRespondsToCollision(CEntity *entity, float amount, CVector speed,
if ( amount > 300.0f )
{
- PlayOneShotScriptObject(_SCRSOUND_GLASS_SMASH_1, object->GetPosition());
+ PlayOneShotScriptObject(SCRIPT_SOUND_GLASS_BREAK_L, object->GetPosition());
GeneratePanesForWindow(0,
CVector(minx, miny, minz),
@@ -637,7 +638,7 @@ CGlass::WindowRespondsToCollision(CEntity *entity, float amount, CVector speed,
}
else
{
- PlayOneShotScriptObject(_SCRSOUND_GLASS_SMASH_2, object->GetPosition());
+ PlayOneShotScriptObject(SCRIPT_SOUND_GLASS_BREAK_S, object->GetPosition());
GeneratePanesForWindow(1,
CVector(minx, miny, minz),
@@ -659,7 +660,7 @@ CGlass::WindowRespondsToSoftCollision(CEntity *entity, float amount)
if ( amount > 50.0f && !object->bGlassCracked )
{
- PlayOneShotScriptObject(_SCRSOUND_GLASS_CRACK, object->GetPosition());
+ PlayOneShotScriptObject(SCRIPT_SOUND_GLASS_CRACK, object->GetPosition());
object->bGlassCracked = true;
}
}
@@ -675,7 +676,7 @@ CGlass::WasGlassHitByBullet(CEntity *entity, CVector point)
{
if ( !object->bGlassCracked )
{
- PlayOneShotScriptObject(_SCRSOUND_GLASS_CRACK, object->GetPosition());
+ PlayOneShotScriptObject(SCRIPT_SOUND_GLASS_CRACK, object->GetPosition());
object->bGlassCracked = true;
}
else
diff --git a/src/render/Hud.cpp b/src/render/Hud.cpp
index a39408cd..1e536382 100644
--- a/src/render/Hud.cpp
+++ b/src/render/Hud.cpp
@@ -21,6 +21,26 @@
#include "User.h"
#include "World.h"
+// Game has colors inlined in code.
+// For easier modification we collect them here:
+CRGBA MONEY_COLOR(89, 115, 150, 255);
+CRGBA AMMO_COLOR(0, 0, 0, 255);
+CRGBA HEALTH_COLOR(186, 101, 50, 255);
+CRGBA ARMOUR_COLOR(124, 140, 95, 255);
+CRGBA WANTED_COLOR(193, 164, 120, 255);
+CRGBA ZONE_COLOR(152, 154, 82, 255);
+CRGBA VEHICLE_COLOR(194, 165, 120, 255);
+CRGBA CLOCK_COLOR(194, 165, 120, 255);
+CRGBA TIMER_COLOR(186, 101, 50, 255);
+CRGBA COUNTER_COLOR(0, 106, 164, 255);
+CRGBA PAGER_COLOR(32, 162, 66, 205);
+CRGBA RADARDISC_COLOR(0, 0, 0, 255);
+CRGBA BIGMESSAGE_COLOR(85, 119, 133, 255);
+CRGBA WASTEDBUSTED_COLOR(170, 123, 87, 255);
+CRGBA ODDJOB_COLOR(89, 115, 150, 255);
+CRGBA ODDJOB2_COLOR(156, 91, 40, 255);
+CRGBA MISSIONTITLE_COLOR(220, 172, 2, 255);
+
wchar CHud::m_HelpMessage[256];
wchar CHud::m_LastHelpMessage[256];
uint32 CHud::m_HelpMessageState;
@@ -111,16 +131,16 @@ void CHud::Draw()
return;
if (m_Wants_To_Draw_Hud && !TheCamera.m_WideScreenOn) {
- bool DrawCrossHair = 0;
- bool DrawCrossHairPC = 0;
+ bool DrawCrossHair = false;
+ bool DrawCrossHairPC = false;
int32 WeaponType = FindPlayerPed()->m_weapons[FindPlayerPed()->m_currentWeapon].m_eWeaponType;
int32 Mode = TheCamera.Cams[TheCamera.ActiveCam].Mode;
if (Mode == CCam::MODE_SNIPER || Mode == CCam::MODE_ROCKETLAUNCHER || Mode == CCam::MODE_M16_1STPERSON || Mode == CCam::MODE_HELICANNON_1STPERSON)
- DrawCrossHair = 1;
+ DrawCrossHair = true;
if (Mode == CCam::MODE_M16_1STPERSON_RUNABOUT || Mode == CCam::MODE_ROCKETLAUNCHER_RUNABOUT || Mode == CCam::MODE_SNIPER_RUNABOUT)
- DrawCrossHairPC = 1;
+ DrawCrossHairPC = true;
/*
Draw Crosshairs
@@ -129,7 +149,7 @@ void CHud::Draw()
(!CPad::GetPad(0)->GetLookBehindForPed() || TheCamera.m_bPlayerIsInGarage) || Mode == CCam::MODE_1STPERSON_RUNABOUT) {
if (FindPlayerPed() && !FindPlayerPed()->EnteringCar()) {
if ((WeaponType >= WEAPONTYPE_COLT45 && WeaponType <= WEAPONTYPE_M16) || WeaponType == WEAPONTYPE_FLAMETHROWER)
- DrawCrossHairPC = 1;
+ DrawCrossHairPC = true;
}
}
@@ -252,7 +272,7 @@ void CHud::Draw()
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(110.0f - 2.0f), SCREEN_SCALE_Y(43.0f + 2.0f), sPrint);
- CFont::SetColor(CRGBA(89, 115, 150, 255));
+ CFont::SetColor(MONEY_COLOR);
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(110.0f), SCREEN_SCALE_Y(43.0f), sPrint);
/*
@@ -312,7 +332,7 @@ void CHud::Draw()
CFont::SetFontStyle(FONT_BANK);
if (!CDarkel::FrenzyOnGoing() && WeaponType != WEAPONTYPE_UNARMED && WeaponType != WEAPONTYPE_BASEBALLBAT) {
- CFont::SetColor(CRGBA(0, 0, 0, 255));
+ CFont::SetColor(AMMO_COLOR);
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(66.0f), SCREEN_SCALE_Y(73.0f), sPrint);
}
@@ -349,7 +369,7 @@ void CHud::Draw()
if (!CWorld::Players[CWorld::PlayerInFocus].m_nTimeLastHealthLoss || CTimer::GetTimeInMilliseconds() > CWorld::Players[CWorld::PlayerInFocus].m_nTimeLastHealthLoss + 2000 || CTimer::GetFrameCounter() & 4) {
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(164.0f - 2.0f), SCREEN_SCALE_Y(65.0f + 2.0f), sPrintIcon);
}
- CFont::SetColor(CRGBA(186, 101, 50, 255));
+ CFont::SetColor(HEALTH_COLOR);
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(110.0f), SCREEN_SCALE_Y(65.0f), sPrint);
@@ -380,7 +400,7 @@ void CHud::Draw()
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(234.0f - 2.0f), SCREEN_SCALE_Y(65.0f + 2.0f), sPrintIcon);
}
- CFont::SetColor(CRGBA(124, 140, 95, 255));
+ CFont::SetColor(ARMOUR_COLOR);
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(182.0f), SCREEN_SCALE_Y(65.0f), sPrint);
@@ -410,7 +430,7 @@ void CHud::Draw()
&& (CTimer::GetTimeInMilliseconds() > FindPlayerPed()->m_pWanted->m_nLastWantedLevelChange
+ 2000 || CTimer::GetFrameCounter() & 4)) {
- CFont::SetColor(CRGBA(193, 164, 120, 255));
+ CFont::SetColor(WANTED_COLOR);
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(60.0f + 24.0f * i), SCREEN_SCALE_Y(87.0f), sPrintIcon);
}
}
@@ -504,7 +524,7 @@ void CHud::Draw()
CFont::SetColor(CRGBA(0, 0, 0, fZoneAlpha));
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(32.0f) + SCREEN_SCALE_X(1.0f), SCREEN_SCALE_FROM_BOTTOM(30.0f) + SCREEN_SCALE_Y(1.0f), m_ZoneToPrint);
- CFont::SetColor(CRGBA(152, 154, 82, fZoneAlpha));
+ CFont::SetColor(CRGBA(ZONE_COLOR.r, ZONE_COLOR.g, ZONE_COLOR.b, fZoneAlpha));
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(32.0f), SCREEN_SCALE_FROM_BOTTOM(30.0f), m_ZoneToPrint);
}
}
@@ -598,7 +618,7 @@ void CHud::Draw()
CFont::SetColor(CRGBA(0, 0, 0, fVehicleAlpha));
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(32.0f) + SCREEN_SCALE_X(1.0f), SCREEN_SCALE_FROM_BOTTOM(55.0f) + SCREEN_SCALE_Y(1.0f), m_pVehicleNameToPrint);
- CFont::SetColor(CRGBA(194, 165, 120, fVehicleAlpha));
+ CFont::SetColor(CRGBA(VEHICLE_COLOR.r, VEHICLE_COLOR.g, VEHICLE_COLOR.b, fVehicleAlpha));
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(32.0f), SCREEN_SCALE_FROM_BOTTOM(55.0f), m_pVehicleNameToPrint);
}
}
@@ -630,7 +650,7 @@ void CHud::Draw()
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(111.0f) + SCREEN_SCALE_X(2.0f), SCREEN_SCALE_Y(22.0f) + SCREEN_SCALE_Y(2.0f), sPrint);
- CFont::SetColor(CRGBA(194, 165, 120, 255));
+ CFont::SetColor(CLOCK_COLOR);
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(111.0f), SCREEN_SCALE_Y(22.0f), sPrint);
/*
@@ -674,7 +694,7 @@ void CHud::Draw()
CFont::SetColor(CRGBA(0, 0, 0, 255));
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) + SCREEN_SCALE_X(2.0f), SCREEN_SCALE_Y(110.0f) + SCREEN_SCALE_Y(2.0f), sTimer);
CFont::SetScale(SCREEN_SCALE_X(0.8f), SCREEN_SCALE_Y(1.35f));
- CFont::SetColor(CRGBA(186, 101, 50, 255));
+ CFont::SetColor(TIMER_COLOR);
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET), SCREEN_SCALE_Y(110.0f), sTimer);
if (CUserDisplay::OnscnTimer.m_sEntries[0].m_aTimerText[0]) {
@@ -683,7 +703,7 @@ void CHud::Draw()
CFont::SetScale(SCREEN_SCALE_X(0.64f), SCREEN_SCALE_Y(1.35f));
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) - SCREEN_SCALE_X(80.0f) + SCREEN_SCALE_X(2.0f), SCREEN_SCALE_Y(110.0f) + SCREEN_SCALE_Y(2.0f), TheText.Get(CUserDisplay::OnscnTimer.m_sEntries[0].m_aTimerText));
- CFont::SetColor(CRGBA(186, 101, 50, 255));
+ CFont::SetColor(TIMER_COLOR);
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) - SCREEN_SCALE_X(80.0f), SCREEN_SCALE_Y(110.0f), TheText.Get(CUserDisplay::OnscnTimer.m_sEntries[0].m_aTimerText));
}
}
@@ -718,7 +738,7 @@ void CHud::Draw()
CFont::SetColor(CRGBA(0, 0, 0, 255));
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) + SCREEN_SCALE_X(2.0f), SCREEN_SCALE_Y(132.0f) + SCREEN_SCALE_Y(2.0f), sTimer);
- CFont::SetColor(CRGBA(0, 106, 164, 255));
+ CFont::SetColor(COUNTER_COLOR);
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET), SCREEN_SCALE_Y(132.0f), sTimer);
} else {
int counter = atoi(CUserDisplay::OnscnTimer.m_sEntries[0].m_bCounterBuffer);
@@ -735,7 +755,7 @@ void CHud::Draw()
CFont::SetColor(CRGBA(0, 0, 0, 255));
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) - SCREEN_SCALE_X(61.0f) + SCREEN_SCALE_Y(2.0f), SCREEN_SCALE_Y(132.0f) + SCREEN_SCALE_Y(2.0f), TheText.Get(CUserDisplay::OnscnTimer.m_sEntries[0].m_aCounterText));
- CFont::SetColor(CRGBA(0, 106, 164, 255));
+ CFont::SetColor(COUNTER_COLOR);
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) - SCREEN_SCALE_X(61.0f), SCREEN_SCALE_Y(132.0f), TheText.Get(CUserDisplay::OnscnTimer.m_sEntries[0].m_aCounterText));
}
}
@@ -782,7 +802,7 @@ void CHud::Draw()
CFont::SetBackgroundOff();
CFont::SetScale(SCREEN_SCALE_X(0.84f), SCREEN_SCALE_Y(1.0f));
- CFont::SetColor(CRGBA(32, 162, 66, 205));
+ CFont::SetColor(PAGER_COLOR);
CFont::SetRightJustifyOff();
CFont::SetBackgroundOff();
CFont::SetCentreOff();
@@ -804,7 +824,7 @@ void CHud::Draw()
rect.Translate(RADAR_LEFT, SCREEN_SCALE_FROM_BOTTOM(RADAR_BOTTOM + RADAR_HEIGHT));
#endif
rect.Grow(4.0f);
- Sprites[HUD_RADARDISC].Draw(rect, CRGBA(0, 0, 0, 255));
+ Sprites[HUD_RADARDISC].Draw(rect, RADARDISC_COLOR);
CRadar::DrawBlips();
}
}
@@ -959,7 +979,7 @@ void CHud::Draw()
CFont::PrintString(SCREEN_WIDTH / 2 + SCREEN_SCALE_X(2.0f), (SCREEN_HEIGHT / 2) - SCREEN_SCALE_Y(20.0f) + SCREEN_SCALE_Y(2.0f), m_BigMessage[0]);
#endif
- CFont::SetColor(CRGBA(85, 119, 133, BigMessageAlpha[0]));
+ CFont::SetColor(CRGBA(BIGMESSAGE_COLOR.r, BIGMESSAGE_COLOR.g, BIGMESSAGE_COLOR.b, BigMessageAlpha[0]));
CFont::PrintString(SCREEN_WIDTH / 2, (SCREEN_HEIGHT / 2) - SCREEN_SCALE_Y(18.0f), m_BigMessage[0]);
}
else {
@@ -994,7 +1014,7 @@ void CHud::Draw()
CFont::SetColor(CRGBA(0, 0, 0, BigMessageAlpha[2]));
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(20.0f - 4.0f), SCREEN_SCALE_FROM_BOTTOM(78.0f), m_BigMessage[2]);
- CFont::SetColor(CRGBA(170, 123, 87, BigMessageAlpha[2]));
+ CFont::SetColor(CRGBA(WASTEDBUSTED_COLOR.r, WASTEDBUSTED_COLOR.g, WASTEDBUSTED_COLOR.b, BigMessageAlpha[2]));
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(20.0f), SCREEN_SCALE_FROM_BOTTOM(82.0f), m_BigMessage[2]);
}
else {
@@ -1024,7 +1044,7 @@ void CHud::DrawAfterFade()
m_fHelpMessageTime = CMessages::GetWideStringLength(m_HelpMessage) * 0.05f + 3.0f;
if (TheCamera.m_ScreenReductionPercentage == 0.0f)
- DMAudio.PlayFrontEndSound(SOUND_A0, 0);
+ DMAudio.PlayFrontEndSound(SOUND_HUD, 0);
break;
case 1:
case 2:
@@ -1186,7 +1206,7 @@ void CHud::DrawAfterFade()
CFont::SetColor(CRGBA(0, 0, 0, 255));
CFont::PrintString((SCREEN_WIDTH / 2) + SCREEN_SCALE_X(2.0f), (SCREEN_HEIGHT / 2) - SCREEN_SCALE_Y(84.0f) + SCREEN_SCALE_Y(2.0f), m_BigMessage[3]);
- CFont::SetColor(CRGBA(89, 115, 150, 255));
+ CFont::SetColor(ODDJOB_COLOR);
CFont::PrintString((SCREEN_WIDTH / 2), (SCREEN_HEIGHT / 2) - SCREEN_SCALE_Y(84.0f), m_BigMessage[3]);
}
@@ -1202,7 +1222,7 @@ void CHud::DrawAfterFade()
CFont::PrintString((SCREEN_WIDTH / 2) - SCREEN_SCALE_X(2.0f), (SCREEN_HEIGHT / 2) - SCREEN_SCALE_Y(84.0f) - SCREEN_SCALE_Y(2.0f), m_BigMessage[4]);
- CFont::SetColor(CRGBA(89, 115, 150, 255));
+ CFont::SetColor(ODDJOB_COLOR);
CFont::PrintString((SCREEN_WIDTH / 2), (SCREEN_HEIGHT / 2) - SCREEN_SCALE_Y(84.0f), m_BigMessage[4]);
}
@@ -1260,12 +1280,12 @@ void CHud::DrawAfterFade()
#ifdef BETA_SLIDING_TEXT
CFont::PrintString(SCREEN_WIDTH / 2 + SCREEN_SCALE_X(2.0f) - SCREEN_SCALE_X(OddJob2XOffset), SCREEN_HEIGHT / 2 - SCREEN_SCALE_Y(20.0f) + SCREEN_SCALE_Y(2.0f), m_BigMessage[5]);
- CFont::SetColor(CRGBA(156, 91, 40, 255));
+ CFont::SetColor(ODDJOB2_COLOR);
CFont::PrintString(SCREEN_WIDTH / 2 - SCREEN_SCALE_X(OddJob2XOffset), SCREEN_HEIGHT / 2 - SCREEN_SCALE_Y(20.0f), m_BigMessage[5]);
#else
CFont::PrintString(SCREEN_WIDTH / 2 + SCREEN_SCALE_X(2.0f), SCREEN_HEIGHT / 2 - SCREEN_SCALE_Y(20.0f) + SCREEN_SCALE_Y(2.0f), m_BigMessage[5]);
- CFont::SetColor(CRGBA(156, 91, 40, 255));
+ CFont::SetColor(ODDJOB2_COLOR);
CFont::PrintString(SCREEN_WIDTH / 2, SCREEN_HEIGHT / 2 - SCREEN_SCALE_Y(20.0f), m_BigMessage[5]);
#endif
}
@@ -1310,7 +1330,7 @@ void CHud::DrawAfterFade()
CFont::SetColor(CRGBA(40, 40, 40, BigMessageAlpha[1]));
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(20.0f) + SCREEN_SCALE_X(2.0f), SCREEN_SCALE_FROM_BOTTOM(120.0f) + SCREEN_SCALE_Y(2.0f), m_BigMessage[1]);
- CFont::SetColor(CRGBA(220, 172, 2, BigMessageAlpha[1]));
+ CFont::SetColor(CRGBA(MISSIONTITLE_COLOR.r, MISSIONTITLE_COLOR.g, MISSIONTITLE_COLOR.b, BigMessageAlpha[1]));
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(20.0f), SCREEN_SCALE_FROM_BOTTOM(120.0f), m_BigMessage[1]);
}
else {
diff --git a/src/render/Particle.cpp b/src/render/Particle.cpp
index 4223ac10..a867ae13 100644
--- a/src/render/Particle.cpp
+++ b/src/render/Particle.cpp
@@ -11,6 +11,7 @@
#include "AudioScriptObject.h"
#include "ParticleObject.h"
#include "Particle.h"
+#include "soundlist.h"
#define MAX_PARTICLES_ON_SCREEN (1000)
@@ -1268,7 +1269,7 @@ void CParticle::Update()
nil,
particle->m_fSize, color, particle->m_nRotationStep, 0, 0, 0);
- PlayOneShotScriptObject(_SCRSOUND_BULLET_SHELL_HIT_GROUND_1, particle->m_vecPosition);
+ PlayOneShotScriptObject(SCRIPT_SOUND_GUNSHELL_DROP, particle->m_vecPosition);
}
break;
@@ -1287,7 +1288,7 @@ void CParticle::Update()
nil,
particle->m_fSize, color, 0, 0, 0, 0);
- PlayOneShotScriptObject(_SCRSOUND_BULLET_SHELL_HIT_GROUND_2, particle->m_vecPosition);
+ PlayOneShotScriptObject(SCRIPT_SOUND_GUNSHELL_DROP_SOFT, particle->m_vecPosition);
}
break;
diff --git a/src/render/Shadows.cpp b/src/render/Shadows.cpp
index 69f9dce0..d07c302a 100644
--- a/src/render/Shadows.cpp
+++ b/src/render/Shadows.cpp
@@ -642,12 +642,12 @@ CShadows::StoreShadowForPole(CEntity *pPole, float fOffsetX, float fOffsetY, flo
PolePos.y += fOffsetX * pPole->GetRight().y + fOffsetY * pPole->GetForward().y;
PolePos.z += fOffsetZ;
- PolePos.x += -CTimeCycle::GetSunPosition().x * (fPoleHeight / 2);
- PolePos.y += -CTimeCycle::GetSunPosition().y * (fPoleHeight / 2);
+ PolePos.x += -CTimeCycle::GetSunDirection().x * (fPoleHeight / 2);
+ PolePos.y += -CTimeCycle::GetSunDirection().y * (fPoleHeight / 2);
StoreStaticShadow((uintptr)pPole + nID + _TODOCONST(51), SHADOWTYPE_DARK, gpPostShadowTex, &PolePos,
- -CTimeCycle::GetSunPosition().x * (fPoleHeight / 2),
- -CTimeCycle::GetSunPosition().y * (fPoleHeight / 2),
+ -CTimeCycle::GetSunDirection().x * (fPoleHeight / 2),
+ -CTimeCycle::GetSunDirection().y * (fPoleHeight / 2),
CTimeCycle::GetShadowSideX() * fPoleWidth,
CTimeCycle::GetShadowSideY() * fPoleWidth,
2 * (int32)((pPole->GetUp().z - 0.5f) * CTimeCycle::GetShadowStrength() * 2.0f) / 3,
diff --git a/src/render/Skidmarks.h b/src/render/Skidmarks.h
index 085b4c6d..c061782d 100644
--- a/src/render/Skidmarks.h
+++ b/src/render/Skidmarks.h
@@ -11,7 +11,7 @@ public:
bool m_isMuddy;
uintptr m_id;
int16 m_last;
- uint32 m_lastUpdate;;
+ uint32 m_lastUpdate;
uint32 m_fadeStart;
uint32 m_fadeEnd;
CVector m_pos[SKIDMARK_LENGTH];
diff --git a/src/render/Sprite.cpp b/src/render/Sprite.cpp
index 1dd1aaab..0789769a 100644
--- a/src/render/Sprite.cpp
+++ b/src/render/Sprite.cpp
@@ -22,8 +22,8 @@ CSprite::CalcHorizonCoors(void)
bool
CSprite::CalcScreenCoors(const RwV3d &in, RwV3d *out, float *outw, float *outh, bool farclip)
{
- CVector viewvec = TheCamera.m_viewMatrix * *(CVector*)&in;
- *out = *(RwV3d*)&viewvec;
+ CVector viewvec = TheCamera.m_viewMatrix * in;
+ *out = viewvec;
if(out->z <= CDraw::GetNearClipZ() + 1.0f) return false;
if(out->z >= CDraw::GetFarClipZ() && farclip) return false;
float recip = 1.0f/out->z;
diff --git a/src/render/Timecycle.cpp b/src/render/Timecycle.cpp
index 84b6f2fe..162983dd 100644
--- a/src/render/Timecycle.cpp
+++ b/src/render/Timecycle.cpp
@@ -298,7 +298,7 @@ CTimeCycle::Update(void)
m_CurrentStoredValue = (m_CurrentStoredValue+1)&0xF;
float sunAngle = 2*PI*(CClock::GetMinutes() + CClock::GetHours()*60)/(24*60);
- CVector &sunPos = GetSunPosition();
+ CVector &sunPos = GetSunDirection();
sunPos.x = Sin(sunAngle);
sunPos.y = 1.0f;
sunPos.z = 0.2f - Cos(sunAngle);
diff --git a/src/render/Timecycle.h b/src/render/Timecycle.h
index 28a0b7dd..0cb02b67 100644
--- a/src/render/Timecycle.h
+++ b/src/render/Timecycle.h
@@ -122,7 +122,7 @@ public:
static float GetSpriteSize(void) { return m_fCurrentSpriteSize; }
static int GetShadowStrength(void) { return m_nCurrentShadowStrength; }
static int GetLightShadowStrength(void) { return m_nCurrentLightShadowStrength; }
- static int GetLightOnGroundBrightness(void) { return m_fCurrentLightsOnGroundBrightness; }
+ static float GetLightOnGroundBrightness(void) { return m_fCurrentLightsOnGroundBrightness; }
static float GetFarClip(void) { return m_fCurrentFarClip; }
static float GetFogStart(void) { return m_fCurrentFogStart; }
@@ -142,7 +142,7 @@ public:
static void Initialise(void);
static void Update(void);
- static CVector &GetSunPosition(void) { return m_VectorToSun[m_CurrentStoredValue]; }
+ static CVector &GetSunDirection(void) { return m_VectorToSun[m_CurrentStoredValue]; }
static float GetShadowFrontX(void) { return m_fShadowFrontX[m_CurrentStoredValue]; }
static float GetShadowFrontY(void) { return m_fShadowFrontY[m_CurrentStoredValue]; }
static float GetShadowSideX(void) { return m_fShadowSideX[m_CurrentStoredValue]; }
diff --git a/src/render/WaterLevel.cpp b/src/render/WaterLevel.cpp
index 1a28ce83..6133b1d7 100644
--- a/src/render/WaterLevel.cpp
+++ b/src/render/WaterLevel.cpp
@@ -35,6 +35,8 @@ bool CWaterLevel::WavesCalculatedThisFrame;
RpAtomic *CWaterLevel::ms_pWavyAtomic;
RpGeometry *CWaterLevel::apGeomArray[8];
int16 CWaterLevel::nGeomUsed;
+//"Custom" Donīt Render Water Toggle
+bool gbDontRenderWater;
//RwTexture *gpWaterTex;
//RwRaster *gpWaterRaster;
@@ -332,6 +334,11 @@ SectorRadius(float fSize)
void
CWaterLevel::RenderWater()
{
+//"Custom" Donīt Render Water Toggle
+#ifndef MASTER
+ if (gbDontRenderWater)
+ return;
+#endif
bool bUseCamEndX = false;
bool bUseCamStartY = false;
diff --git a/src/render/WaterLevel.h b/src/render/WaterLevel.h
index 985c9744..269d6091 100644
--- a/src/render/WaterLevel.h
+++ b/src/render/WaterLevel.h
@@ -65,6 +65,7 @@
#define MAX_BOAT_WAKES 8
extern RwRaster* gpWaterRaster;
+extern bool gbDontRenderWater;
class CWaterLevel
{