Skip to content

Commit

Permalink
FULLPIPE: Continued Scene loading
Browse files Browse the repository at this point in the history
  • Loading branch information
sev- committed Sep 6, 2013
1 parent 1c1d8db commit 68c5cfd
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 9 deletions.
2 changes: 2 additions & 0 deletions engines/fullpipe/gfx.cpp
Expand Up @@ -33,6 +33,8 @@ Background::Background() {
_bigPictureArray1Count = 0;
_bigPictureArray2Count = 0;
_bigPictureArray = 0;
_stringObj = 0;
_colorMemoryObj = 0;
}

bool Background::load(MfcArchive &file) {
Expand Down
3 changes: 2 additions & 1 deletion engines/fullpipe/gfx.h
Expand Up @@ -89,12 +89,13 @@ class PictureObject : public GameObject {
};

class Background : public CObject {
protected:
CPtrList _list;
char *_stringObj;
int _x;
int _y;
int16 _messageQueueId;
int _colorMemoryObj;
MemoryObject *_colorMemoryObj;
int _bigPictureArray1Count;
int _bigPictureArray2Count;
BigPicture ***_bigPictureArray;
Expand Down
54 changes: 50 additions & 4 deletions engines/fullpipe/scene.cpp
Expand Up @@ -113,14 +113,15 @@ Scene::Scene() {
}

bool Scene::load(MfcArchive &file) {
_bg.load(file);
Background::load(file);

_sceneId = file.readUint16LE();

_stringObj = file.readPascalString();
debug(0, "scene: <%s>", _stringObj);
_scstringObj = file.readPascalString();
debug(0, "scene: <%s>", _scstringObj);

int count = file.readUint16LE();
debug(7, "scene.ani: %d", count);

for (int i = 0; i < count; i++) {
int aniNum = file.readUint16LE();
Expand All @@ -141,7 +142,52 @@ bool Scene::load(MfcArchive &file) {
free(aniname);
}

warning("STUB: Scene::load");
count = file.readUint16LE();
debug(7, "scene.mq: %d", count);

for (int i = 0; i < count; i++) {
int qNum = file.readUint16LE();
char *qname = genFileName(0, qNum, "qu");

Common::SeekableReadStream *f = g_fullpipe->_currArchive->createReadStreamForMember(qname);
MfcArchive archive(f);

MessageQueue *mq = new MessageQueue();

mq->load(archive);

_messageQueueList.push_back(mq);

delete f;
free(qname);
}

count = file.readUint16LE();
debug(7, "scene.fa: %d", count);

for (int i = 0; i < count; i++) {
// There are no .FA files
assert(0);
}

_libHandle = g_fullpipe->_currArchive;

if (_list.size() > 0 && _stringObj && strlen(_stringObj) > 1) {
char fname[260];

strcpy(fname, _stringObj);
strcpy(strrchr(fname, '.') + 1, "col");

MemoryObject *col = new MemoryObject();
col->loadFile(fname);

_colorMemoryObj = col;

}

char *shdname = genFileName(0, _sceneId, "shd");

warning("STUB: Scene::load (%d bytes left)", file.size() - file.pos());

return true;
}
Expand Down
6 changes: 3 additions & 3 deletions engines/fullpipe/scene.h
Expand Up @@ -25,7 +25,7 @@

namespace Fullpipe {

class Scene : public CObject {
class Scene : public Background {
Background _bg;
CPtrList _staticANIObjectList1;
CPtrList _staticANIObjectList2;
Expand All @@ -34,9 +34,9 @@ class Scene : public CObject {
Shadows *_shadows;
int _soundList;
int16 _sceneId;
char *_stringObj;
char *_scstringObj;
int _field_BC;
int _libHandle;
NGIArchive *_libHandle;

public:
Scene();
Expand Down
1 change: 0 additions & 1 deletion engines/fullpipe/utils.cpp
Expand Up @@ -136,7 +136,6 @@ void MemoryObject::loadFile(char *filename) {
Common::SeekableReadStream *s = _libHandle->createReadStreamForMember(filename);

if (s) {
debug(0, "Reading %s", filename);
assert(s->size() > 0);
_data = calloc(s->size(), 1);
s->read(_data, s->size());
Expand Down

0 comments on commit 68c5cfd

Please sign in to comment.