From dbbf39098327261d2e29424156789232e5e85517 Mon Sep 17 00:00:00 2001 From: aap Date: Thu, 7 May 2020 13:38:14 +0200 Subject: [PATCH] use water color and new water texture --- src/render/Timecycle.h | 5 +++++ src/render/WaterLevel.cpp | 13 +++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/render/Timecycle.h b/src/render/Timecycle.h index 2b835ddc..dc52d493 100644 --- a/src/render/Timecycle.h +++ b/src/render/Timecycle.h @@ -173,6 +173,11 @@ public: static int GetFogBlue(void) { return m_nCurrentFogColourBlue; } static int GetFogReduction(void) { return m_FogReduction; } + static int GetWaterRed(void) { return m_fCurrentWaterRed; } + static int GetWaterGreen(void) { return m_fCurrentWaterGreen; } + static int GetWaterBlue(void) { return m_fCurrentWaterBlue; } + static int GetWaterAlpha(void) { return m_fCurrentWaterAlpha; } + static void Initialise(void); static void Update(void); static CVector &GetSunPosition(void) { return m_VectorToSun[m_CurrentStoredValue]; } diff --git a/src/render/WaterLevel.cpp b/src/render/WaterLevel.cpp index 37ae1dfa..7e26654c 100644 --- a/src/render/WaterLevel.cpp +++ b/src/render/WaterLevel.cpp @@ -36,9 +36,6 @@ RpAtomic *CWaterLevel::ms_pWavyAtomic; RpGeometry *CWaterLevel::apGeomArray[8]; int16 CWaterLevel::nGeomUsed; -//RwTexture *gpWaterTex; -//RwRaster *gpWaterRaster; - RwTexture *gpWaterTex; RwRaster *gpWaterRaster; @@ -84,7 +81,7 @@ CWaterLevel::Initialise(char *pWaterDat) CTxdStore::SetCurrentTxd(slot); if ( gpWaterTex == NULL ) - gpWaterTex = RwTextureRead("water_old", NULL); + gpWaterTex = RwTextureRead("waterclear256", NULL); gpWaterRaster = RwTextureGetRaster(gpWaterTex); CTxdStore::PopCurrentTxd(); @@ -364,10 +361,10 @@ CWaterLevel::RenderWater() WavesCalculatedThisFrame = false; RwRGBA color = { 0, 0, 0, 255 }; - - color.red = uint32((CTimeCycle::GetDirectionalRed() * 0.5f + CTimeCycle::GetAmbientRed() ) * 255.0f); - color.green = uint32((CTimeCycle::GetDirectionalGreen() * 0.5f + CTimeCycle::GetAmbientGreen()) * 255.0f); - color.blue = uint32((CTimeCycle::GetDirectionalBlue() * 0.5f + CTimeCycle::GetAmbientBlue() ) * 255.0f); + + color.red = CTimeCycle::GetWaterRed(); + color.green = CTimeCycle::GetWaterGreen(); + color.blue = CTimeCycle::GetWaterBlue(); TempBufferVerticesStored = 0; TempBufferIndicesStored = 0;