summaryrefslogtreecommitdiffstats
path: root/src/render/WaterLevel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/render/WaterLevel.cpp')
-rw-r--r--src/render/WaterLevel.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/render/WaterLevel.cpp b/src/render/WaterLevel.cpp
index 08fd5e6e..3d33dbf6 100644
--- a/src/render/WaterLevel.cpp
+++ b/src/render/WaterLevel.cpp
@@ -73,7 +73,7 @@ RwRaster *gpWaterEnvBaseRaster;
RwRaster *gpWaterWakeRaster;
bool _bSeaLife;
-float _fWaterZOffset = 0.5f;
+float _fWaterZOffset = WATER_Z_OFFSET;
#ifdef PC_WATER
float fEnvScale = 0.25f;
@@ -318,6 +318,7 @@ CWaterLevel::Shutdown()
_DELETE_TEXTURE(gpWaterTex);
_DELETE_TEXTURE(gpWaterEnvTex);
+ _DELETE_TEXTURE(gpWaterWakeTex);
_DELETE_TEXTURE(gpWaterEnvBaseTex);
#undef _DELETE_TEXTURE
@@ -714,9 +715,9 @@ CWaterLevel::GetWaterLevel(float fX, float fY, float fZ, float *pfOutLevel, bool
if ( y < 0 || y >= MAX_SMALL_SECTORS ) return false;
#endif
- uint8 nBlock = aWaterFineBlockList[x][y];
+ int8 nBlock = aWaterFineBlockList[x][y];
- if ( nBlock == 0x80 )
+ if ( nBlock == NO_WATER )
return false;
ASSERT( pfOutLevel != nil );
@@ -756,9 +757,9 @@ CWaterLevel::GetWaterLevelNoWaves(float fX, float fY, float fZ, float *pfOutLeve
if ( y < 0 || y >= MAX_SMALL_SECTORS ) return false;
#endif
- uint8 nBlock = aWaterFineBlockList[x][y];
+ int8 nBlock = aWaterFineBlockList[x][y];
- if ( nBlock == 0x80 )
+ if ( nBlock == NO_WATER )
return false;
ASSERT( pfOutLevel != nil );
@@ -1076,7 +1077,7 @@ CWaterLevel::RenderWater()
{
for ( int32 y = 0; y < 5; y++ )
{
- float fX = WATER_SIGN_X(float(x) * EXTRAHUGE_SECTOR_SIZE) - 1280.0f - 400.0f;
+ float fX = WATER_SIGN_X(float(x) * EXTRAHUGE_SECTOR_SIZE) - 1280.0f - WATER_X_OFFSET;
float fY = WATER_SIGN_Y(float(y) * EXTRAHUGE_SECTOR_SIZE) - 1280.0f;
if ( !bUseCamStartY )
@@ -1462,7 +1463,7 @@ CWaterLevel::RenderTransparentWater(void)
int32 nBlock;
- int32 BlockX = WATER_TO_SMALL_SECTOR_X(fCamX + 400.0f) + 1;
+ int32 BlockX = WATER_TO_SMALL_SECTOR_X(fCamX + WATER_X_OFFSET) + 1;
int32 BlockY = WATER_TO_SMALL_SECTOR_Y(fCamY) + 1;
if (_IsColideWithBlock(BlockX, BlockY, nBlock))
@@ -1472,7 +1473,7 @@ CWaterLevel::RenderTransparentWater(void)
float fMaskX = Floor(fCamX / 2.0f) * 2.0f;
float fMaskY = Floor(fCamY / 2.0f) * 2.0f;
float fWaterZ = CWaterLevel::ms_aWaterZs[nBlock];
- float fSectorX = WATER_FROM_SMALL_SECTOR_X(BlockX) - 400.0f;
+ float fSectorX = WATER_FROM_SMALL_SECTOR_X(BlockX) - WATER_X_OFFSET;
float fSectorY = WATER_FROM_SMALL_SECTOR_Y(BlockY);
RenderWavyMask(fMaskX, fMaskY, fWaterZ,