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/titanic/star_control/star_control_sub5.cpp | |
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/titanic/star_control/star_control_sub5.cpp')
-rw-r--r-- | engines/titanic/star_control/star_control_sub5.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
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; } } } |