From 3cb6a84f035b40b4c4862719811a04e02afe2137 Mon Sep 17 00:00:00 2001 From: Cameron Cawley Date: Thu, 3 Oct 2019 22:10:00 +0100 Subject: BLADERUNNER: Remove use of C99 math functions --- engines/bladerunner/rect_float.h | 9 +++++---- engines/bladerunner/slice_renderer.cpp | 6 +++--- 2 files changed, 8 insertions(+), 7 deletions(-) (limited to 'engines/bladerunner') diff --git a/engines/bladerunner/rect_float.h b/engines/bladerunner/rect_float.h index 4b7fea31bd..69e1ce0a2e 100644 --- a/engines/bladerunner/rect_float.h +++ b/engines/bladerunner/rect_float.h @@ -24,6 +24,7 @@ #define BLADERUNNER_RECT_FLOAT_H #include "common/debug.h" +#include "common/math.h" #include "common/types.h" #include "common/util.h" @@ -50,10 +51,10 @@ struct RectFloat { } void trunc_2_decimals() { - x0 = truncf(x0 * 100.0f) / 100.0f; - y0 = truncf(y0 * 100.0f) / 100.0f; - x1 = truncf(x1 * 100.0f) / 100.0f; - y1 = truncf(y1 * 100.0f) / 100.0f; + x0 = Common::trunc(x0 * 100.0f) / 100.0f; + y0 = Common::trunc(y0 * 100.0f) / 100.0f; + x1 = Common::trunc(x1 * 100.0f) / 100.0f; + y1 = Common::trunc(y1 * 100.0f) / 100.0f; } }; diff --git a/engines/bladerunner/slice_renderer.cpp b/engines/bladerunner/slice_renderer.cpp index 376aa1ec7d..54cc0f4120 100644 --- a/engines/bladerunner/slice_renderer.cpp +++ b/engines/bladerunner/slice_renderer.cpp @@ -614,9 +614,9 @@ void SliceRenderer::drawShadowInWorld(int transparency, Graphics::Surface &surfa 0.0f, 0.0f, 1.0f, _position.z); Matrix4x3 mRotation( - cosf(_facing), -sinf(_facing), 0.0f, 0.0f, - sinf(_facing), cosf(_facing), 0.0f, 0.0f, - 0.0f, 0.0f, 1.0f, 0.0f); + cos(_facing), -sin(_facing), 0.0f, 0.0f, + sin(_facing), cos(_facing), 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f); Matrix4x3 mScale( _frameScale.x, 0.0f, 0.0f, 0.0f, -- cgit v1.2.3