mirror of
https://github.com/libretro/scummvm.git
synced 2025-05-13 17:46:22 +00:00
TITANIC: In-progress loading of second starfield points array
This commit is contained in:
parent
82c0be2bc5
commit
4840e3e86b
@ -21,6 +21,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "titanic/star_control/star_array.h"
|
#include "titanic/star_control/star_array.h"
|
||||||
|
#include "titanic/star_control/star_control_sub12.h"
|
||||||
#include "titanic/titanic.h"
|
#include "titanic/titanic.h"
|
||||||
|
|
||||||
namespace Titanic {
|
namespace Titanic {
|
||||||
@ -47,4 +48,8 @@ void CStarArray::initialize() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CStarArray::draw(CSurfaceArea *surface, CStarControlSub12 *img) {
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
} // End of namespace Titanic
|
} // End of namespace Titanic
|
||||||
|
@ -24,9 +24,12 @@
|
|||||||
#define TITANIC_STAR_ARRAY_H
|
#define TITANIC_STAR_ARRAY_H
|
||||||
|
|
||||||
#include "common/array.h"
|
#include "common/array.h"
|
||||||
|
#include "titanic/star_control/surface_area.h"
|
||||||
|
|
||||||
namespace Titanic {
|
namespace Titanic {
|
||||||
|
|
||||||
|
class CStarControlSub12;
|
||||||
|
|
||||||
class CStarArray {
|
class CStarArray {
|
||||||
struct CStarArrayEntry {
|
struct CStarArrayEntry {
|
||||||
double _v1;
|
double _v1;
|
||||||
@ -42,6 +45,11 @@ public:
|
|||||||
* Initialize the array
|
* Initialize the array
|
||||||
*/
|
*/
|
||||||
void initialize();
|
void initialize();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Draw the starfield points
|
||||||
|
*/
|
||||||
|
void draw(CSurfaceArea *surface, CStarControlSub12 *img);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // End of namespace Titanic
|
} // End of namespace Titanic
|
||||||
|
@ -44,6 +44,7 @@ void CStarControlSub1::load(SimpleFile *file, int param) {
|
|||||||
bool CStarControlSub1::initDocument() {
|
bool CStarControlSub1::initDocument() {
|
||||||
warning("CStarControlSub1::initDocument");
|
warning("CStarControlSub1::initDocument");
|
||||||
_starArray.initialize();
|
_starArray.initialize();
|
||||||
|
_sub9.initialize();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,8 +21,33 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "titanic/star_control/star_control_sub9.h"
|
#include "titanic/star_control/star_control_sub9.h"
|
||||||
|
#include "titanic/titanic.h"
|
||||||
|
|
||||||
namespace Titanic {
|
namespace Titanic {
|
||||||
|
|
||||||
|
#define ARRAY_COUNT 80
|
||||||
|
|
||||||
|
void CStarControlSub9::initialize() {
|
||||||
|
// Get a reference to the starfield points resource
|
||||||
|
Common::SeekableReadStream *stream = g_vm->_filesManager->getResource("STARFIELD/POINTS2");
|
||||||
|
|
||||||
|
_data.resize(ARRAY_COUNT);
|
||||||
|
for (int rootCtr = 0; rootCtr < ARRAY_COUNT; ++rootCtr) {
|
||||||
|
// Get the number of sub-entries for this entry
|
||||||
|
int count = stream->readUint32LE();
|
||||||
|
|
||||||
|
// Read in the sub-entries
|
||||||
|
RootEntry &rootEntry = _data[rootCtr];
|
||||||
|
rootEntry.resize(count);
|
||||||
|
for (int idx = 0; idx < count; ++idx) {
|
||||||
|
int v1 = stream->readSint32LE();
|
||||||
|
int v2 = stream->readSint32LE();
|
||||||
|
int v3 = stream->readSint32LE();
|
||||||
|
int v4 = stream->readSint32LE();
|
||||||
|
|
||||||
|
// TODO: Processing here
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} // End of namespace Titanic
|
} // End of namespace Titanic
|
||||||
|
@ -23,18 +23,30 @@
|
|||||||
#ifndef TITANIC_STAR_CONTROL_SUB9_H
|
#ifndef TITANIC_STAR_CONTROL_SUB9_H
|
||||||
#define TITANIC_STAR_CONTROL_SUB9_H
|
#define TITANIC_STAR_CONTROL_SUB9_H
|
||||||
|
|
||||||
|
#include "common/array.h"
|
||||||
|
|
||||||
namespace Titanic {
|
namespace Titanic {
|
||||||
|
|
||||||
class CStarControlSub9 {
|
class CStarControlSub9 {
|
||||||
struct ArrayEntry {
|
struct DataEntry {
|
||||||
|
int _v1;
|
||||||
|
int _v2;
|
||||||
|
int _v3;
|
||||||
|
int _v4;
|
||||||
|
};
|
||||||
|
|
||||||
|
class RootEntry : public Common::Array<DataEntry> {
|
||||||
|
public:
|
||||||
int _field0;
|
int _field0;
|
||||||
int _field4;
|
RootEntry() : _field0(0) {}
|
||||||
int _field8;
|
|
||||||
ArrayEntry() : _field0(0), _field4(0), _field8(0) {}
|
|
||||||
};
|
};
|
||||||
private:
|
private:
|
||||||
ArrayEntry _array[80];
|
Common::Array<RootEntry> _data;
|
||||||
public:
|
public:
|
||||||
|
/**
|
||||||
|
* Initializes the data
|
||||||
|
*/
|
||||||
|
void initialize();
|
||||||
};
|
};
|
||||||
|
|
||||||
} // End of namespace Titanic
|
} // End of namespace Titanic
|
||||||
|
Loading…
x
Reference in New Issue
Block a user