diff options
author | Paul Gilbert | 2017-02-25 15:03:16 -0500 |
---|---|---|
committer | Paul Gilbert | 2017-02-25 15:03:16 -0500 |
commit | 16d21cd0ff7fa200664fb75b915da015cccc8a48 (patch) | |
tree | 6881e7f0cf1b9caeaaf663880916f0bf5822e42a /engines/titanic/star_control | |
parent | 77d232fbe277aead010c66fc80d53666e9ab29a1 (diff) | |
download | scummvm-rg350-16d21cd0ff7fa200664fb75b915da015cccc8a48.tar.gz scummvm-rg350-16d21cd0ff7fa200664fb75b915da015cccc8a48.tar.bz2 scummvm-rg350-16d21cd0ff7fa200664fb75b915da015cccc8a48.zip |
TITANIC: Fix CStarPoints2 initialization
Diffstat (limited to 'engines/titanic/star_control')
-rw-r--r-- | engines/titanic/star_control/star_points2.cpp | 9 | ||||
-rw-r--r-- | engines/titanic/star_control/star_points2.h | 9 |
2 files changed, 7 insertions, 11 deletions
diff --git a/engines/titanic/star_control/star_points2.cpp b/engines/titanic/star_control/star_points2.cpp index 97047181fd..287a46eaa7 100644 --- a/engines/titanic/star_control/star_points2.cpp +++ b/engines/titanic/star_control/star_points2.cpp @@ -42,14 +42,15 @@ bool CStarPoints2::initialize() { RootEntry &rootEntry = _data[rootCtr]; rootEntry.resize(count * 2); for (int idx = 0; idx < count * 2; ++idx) { - DataEntry &entry = rootEntry[idx]; + FVector &entry = rootEntry[idx]; v1 = stream->readSint32LE(); v2 = stream->readSint32LE(); v1 *= 0.015 * FACTOR; v2 *= 0.0099999998 * FACTOR; - entry._v1 = static_cast<int>(cos(v1) * 3000000.0 * cos(v2)); - entry._v2 = static_cast<int>(sin(v1) * 3000000.0 * cos(v2)); - entry._v3 = static_cast<int>(sin(v2) * 3000000.0); + + entry._x = cos(v1) * 3000000.0 * cos(v2); + entry._y = sin(v1) * 3000000.0 * cos(v2); + entry._z = sin(v2) * 3000000.0; } } diff --git a/engines/titanic/star_control/star_points2.h b/engines/titanic/star_control/star_points2.h index 31bded4069..df302f690b 100644 --- a/engines/titanic/star_control/star_points2.h +++ b/engines/titanic/star_control/star_points2.h @@ -24,17 +24,12 @@ #define TITANIC_STAR_POINTS2_H #include "common/array.h" +#include "titanic/star_control/fvector.h" namespace Titanic { class CStarPoints2 { - struct DataEntry { - int _v1; - int _v2; - int _v3; - }; - - class RootEntry : public Common::Array<DataEntry> { + class RootEntry : public Common::Array<FVector> { public: int _field0; RootEntry() : _field0(0) {} |