diff options
author | erorcun <erorcunerorcun@hotmail.com.tr> | 2020-12-15 15:45:06 +0100 |
---|---|---|
committer | erorcun <erorcunerorcun@hotmail.com.tr> | 2020-12-15 15:45:06 +0100 |
commit | 970f84514a45e0181bd05ae02493908ec86f5683 (patch) | |
tree | 37e568870361124e7e34dfe20a7f66af254a8d39 /src/render/WaterLevel.h | |
parent | Radio scroll to prev. station & radio off text (diff) | |
parent | fixed water.dat code (diff) | |
download | re3-970f84514a45e0181bd05ae02493908ec86f5683.tar re3-970f84514a45e0181bd05ae02493908ec86f5683.tar.gz re3-970f84514a45e0181bd05ae02493908ec86f5683.tar.bz2 re3-970f84514a45e0181bd05ae02493908ec86f5683.tar.lz re3-970f84514a45e0181bd05ae02493908ec86f5683.tar.xz re3-970f84514a45e0181bd05ae02493908ec86f5683.tar.zst re3-970f84514a45e0181bd05ae02493908ec86f5683.zip |
Diffstat (limited to 'src/render/WaterLevel.h')
-rw-r--r-- | src/render/WaterLevel.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/render/WaterLevel.h b/src/render/WaterLevel.h index 269d6091..cf3537ae 100644 --- a/src/render/WaterLevel.h +++ b/src/render/WaterLevel.h @@ -1,9 +1,9 @@ #pragma once -#define WATER_BLOCK_SIZE LARGE_SECTOR_SIZE -#define WATER_FINEBLOCK_SIZE HUGE_SECTOR_SIZE #define WATER_Z_OFFSET (1.5f) +#define NO_WATER -128 + #define MAX_SMALL_SECTORS 128 #define MAX_LARGE_SECTORS 64 #define MAX_HUGE_SECTORS 32 @@ -23,7 +23,6 @@ #define WATER_WIDTH ((WATER_END_X - WATER_START_X)) #define WATER_HEIGHT ((WATER_END_Y - WATER_START_Y)) - #define WATER_UNSIGN_X(x) ( (x) + (WATER_WIDTH /2) ) #define WATER_UNSIGN_Y(y) ( (y) + (WATER_HEIGHT/2) ) #define WATER_SIGN_X(x) ( (x) - (WATER_WIDTH /2) ) @@ -72,8 +71,8 @@ class CWaterLevel static int32 ms_nNoOfWaterLevels; static float ms_aWaterZs[48]; static CRect ms_aWaterRects[48]; - static uint8 aWaterBlockList[WATER_BLOCK_SIZE][WATER_BLOCK_SIZE]; - static uint8 aWaterFineBlockList[WATER_FINEBLOCK_SIZE][WATER_FINEBLOCK_SIZE]; + static int8 aWaterBlockList[MAX_LARGE_SECTORS][MAX_LARGE_SECTORS]; + static int8 aWaterFineBlockList[MAX_SMALL_SECTORS][MAX_SMALL_SECTORS]; static bool WavesCalculatedThisFrame; static RpAtomic *ms_pWavyAtomic; static RpGeometry *apGeomArray[MAX_BOAT_WAKES]; @@ -84,6 +83,10 @@ public: static void Shutdown(); static void CreateWavyAtomic(); static void DestroyWavyAtomic(); + static void AddWaterLevel(float fXLeft, float fYBottom, float fXRight, float fYTop, float fLevel); + static bool WaterLevelAccordingToRectangles(float fX, float fY, float *pfOutLevel = nil); + static bool TestVisibilityForFineWaterBlocks(const CVector &worldPos); + static void RemoveIsolatedWater(); static bool GetWaterLevel(float fX, float fY, float fZ, float *pfOutLevel, bool bDontCheckZ); static bool GetWaterLevel(CVector coors, float *pfOutLevel, bool bDontCheckZ) { return GetWaterLevel(coors.x, coors.y, coors.z, pfOutLevel, bDontCheckZ); } static bool GetWaterLevelNoWaves(float fX, float fY, float fZ, float *pfOutLevel); |