aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Fioramonti2018-05-24 19:05:07 -0700
committerThierry Crozat2018-07-03 23:08:48 +0100
commitad15747c6da2298282d8d08e6003b8be85889e43 (patch)
tree33de091158a6c405d7d52cd47fc3d49661b66bc8
parent503f0c8f0bc1dc8311e598c6556ee556f32b6c44 (diff)
downloadscummvm-rg350-ad15747c6da2298282d8d08e6003b8be85889e43.tar.gz
scummvm-rg350-ad15747c6da2298282d8d08e6003b8be85889e43.tar.bz2
scummvm-rg350-ad15747c6da2298282d8d08e6003b8be85889e43.zip
ZVISION: Use degree conversion common math funcs
-rw-r--r--engines/zvision/graphics/render_table.cpp8
1 files 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<float>(_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<float>(_tiltOptions.fieldOfView);
float cylinderRadius = halfWidth / tan(fovInRadians);
_tiltOptions.gap = cylinderRadius * atan2((float)(halfHeight / cylinderRadius), 1.0f) * _tiltOptions.linearScale;