aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2016-07-05 22:33:21 -0400
committerPaul Gilbert2016-07-15 19:27:26 -0400
commitb725c9add76b793fa1bdb2ecd00195d20dfa0567 (patch)
treefbdf7b3759599ae65738e7f16f93e6fa5c54997d
parent0b860220fc25d6ba78c7a403913d07561f492a6a (diff)
downloadscummvm-rg350-b725c9add76b793fa1bdb2ecd00195d20dfa0567.tar.gz
scummvm-rg350-b725c9add76b793fa1bdb2ecd00195d20dfa0567.tar.bz2
scummvm-rg350-b725c9add76b793fa1bdb2ecd00195d20dfa0567.zip
TITANIC: Added CStarArray initialization
-rw-r--r--engines/titanic/star_control/star_array.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/engines/titanic/star_control/star_array.cpp b/engines/titanic/star_control/star_array.cpp
index 8049cb567f..d2a5fe1a84 100644
--- a/engines/titanic/star_control/star_array.cpp
+++ b/engines/titanic/star_control/star_array.cpp
@@ -36,16 +36,23 @@ void CStarArray::initialize() {
Common::SeekableReadStream *stream = g_vm->_filesManager->getResource("STARFIELD/POINTS");
assert(stream && stream->size() == (12 * ARRAY_COUNT));
+ double factor = 3.1415927 * 0.0055555557;
+
_data.resize(ARRAY_COUNT);
for (int idx = 0; idx < ARRAY_COUNT; ++idx) {
+ CStarArrayEntry &entry = _data[idx];
+
// Get the next set of values
- int v1 = stream->readUint32LE();
- int v2 = stream->readUint32LE();
+ double v1 = stream->readUint32LE();
+ double v2 = stream->readUint32LE();
stream->readUint32LE();
- warning("TODO: %d %d", v1, v2);
- // Pre-process them
- // TODO
+ v1 *= 0.0099999998 * factor;
+ v2 *= 0.015 * factor;
+
+ entry._v1 = cos(v2) * 3000000.0 * cos(v1);
+ entry._v2 = sin(v2) * 3000000.0 * cos(v1);
+ entry._v3 = sin(v1) * 3000000.0;
}
}