diff options
author | Michael DrĂ¼ing | 2017-03-14 22:06:24 +0100 |
---|---|---|
committer | Paul Gilbert | 2017-03-15 20:33:44 -0400 |
commit | a75e3863399a13db1fd518c6fca524d2bace4670 (patch) | |
tree | b58d3bd302f0411803819dc092d12f20e45eb748 /engines | |
parent | 890122475f1277c4ebea6a39721fcd8a2b5f5087 (diff) | |
download | scummvm-rg350-a75e3863399a13db1fd518c6fca524d2bace4670.tar.gz scummvm-rg350-a75e3863399a13db1fd518c6fca524d2bace4670.tar.bz2 scummvm-rg350-a75e3863399a13db1fd518c6fca524d2bace4670.zip |
TITANIC: Change some constants to more sensible ones
Diffstat (limited to 'engines')
5 files changed, 9 insertions, 9 deletions
diff --git a/engines/titanic/star_control/star_control_sub13.cpp b/engines/titanic/star_control/star_control_sub13.cpp index e82ad3a3f1..72badde76e 100644 --- a/engines/titanic/star_control/star_control_sub13.cpp +++ b/engines/titanic/star_control/star_control_sub13.cpp @@ -257,7 +257,7 @@ void CStarControlSub13::fn19(double *v1, double *v2, double *v3, double *v4) { } void CStarControlSub13::reset() { - const double FACTOR = 3.1415927 * 0.0055555557; + const double FACTOR = 2 * M_PI / 360.0; _sub2.copyFrom(_matrix); _sub2._vector._x = _position._x; diff --git a/engines/titanic/star_control/star_control_sub5.cpp b/engines/titanic/star_control/star_control_sub5.cpp index 4ca22ff922..775c24cb42 100644 --- a/engines/titanic/star_control/star_control_sub5.cpp +++ b/engines/titanic/star_control/star_control_sub5.cpp @@ -37,7 +37,7 @@ bool CStarControlSub5::SineTable::setup() { if (_data.empty()) { _data.resize(1024); for (int idx = 0; idx < 1024; ++idx) - _data[idx] = sin((double)idx * 6.283185307179586 * 0.001953125); + _data[idx] = sin((double)idx * 2 * M_PI / 512.0); } return true; @@ -63,7 +63,7 @@ bool CStarControlSub5::setup() { bool CStarControlSub5::setup2(int val1, int val2) { // TODO: Original set an explicit random seed here. Could be // problematic if following random values need to be deterministic - const double FACTOR = 3.1415927 * 0.0055555557; + const double FACTOR = 2 * M_PI / 360.0; const int VALUES1[] = { 0x800, 0xC00, 0x1000, 0x1400, 0x1800 }; const int VALUES2[] = { 0xF95BCD, 0xA505A0, 0xFFAD43, 0x98F4EB, 0xF3EFA5, 0, @@ -162,7 +162,7 @@ bool CStarControlSub5::setup2(int val1, int val2) { e->_field8 = g_vm->getRandomNumber(3) + 3; e->_fieldC = g_vm->getRandomNumber(255); e->_field10 = FACTOR * 17.0; - e->_field14 = 0.00390625; + e->_field14 = 1 / 256.0; } else { for (int ctr = 0; ctr < 5; ++ctr) { e->_field0 = static_cast<int>(g_vm->getRandomFloat() * 1350.0 @@ -176,7 +176,7 @@ bool CStarControlSub5::setup2(int val1, int val2) { e->_fieldC = g_vm->getRandomNumber(255); e->_field10 = FACTOR * (double)g_vm->getRandomNumber(15); e->_field14 = ((double)g_vm->getRandomNumber(0xfffffffe) - * 50.0 * 0.000015259022) * 0.00390625; + * 50.0 / 65536.0) / 256.0; } } } diff --git a/engines/titanic/star_control/star_control_sub6.cpp b/engines/titanic/star_control/star_control_sub6.cpp index e45d6d2c57..a93f128f59 100644 --- a/engines/titanic/star_control/star_control_sub6.cpp +++ b/engines/titanic/star_control/star_control_sub6.cpp @@ -53,7 +53,7 @@ void CStarControlSub6::identity() { } void CStarControlSub6::setRotationMatrix(Axis axis, double amount) { - const double ROTATION = 3.1415927 * 0.0055555557; + const double ROTATION = 2 * M_PI / 360.0; double sinVal = sin(amount * ROTATION); double cosVal = cos(amount * ROTATION); diff --git a/engines/titanic/star_control/star_points1.cpp b/engines/titanic/star_control/star_points1.cpp index c72795f11d..ab5da111ac 100644 --- a/engines/titanic/star_control/star_points1.cpp +++ b/engines/titanic/star_control/star_points1.cpp @@ -27,7 +27,7 @@ namespace Titanic { #define ARRAY_COUNT 876 -const double FACTOR = 3.1415927 * 0.0055555557; +const double FACTOR = 2 * M_PI / 360.0; CStarPoints1::CStarPoints1() { } diff --git a/engines/titanic/star_control/star_points2.cpp b/engines/titanic/star_control/star_points2.cpp index 9c4cfe8cf5..7a3e873e90 100644 --- a/engines/titanic/star_control/star_points2.cpp +++ b/engines/titanic/star_control/star_points2.cpp @@ -27,7 +27,7 @@ namespace Titanic { #define ARRAY_COUNT 80 -const double FACTOR = 3.1415927 * 0.0055555557; +const double FACTOR = 2 * M_PI / 360.0; bool CStarPoints2::initialize() { // Get a reference to the starfield points resource @@ -47,7 +47,7 @@ bool CStarPoints2::initialize() { v1 = stream->readSint32LE(); v2 = stream->readSint32LE(); v1 *= 0.015 * FACTOR; - v2 *= 0.0099999998 * FACTOR; + v2 *= FACTOR / 100.0; entry._x = cos(v1) * 3000000.0 * cos(v2); entry._y = sin(v1) * 3000000.0 * cos(v2); |