aboutsummaryrefslogtreecommitdiff
path: root/engines/zvision
diff options
context:
space:
mode:
Diffstat (limited to 'engines/zvision')
-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;