aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Fioramonti2017-08-27 05:05:51 -0700
committerDavid Fioramonti2017-08-27 05:30:24 -0700
commit42cdd66f81b27e40a2e50556da64b8576a07ef87 (patch)
treeb3e2c6258c15826a405ff8b600ca618c22a50887
parenta95df4aa72ceb690a15550cbf52c2a55f18b5e3e (diff)
downloadscummvm-rg350-42cdd66f81b27e40a2e50556da64b8576a07ef87.tar.gz
scummvm-rg350-42cdd66f81b27e40a2e50556da64b8576a07ef87.tar.bz2
scummvm-rg350-42cdd66f81b27e40a2e50556da64b8576a07ef87.zip
TITANIC: Move Rad2Deg from dvector to fvector
I wanted to use that variable in viewport.cpp and since fvector.h is included in more functions (already) then dvector it makes sense to move it there.
-rw-r--r--engines/titanic/star_control/dvector.h3
-rw-r--r--engines/titanic/star_control/fvector.h2
-rw-r--r--engines/titanic/star_control/viewport.cpp5
3 files changed, 4 insertions, 6 deletions
diff --git a/engines/titanic/star_control/dvector.h b/engines/titanic/star_control/dvector.h
index 4b85c0342d..e9ca257498 100644
--- a/engines/titanic/star_control/dvector.h
+++ b/engines/titanic/star_control/dvector.h
@@ -27,9 +27,6 @@
namespace Titanic {
-const double Rad2Deg = 180.0 / M_PI;
-const double Deg2Rad = 1.0 / Rad2Deg;
-
class DAffine;
/**
diff --git a/engines/titanic/star_control/fvector.h b/engines/titanic/star_control/fvector.h
index d4ba754138..5303702699 100644
--- a/engines/titanic/star_control/fvector.h
+++ b/engines/titanic/star_control/fvector.h
@@ -27,6 +27,8 @@
namespace Titanic {
+const double Rad2Deg = 180.0 / M_PI;
+const double Deg2Rad = 1.0 / Rad2Deg;
enum Axis { X_AXIS, Y_AXIS, Z_AXIS };
class FPose;
diff --git a/engines/titanic/star_control/viewport.cpp b/engines/titanic/star_control/viewport.cpp
index d2bdce00e0..fb933f240a 100644
--- a/engines/titanic/star_control/viewport.cpp
+++ b/engines/titanic/star_control/viewport.cpp
@@ -246,7 +246,6 @@ void CViewport::fn19(double *v1, double *v2, double *v3, double *v4) {
}
void CViewport::reset() {
- const double FACTOR = 2 * M_PI / 360.0;
_rawPose.copyFrom(_orientation);
_rawPose._vector = _position;
@@ -254,8 +253,8 @@ void CViewport::reset() {
_center = FPoint((double)_width * 0.5, (double)_height * 0.5);
_centerVector._x = MIN(_center._x, _center._y);
- _centerVector._y = tan(_field18 * FACTOR);
- _centerVector._z = tan(_field1C * FACTOR);
+ _centerVector._y = tan(_field18 * Deg2Rad);
+ _centerVector._z = tan(_field1C * Deg2Rad);
_flag = true;
}