summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2020-05-28 10:23:28 +0200
committerGitHub <noreply@github.com>2020-05-28 10:23:28 +0200
commitab7a21e017b8df907c381bb63709c121e3fcb297 (patch)
treeb800e4de4813630b7fbb64c6bb6a97e858894896 /src/core
parentcockbuilding ejaculation fix (diff)
parentrem unnecessary asserts (diff)
downloadre3-ab7a21e017b8df907c381bb63709c121e3fcb297.tar
re3-ab7a21e017b8df907c381bb63709c121e3fcb297.tar.gz
re3-ab7a21e017b8df907c381bb63709c121e3fcb297.tar.bz2
re3-ab7a21e017b8df907c381bb63709c121e3fcb297.tar.lz
re3-ab7a21e017b8df907c381bb63709c121e3fcb297.tar.xz
re3-ab7a21e017b8df907c381bb63709c121e3fcb297.tar.zst
re3-ab7a21e017b8df907c381bb63709c121e3fcb297.zip
Diffstat (limited to 'src/core')
-rw-r--r--src/core/Game.cpp9
-rw-r--r--src/core/Game.h1
-rw-r--r--src/core/Pad.cpp26
-rw-r--r--src/core/ZoneCull.h3
-rw-r--r--src/core/config.h3
-rw-r--r--src/core/main.cpp5
6 files changed, 45 insertions, 2 deletions
diff --git a/src/core/Game.cpp b/src/core/Game.cpp
index 72b09feb..9a1c00a7 100644
--- a/src/core/Game.cpp
+++ b/src/core/Game.cpp
@@ -306,7 +306,7 @@ bool CGame::Initialise(const char* datFile)
CWorld::Players[0].LoadPlayerSkin();
TestModelIndices();
LoadingScreen("Loading the Game", "Setup water", nil);
- CWaterLevel::Initialise("DATA\\WATER.DAT");
+ WaterLevelInitialise("DATA\\WATER.DAT");
TheConsole.Init();
CDraw::SetFOV(120.0f);
CDraw::ms_fLODDistance = 500.0f;
@@ -686,6 +686,13 @@ CGame::InitAfterFocusLoss()
}
bool
+CGame::CanSeeWaterFromCurrArea(void)
+{
+ return currArea == AREA_MAIN_MAP || currArea == AREA_MANSION
+ || currArea == AREA_HOTEL;
+}
+
+bool
CGame::CanSeeOutSideFromCurrArea(void)
{
return currArea == AREA_MAIN_MAP || currArea == AREA_MALL ||
diff --git a/src/core/Game.h b/src/core/Game.h
index 7ad8d55e..49a3e67c 100644
--- a/src/core/Game.h
+++ b/src/core/Game.h
@@ -62,6 +62,7 @@ public:
static void InitAfterFocusLoss(void);
static bool IsInInterior(void) { return currArea != AREA_MAIN_MAP; }
+ static bool CanSeeWaterFromCurrArea(void);
static bool CanSeeOutSideFromCurrArea(void);
// NB: these do something on PS2
diff --git a/src/core/Pad.cpp b/src/core/Pad.cpp
index 69f340dd..c52c7c36 100644
--- a/src/core/Pad.cpp
+++ b/src/core/Pad.cpp
@@ -35,6 +35,7 @@
#include "Streaming.h"
#include "PathFind.h"
#include "Wanted.h"
+#include "WaterLevel.h"
#include "General.h"
CPad Pads[MAX_PADS];
@@ -306,6 +307,21 @@ void PinkCarsCheat()
gbBlackCars = false;
gbPinkCars = true;
}
+
+void NoSeaBedCheat(void)
+{
+ CHud::SetHelpMessage(TheText.Get("CHEAT1"), true);
+ CWaterLevel::m_bRenderSeaBed = !CWaterLevel::m_bRenderSeaBed;
+}
+
+void RenderWaterLayersCheat(void)
+{
+ CHud::SetHelpMessage(TheText.Get("CHEAT1"), true);
+ if ( ++CWaterLevel::m_nRenderWaterLayers > 5 )
+ CWaterLevel::m_nRenderWaterLayers = 0;
+}
+
+
//////////////////////////////////////////////////////////////////////////
#ifdef KANGAROO_CHEAT
@@ -1051,6 +1067,16 @@ void CPad::AddToPCCheatString(char c)
if (!_CHEATCMP("ODODRETSAMOTTNAWI"))
AltDodoCheat();
#endif
+
+#if !defined(PC_WATER) && defined(WATER_CHEATS)
+ // SEABEDCHEAT
+ if (!_CHEATCMP("TAEHCDEBAESON"))
+ NoSeaBedCheat();
+
+ // WATERLAYERSCHEAT
+ if (!_CHEATCMP("TAEHCSREYALRETAW"))
+ RenderWaterLayersCheat();
+#endif
#undef _CHEATCMP
}
diff --git a/src/core/ZoneCull.h b/src/core/ZoneCull.h
index e76b7a44..aae06ca0 100644
--- a/src/core/ZoneCull.h
+++ b/src/core/ZoneCull.h
@@ -10,6 +10,8 @@ enum eZoneAttribs
ATTRZONE_NOTCULLZONE = 0x20,
ATTRZONE_DOINEEDCOLLISION = 0x40,
ATTRZONE_SUBWAYVISIBLE = 0x80,
+
+ ATTRZONE_WATERFUDGE = 0x400,
};
struct CAttributeZone
@@ -53,6 +55,7 @@ public:
static bool DoINeedToLoadCollision(void) { return (CurrentFlags_Player & ATTRZONE_DOINEEDCOLLISION) != 0; }
static bool PlayerNoRain(void) { return (CurrentFlags_Player & ATTRZONE_NORAIN) != 0; }
static bool CamNoRain(void) { return (CurrentFlags_Camera & ATTRZONE_NORAIN) != 0; }
+ static bool WaterFudge(void) { return (CurrentFlags_Camera & ATTRZONE_WATERFUDGE) != 0; }
static int32 GetWantedLevelDrop(void) { return CurrentWantedLevelDrop_Player; }
//--MIAMI: TODO
diff --git a/src/core/config.h b/src/core/config.h
index 42a9c5ff..c90d3cbf 100644
--- a/src/core/config.h
+++ b/src/core/config.h
@@ -205,6 +205,9 @@ enum Config {
#define RELOADABLES // some debug menu options to reload TXD files
#endif
+#define PC_WATER
+#define WATER_CHEATS
+
// Particle
#define PC_PARTICLE
//#define PS2_ALTERNATIVE_CARSPLASH // unused on PS2
diff --git a/src/core/main.cpp b/src/core/main.cpp
index aefabfc7..d95e7404 100644
--- a/src/core/main.cpp
+++ b/src/core/main.cpp
@@ -821,7 +821,7 @@ RenderScene(void)
CRenderer::RenderBoats();
CRenderer::RenderFadingInUnderwaterEntities();
RwRenderStateSet(rwRENDERSTATECULLMODE, (void*)rwCULLMODECULLNONE);
- // CWaterLevel::RenderTransparentWater();
+ CWaterLevel::RenderTransparentWater();
CRenderer::RenderFadingInEntities();
RwRenderStateSet(rwRENDERSTATECULLMODE, (void*)rwCULLMODECULLNONE);
CWeather::RenderRainStreaks();
@@ -1009,6 +1009,9 @@ Idle(void *arg)
#ifdef TIMEBARS
tbStartTimer(0, "CnstrRenderList");
#endif
+#ifdef PC_WATER
+ CWaterLevel::PreCalcWaterGeometry();
+#endif
CRenderer::ConstructRenderList();
#ifdef TIMEBARS
tbEndTimer("CnstrRenderList");