From ad15747c6da2298282d8d08e6003b8be85889e43 Mon Sep 17 00:00:00 2001 From: David Fioramonti Date: Thu, 24 May 2018 19:05:07 -0700 Subject: ZVISION: Use degree conversion common math funcs --- engines/zvision/graphics/render_table.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/engines/zvision/graphics/render_table.cpp b/engines/zvision/graphics/render_table.cpp index df73247344..815a1b0f9d 100644 --- a/engines/zvision/graphics/render_table.cpp +++ b/engines/zvision/graphics/render_table.cpp @@ -20,9 +20,11 @@ * */ -#include "common/scummsys.h" #include "zvision/graphics/render_table.h" + +#include "common/math.h" #include "common/rect.h" +#include "common/scummsys.h" #include "graphics/colormasks.h" namespace ZVision { @@ -144,7 +146,7 @@ void RenderTable::generatePanoramaLookupTable() { float halfWidth = (float)_numColumns / 2.0f; float halfHeight = (float)_numRows / 2.0f; - float fovInRadians = (_panoramaOptions.fieldOfView * M_PI / 180.0f); + float fovInRadians = Common::deg2rad(_panoramaOptions.fieldOfView); float cylinderRadius = halfHeight / tan(fovInRadians); for (uint x = 0; x < _numColumns; ++x) { @@ -176,7 +178,7 @@ void RenderTable::generateTiltLookupTable() { float halfWidth = (float)_numColumns / 2.0f; float halfHeight = (float)_numRows / 2.0f; - float fovInRadians = (_tiltOptions.fieldOfView * M_PI / 180.0f); + float fovInRadians = Common::deg2rad(_tiltOptions.fieldOfView); float cylinderRadius = halfWidth / tan(fovInRadians); _tiltOptions.gap = cylinderRadius * atan2((float)(halfHeight / cylinderRadius), 1.0f) * _tiltOptions.linearScale; -- cgit v1.2.3