TITANIC: Added CStarArray initialization

This commit is contained in:
Paul Gilbert 2016-07-05 22:33:21 -04:00
parent 0b860220fc
commit b725c9add7

View File

@ -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;
}
}