aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2017-05-26 23:23:45 -0400
committerPaul Gilbert2017-05-26 23:23:45 -0400
commit7d8cff02313d8b7829acb9ad66ed35e853703ec1 (patch)
tree0ec9e4abe7586b06b19933a13c417ea1df082c39
parent50a6100d27803a070f019aafb816151cb775dfe9 (diff)
downloadscummvm-rg350-7d8cff02313d8b7829acb9ad66ed35e853703ec1.tar.gz
scummvm-rg350-7d8cff02313d8b7829acb9ad66ed35e853703ec1.tar.bz2
scummvm-rg350-7d8cff02313d8b7829acb9ad66ed35e853703ec1.zip
TITANIC: Fix calculation of acceleration powers table
-rw-r--r--engines/titanic/star_control/star_control_sub23.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/engines/titanic/star_control/star_control_sub23.cpp b/engines/titanic/star_control/star_control_sub23.cpp
index 6e0b99f986..a9a8b05934 100644
--- a/engines/titanic/star_control/star_control_sub23.cpp
+++ b/engines/titanic/star_control/star_control_sub23.cpp
@@ -89,15 +89,13 @@ void CStarControlSub23::proc6(int val1, int val2, float val) {
_field48 = 31;
_field3C = (double)val2 * _field38;
- if (_powers.empty())
- _powers.resize(32);
-
// Calculate the powers table
- double exponent = 0.0, total = 0.0;
+ double base = 0.0, total = 0.0;
+ _powers.resize(32);
for (int idx = 31; idx >= 0; --idx) {
- _powers[idx] = pow(4.0, exponent);
+ _powers[idx] = pow(base, 4.0);
total += _powers[idx];
- exponent += 0.03125;
+ base += 0.03125;
}
for (int idx = 0; idx < 32; ++idx) {