diff options
-rw-r--r-- | devtools/create_titanic/create_titanic_dat.cpp | 15 | ||||
-rw-r--r-- | engines/titanic/module.mk | 2 | ||||
-rw-r--r-- | engines/titanic/star_control/star_array.cpp (renamed from engines/titanic/star_control/star_control_sub10.cpp) | 24 | ||||
-rw-r--r-- | engines/titanic/star_control/star_array.h (renamed from engines/titanic/star_control/star_control_sub10.h) | 25 | ||||
-rw-r--r-- | engines/titanic/star_control/star_control_sub1.cpp | 1 | ||||
-rw-r--r-- | engines/titanic/star_control/star_control_sub1.h | 4 |
6 files changed, 59 insertions, 12 deletions
diff --git a/devtools/create_titanic/create_titanic_dat.cpp b/devtools/create_titanic/create_titanic_dat.cpp index 09a4b4ce35..be58deb68d 100644 --- a/devtools/create_titanic/create_titanic_dat.cpp +++ b/devtools/create_titanic/create_titanic_dat.cpp @@ -52,7 +52,7 @@ */ #define VERSION_NUMBER 1 -#define HEADER_SIZE 0x640 +#define HEADER_SIZE 0x680 Common::File inputFile, outputFile; Common::PEResources res; @@ -422,6 +422,18 @@ void writeSentenceMappings(const char *name, uint offset, int numValues) { dataOffset += size; } + +void writeStarfieldPoints() { + outputFile.seek(dataOffset); + + inputFile.seek(0x59DE4C - FILE_DIFF); + uint size = 876 * 12; + + outputFile.write(inputFile, size); + writeEntryHeader("STARFIELD/POINTS", dataOffset, size); + dataOffset += size; +} + void writeHeader() { // Write out magic string const char *MAGIC_STR = "SVTN"; @@ -451,6 +463,7 @@ void writeData() { writeResource("STFONT", 153); writeResource("STARFIELD", 132); + writeStarfieldPoints(); writeResource("TEXT", "STVOCAB.TXT"); writeResource("TEXT", "JRQUOTES.TXT"); diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk index 79f55d4413..f1392f165b 100644 --- a/engines/titanic/module.mk +++ b/engines/titanic/module.mk @@ -420,13 +420,13 @@ MODULE_OBJS := \ star_control/star_control_sub1.o \ star_control/star_control_sub2.o \ star_control/base_star.o \ + star_control/star_array.o \ star_control/star_control_sub4.o \ star_control/star_control_sub5.o \ star_control/star_control_sub6.o \ star_control/star_control_sub7.o \ star_control/star_control_sub8.o \ star_control/star_control_sub9.o \ - star_control/star_control_sub10.o \ star_control/star_view.o \ star_control/star_control_sub12.o \ star_control/star_control_sub13.o \ diff --git a/engines/titanic/star_control/star_control_sub10.cpp b/engines/titanic/star_control/star_array.cpp index ca32f5e7dc..1af608db51 100644 --- a/engines/titanic/star_control/star_control_sub10.cpp +++ b/engines/titanic/star_control/star_array.cpp @@ -20,9 +20,31 @@ * */ -#include "titanic/star_control/star_control_sub10.h" +#include "titanic/star_control/star_array.h" +#include "titanic/titanic.h" namespace Titanic { +#define ARRAY_COUNT 876 + +CStarArray::CStarArray() { +} + +void CStarArray::initialize() { + // Get a reference to the starfield points resource + Common::SeekableReadStream *stream = g_vm->_filesManager->getResource("STARFIELD/POINTS"); + assert(stream && stream->size() == (12 * ARRAY_COUNT)); + + _data.resize(ARRAY_COUNT); + for (int idx = 0; idx < ARRAY_COUNT; ++idx) { + // Get the next set of values + int v1 = stream->readUint32LE(); + int v2 = stream->readUint32LE(); + stream->readUint32LE(); + + // Pre-process them + // TODO + } +} } // End of namespace Titanic diff --git a/engines/titanic/star_control/star_control_sub10.h b/engines/titanic/star_control/star_array.h index af4ad17c6e..859db60ed1 100644 --- a/engines/titanic/star_control/star_control_sub10.h +++ b/engines/titanic/star_control/star_array.h @@ -20,19 +20,30 @@ * */ -#ifndef TITANIC_STAR_CONTROL_SUB10_H -#define TITANIC_STAR_CONTROL_SUB10_H +#ifndef TITANIC_STAR_ARRAY_H +#define TITANIC_STAR_ARRAY_H + +#include "common/array.h" namespace Titanic { -class CStarControlSub10 { +class CStarArray { + struct CStarArrayEntry { + double _v1; + double _v2; + double _v3; + }; private: - int _field0; - int _field4; + Common::Array<CStarArrayEntry> _data; public: - CStarControlSub10() : _field0(0), _field4(0) {} + CStarArray(); + + /** + * Initialize the array + */ + void initialize(); }; } // End of namespace Titanic -#endif /* TITANIC_STAR_CONTROL_SUB10_H */ +#endif /* TITANIC_STAR_ARRAY_H */ diff --git a/engines/titanic/star_control/star_control_sub1.cpp b/engines/titanic/star_control/star_control_sub1.cpp index 6adc9a64d0..5edbab1e86 100644 --- a/engines/titanic/star_control/star_control_sub1.cpp +++ b/engines/titanic/star_control/star_control_sub1.cpp @@ -43,6 +43,7 @@ void CStarControlSub1::load(SimpleFile *file, int param) { bool CStarControlSub1::initDocument() { warning("CStarControlSub1::initDocument"); + _starArray.initialize(); return true; } diff --git a/engines/titanic/star_control/star_control_sub1.h b/engines/titanic/star_control/star_control_sub1.h index 2e76a1ff41..0e99b4ef72 100644 --- a/engines/titanic/star_control/star_control_sub1.h +++ b/engines/titanic/star_control/star_control_sub1.h @@ -23,12 +23,12 @@ #ifndef TITANIC_STAR_CONTROL_SUB1_H #define TITANIC_STAR_CONTROL_SUB1_H +#include "titanic/star_control/star_array.h" #include "titanic/star_control/star_control_sub2.h" #include "titanic/star_control/star_control_sub5.h" #include "titanic/star_control/star_control_sub7.h" #include "titanic/star_control/star_control_sub8.h" #include "titanic/star_control/star_control_sub9.h" -#include "titanic/star_control/star_control_sub10.h" namespace Titanic { @@ -37,7 +37,7 @@ private: CStarControlSub7 _sub7; CStarControlSub8 _sub8; CStarControlSub9 _sub9; - CStarControlSub10 _sub10; + CStarArray _starArray; CStarControlSub5 _sub5; int _field7DA8; int _field7DAC; |