summaryrefslogtreecommitdiffstats
path: root/src/render/Shadows.cpp
diff options
context:
space:
mode:
authorFilip Gawin <filip.gawin@zoho.com>2020-04-19 18:34:08 +0200
committerFilip Gawin <filip.gawin@zoho.com>2020-04-20 18:18:46 +0200
commit370c4e48cd87122e8d38f1a72f6b8f62ff7b9c96 (patch)
tree5f5c66a542d7a121a7db88fed66e31f2a263b206 /src/render/Shadows.cpp
parentMerge pull request #474 from Nick007J/master (diff)
downloadre3-370c4e48cd87122e8d38f1a72f6b8f62ff7b9c96.tar
re3-370c4e48cd87122e8d38f1a72f6b8f62ff7b9c96.tar.gz
re3-370c4e48cd87122e8d38f1a72f6b8f62ff7b9c96.tar.bz2
re3-370c4e48cd87122e8d38f1a72f6b8f62ff7b9c96.tar.lz
re3-370c4e48cd87122e8d38f1a72f6b8f62ff7b9c96.tar.xz
re3-370c4e48cd87122e8d38f1a72f6b8f62ff7b9c96.tar.zst
re3-370c4e48cd87122e8d38f1a72f6b8f62ff7b9c96.zip
Diffstat (limited to '')
-rw-r--r--src/render/Shadows.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/render/Shadows.cpp b/src/render/Shadows.cpp
index 330f1b06..319cdd3c 100644
--- a/src/render/Shadows.cpp
+++ b/src/render/Shadows.cpp
@@ -719,10 +719,10 @@ CShadows::RenderStoredShadows(void)
float fStartY = shadowPos.y - fHeight;
float fEndY = shadowPos.y + fHeight;
- int32 nStartX = max(CWorld::GetSectorIndexX(fStartX), 0);
- int32 nStartY = max(CWorld::GetSectorIndexY(fStartY), 0);
- int32 nEndX = min(CWorld::GetSectorIndexX(fEndX), NUMSECTORS_X-1);
- int32 nEndY = min(CWorld::GetSectorIndexY(fEndY), NUMSECTORS_Y-1);
+ int32 nStartX = Max(CWorld::GetSectorIndexX(fStartX), 0);
+ int32 nStartY = Max(CWorld::GetSectorIndexY(fStartY), 0);
+ int32 nEndX = Min(CWorld::GetSectorIndexX(fEndX), NUMSECTORS_X-1);
+ int32 nEndY = Min(CWorld::GetSectorIndexY(fEndY), NUMSECTORS_Y-1);
CWorld::AdvanceCurrentScanCode();
@@ -865,10 +865,10 @@ CShadows::GeneratePolysForStaticShadow(int16 nStaticShadowID)
float fStartY = shadowPos.y - fHeight;
float fEndY = shadowPos.y + fHeight;
- int32 nStartX = max(CWorld::GetSectorIndexX(fStartX), 0);
- int32 nStartY = max(CWorld::GetSectorIndexY(fStartY), 0);
- int32 nEndX = min(CWorld::GetSectorIndexX(fEndX), NUMSECTORS_X-1);
- int32 nEndY = min(CWorld::GetSectorIndexY(fEndY), NUMSECTORS_Y-1);
+ int32 nStartX = Max(CWorld::GetSectorIndexX(fStartX), 0);
+ int32 nStartY = Max(CWorld::GetSectorIndexY(fStartY), 0);
+ int32 nEndX = Min(CWorld::GetSectorIndexX(fEndX), NUMSECTORS_X-1);
+ int32 nEndY = Min(CWorld::GetSectorIndexY(fEndY), NUMSECTORS_Y-1);
CWorld::AdvanceCurrentScanCode();
@@ -1008,11 +1008,11 @@ CShadows::CastShadowEntity(CEntity *pEntity, float fStartX, float fStartY, floa
Points[3].x = (fLengthRight - fFrontRight) - fSideRight;
Points[3].y = (fLengthForward - fFrontForward) - fSideForward;
- float MinX = min(min(Points[0].x, Points[1].x), min(Points[2].x, Points[3].x));
- float MaxX = max(max(Points[0].x, Points[1].x), max(Points[2].x, Points[3].x));
+ float MinX = Min(Min(Points[0].x, Points[1].x), Min(Points[2].x, Points[3].x));
+ float MaxX = Max(Max(Points[0].x, Points[1].x), Max(Points[2].x, Points[3].x));
- float MinY = min(min(Points[0].y, Points[1].y), min(Points[2].y, Points[3].y));
- float MaxY = max(max(Points[0].y, Points[1].y), max(Points[2].y, Points[3].y));
+ float MinY = Min(Min(Points[0].y, Points[1].y), Min(Points[2].y, Points[3].y));
+ float MaxY = Max(Max(Points[0].y, Points[1].y), Max(Points[2].y, Points[3].y));
float MaxZ = pPosn->z - pEntity->GetPosition().z;
float MinZ = MaxZ - fZDistance;
@@ -1763,7 +1763,7 @@ CShadows::RenderIndicatorShadow(uint32 nID, uint8 ShadowType, RwTexture *pTextur
{
ASSERT(pPosn != NULL);
- C3dMarkers::PlaceMarkerSet(nID, _TODOCONST(4), *pPosn, max(fFrontX, -fSideY),
+ C3dMarkers::PlaceMarkerSet(nID, _TODOCONST(4), *pPosn, Max(fFrontX, -fSideY),
0, 128, 255, 128,
2048, 0.2f, 0);
}