From 63d0bdc863f76d018fc8cf3209a9210bc71f0421 Mon Sep 17 00:00:00 2001 From: Fire-Head Date: Wed, 27 May 2020 21:50:01 +0300 Subject: VC Water --- src/core/Game.cpp | 9 ++++++++- src/core/Game.h | 1 + src/core/ZoneCull.h | 3 +++ src/core/config.h | 2 ++ src/core/main.cpp | 5 ++++- 5 files changed, 18 insertions(+), 2 deletions(-) (limited to 'src/core') 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; @@ -685,6 +685,13 @@ CGame::InitAfterFocusLoss() FrontEndMenuManager.m_bStartUpFrontEndRequested = true; } +bool +CGame::CanSeeWaterFromCurrArea(void) +{ + return currArea == AREA_MAIN_MAP || currArea == AREA_MANSION + || currArea == AREA_HOTEL; +} + bool CGame::CanSeeOutSideFromCurrArea(void) { 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/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..8a327000 100644 --- a/src/core/config.h +++ b/src/core/config.h @@ -205,6 +205,8 @@ enum Config { #define RELOADABLES // some debug menu options to reload TXD files #endif +//#define PC_WATER + // 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(); @@ -1008,6 +1008,9 @@ Idle(void *arg) #endif #ifdef TIMEBARS tbStartTimer(0, "CnstrRenderList"); +#endif +#ifdef PC_WATER + CWaterLevel::PreCalcWaterGeometry(); #endif CRenderer::ConstructRenderList(); #ifdef TIMEBARS -- cgit v1.2.3 From 895580c724d2d21932dbaec5308a6d15458c8142 Mon Sep 17 00:00:00 2001 From: Fire-Head Date: Thu, 28 May 2020 00:15:37 +0300 Subject: seagulls, ships --- src/core/Pad.cpp | 26 ++++++++++++++++++++++++++ src/core/config.h | 3 ++- 2 files changed, 28 insertions(+), 1 deletion(-) (limited to 'src/core') 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/config.h b/src/core/config.h index 8a327000..c90d3cbf 100644 --- a/src/core/config.h +++ b/src/core/config.h @@ -205,7 +205,8 @@ enum Config { #define RELOADABLES // some debug menu options to reload TXD files #endif -//#define PC_WATER +#define PC_WATER +#define WATER_CHEATS // Particle #define PC_PARTICLE -- cgit v1.2.3