summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authoreray orçunus <erayorcunus@gmail.com>2020-07-22 23:31:06 +0200
committereray orçunus <erayorcunus@gmail.com>2020-07-22 23:31:06 +0200
commit7e32c603fc0f9a7ec0f3fc1ab224b3b20c769eaf (patch)
tree9126974a1c8bfa8ac8f9f3879fb63edfe7320238 /src
parentMerge pull request #659 from erorcun/master (diff)
downloadre3-7e32c603fc0f9a7ec0f3fc1ab224b3b20c769eaf.tar
re3-7e32c603fc0f9a7ec0f3fc1ab224b3b20c769eaf.tar.gz
re3-7e32c603fc0f9a7ec0f3fc1ab224b3b20c769eaf.tar.bz2
re3-7e32c603fc0f9a7ec0f3fc1ab224b3b20c769eaf.tar.lz
re3-7e32c603fc0f9a7ec0f3fc1ab224b3b20c769eaf.tar.xz
re3-7e32c603fc0f9a7ec0f3fc1ab224b3b20c769eaf.tar.zst
re3-7e32c603fc0f9a7ec0f3fc1ab224b3b20c769eaf.zip
Diffstat (limited to 'src')
-rw-r--r--src/core/General.h2
-rw-r--r--src/core/Radar.cpp6
-rw-r--r--src/math/maths.h2
-rw-r--r--src/peds/Ped.cpp2
-rw-r--r--src/render/Renderer.cpp8
5 files changed, 11 insertions, 9 deletions
diff --git a/src/core/General.h b/src/core/General.h
index 7ffa99de..dde43c0f 100644
--- a/src/core/General.h
+++ b/src/core/General.h
@@ -108,7 +108,7 @@ public:
if (angle >= TWOPI)
angle -= TWOPI;
- return (int)floorf(angle / DEGTORAD(45.0f));
+ return (int)Floor(angle / DEGTORAD(45.0f));
}
// Unlike usual string comparison functions, these don't care about greater or lesser
diff --git a/src/core/Radar.cpp b/src/core/Radar.cpp
index 9406f1bd..05002a3f 100644
--- a/src/core/Radar.cpp
+++ b/src/core/Radar.cpp
@@ -746,8 +746,8 @@ void CRadar::DrawRadarMap()
DrawRadarMask();
// top left ist (0, 0)
- int x = floorf((vec2DRadarOrigin.x - RADAR_MIN_X) / RADAR_TILE_SIZE);
- int y = ceilf((RADAR_NUM_TILES - 1) - (vec2DRadarOrigin.y - RADAR_MIN_Y) / RADAR_TILE_SIZE);
+ int x = Floor((vec2DRadarOrigin.x - RADAR_MIN_X) / RADAR_TILE_SIZE);
+ int y = Ceil((RADAR_NUM_TILES - 1) - (vec2DRadarOrigin.y - RADAR_MIN_Y) / RADAR_TILE_SIZE);
StreamRadarSections(x, y);
RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void*)FALSE);
@@ -1251,7 +1251,7 @@ void CRadar::Shutdown()
void CRadar::StreamRadarSections(const CVector &posn)
{
- StreamRadarSections(floorf((2000.0f + posn.x) / 500.0f), ceilf(7.0f - (2000.0f + posn.y) / 500.0f));
+ StreamRadarSections(Floor((2000.0f + posn.x) / 500.0f), Ceil(7.0f - (2000.0f + posn.y) / 500.0f));
}
void CRadar::StreamRadarSections(int32 x, int32 y)
diff --git a/src/math/maths.h b/src/math/maths.h
index 51b0ef10..8d68bf64 100644
--- a/src/math/maths.h
+++ b/src/math/maths.h
@@ -15,3 +15,5 @@ inline float Sqrt(float x) { return sqrtf(x); }
inline float RecipSqrt(float x, float y) { return x/Sqrt(y); }
inline float RecipSqrt(float x) { return RecipSqrt(1.0f, x); }
inline float Pow(float x, float y) { return powf(x, y); }
+inline float Floor(float x) { return floorf(x); }
+inline float Ceil(float x) { return ceilf(x); }
diff --git a/src/peds/Ped.cpp b/src/peds/Ped.cpp
index 4d83f5aa..f52b373e 100644
--- a/src/peds/Ped.cpp
+++ b/src/peds/Ped.cpp
@@ -9349,7 +9349,7 @@ CPed::ProcessControl(void)
m_collidingEntityWhileFleeing = collidingEnt;
m_collidingEntityWhileFleeing->RegisterReference((CEntity **) &m_collidingEntityWhileFleeing);
- uint8 currentDir = floorf((PI + m_fRotationCur) / DEGTORAD(45.0f));
+ uint8 currentDir = Floor((PI + m_fRotationCur) / DEGTORAD(45.0f));
uint8 nextDir;
ThePaths.FindNextNodeWandering(PATH_PED, GetPosition(), &m_pLastPathNode, &m_pNextPathNode, currentDir, &nextDir);
diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp
index d02ecec5..88d412c9 100644
--- a/src/render/Renderer.cpp
+++ b/src/render/Renderer.cpp
@@ -857,9 +857,9 @@ CRenderer::ScanSectorPoly(RwV2d *poly, int32 numVertices, void (*scanfunc)(CPtrL
// prestep x1 and x2 to next integer y
deltaA = CalcNewDelta(&poly[a1], &poly[a2]);
- xA = deltaA * (ceilf(poly[a1].y) - poly[a1].y) + poly[a1].x;
+ xA = deltaA * (Ceil(poly[a1].y) - poly[a1].y) + poly[a1].x;
deltaB = CalcNewDelta(&poly[b1], &poly[b2]);
- xB = deltaB * (ceilf(poly[b1].y) - poly[b1].y) + poly[b1].x;
+ xB = deltaB * (Ceil(poly[b1].y) - poly[b1].y) + poly[b1].x;
if(y != yend){
if(deltaB < 0.0f && (int)xB < xstart)
@@ -904,7 +904,7 @@ CRenderer::ScanSectorPoly(RwV2d *poly, int32 numVertices, void (*scanfunc)(CPtrL
xstart = poly[b1].x;
}while(y == (int)poly[b2].y);
deltaB = CalcNewDelta(&poly[b1], &poly[b2]);
- xB = deltaB * (ceilf(poly[b1].y) - poly[b1].y) + poly[b1].x;
+ xB = deltaB * (Ceil(poly[b1].y) - poly[b1].y) + poly[b1].x;
if(deltaB < 0.0f && (int)xB < xstart)
xstart = xB;
}
@@ -940,7 +940,7 @@ CRenderer::ScanSectorPoly(RwV2d *poly, int32 numVertices, void (*scanfunc)(CPtrL
xend = poly[a1].x;
}while(y == (int)poly[a2].y);
deltaA = CalcNewDelta(&poly[a1], &poly[a2]);
- xA = deltaA * (ceilf(poly[a1].y) - poly[a1].y) + poly[a1].x;
+ xA = deltaA * (Ceil(poly[a1].y) - poly[a1].y) + poly[a1].x;
if(deltaA >= 0.0f && (int)xA > xend)
xend = xA;
}