Skip to content

Commit

Permalink
FULLPIPE: Read SceneTags from fullpipe.gam
Browse files Browse the repository at this point in the history
  • Loading branch information
sev- committed Sep 6, 2013
1 parent 82cbf50 commit 146e5a9
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 14 deletions.
27 changes: 13 additions & 14 deletions engines/fullpipe/objects.h
Expand Up @@ -47,24 +47,23 @@ class CObArray {
int m_nGrowBy;
};

class CNode {
int pNext;
CNode *pPrev;
void *data;
};
class SceneTag {
CObject _obj;
int _field_4;
char *_tag;
int _scene;
int16 _sceneId;
int16 _field_12;

class CPtrList {
CObject obj;
CNode *m_pNodeHead;
int m_pNodeTail;
int m_nCount;
int m_pNodeFree;
int m_pBlocks;
int m_nBlockSize;
public:
SceneTag(CFile &file);
~SceneTag();
};

typedef Common::List<SceneTag> SceneTagList_;

class SceneTagList {
CPtrList list;
SceneTagList_ list;

public:
SceneTagList(CFile &file);
Expand Down
24 changes: 24 additions & 0 deletions engines/fullpipe/stateloader.cpp
Expand Up @@ -23,6 +23,7 @@
#include "fullpipe/fullpipe.h"

#include "common/file.h"
#include "common/list.h"

#include "fullpipe/utils.h"
#include "fullpipe/objects.h"
Expand Down Expand Up @@ -90,6 +91,29 @@ GameProject::~GameProject() {
}

SceneTagList::SceneTagList(CFile &file) {
int numEntries = file.readUint16LE();

debug(0, "numEntries: %d", numEntries);

for (int i = 0; i < numEntries; i++) {
SceneTag *t = new SceneTag(file);
list.push_back(*t);
}
}

SceneTag::SceneTag(CFile &file) {
_field_4 = 0;
_scene = 0;

_sceneId = file.readUint16LE();

_tag = file.readPascalString();

debug(0, "sceneId: %d tag: %s", _sceneId, _tag);
}

SceneTag::~SceneTag() {
free(_tag);
}

} // End of namespace Fullpipe

0 comments on commit 146e5a9

Please sign in to comment.