VOYEUR: Added code for initViewPortList

This commit is contained in:
Paul Gilbert 2013-05-26 22:18:54 -04:00
parent 23f3866e14
commit ab4f798f5b
3 changed files with 32 additions and 1 deletions

View File

@ -379,7 +379,9 @@ void BoltFile::initViewPort() {
}
void BoltFile::initViewPortList() {
error("TODO: initViewPortList not implemented");
initDefault();
_state._curMemberPtr->_viewPortListResource = new ViewPortListResource(
_state, _state._curMemberPtr->_data);
}
void BoltFile::initFontInfo() {
@ -435,6 +437,7 @@ BoltEntry::~BoltEntry() {
delete[] _data;
delete _picResource;
delete _viewPortResource;
delete _viewPortListResource;
}
void BoltEntry::load() {
@ -555,4 +558,20 @@ ViewPortResource::ViewPortResource(BoltFilesState &state, const byte *src) {
_fn3 = &BoltFile::addRectNoSaveBack;
}
/*------------------------------------------------------------------------*/
ViewPortListResource::ViewPortListResource(BoltFilesState &state, const byte *src) {
uint32 *idP = (uint32 *)&src[0];
uint count = READ_LE_UINT32(idP++);
for (uint i = 0; i < count; ++i, ++idP) {
uint32 id = READ_LE_UINT32(idP);
_entries.push_back(NULL);
state._curLibPtr->resolveIt(id, &_entries[_entries.size() - 1]);
}
state._vm->_graphicsManager._vPort = &_entries[0];
state._curLibPtr->resolveIt(READ_LE_UINT32(&src[4]), &_field4);
}
} // End of namespace Voyeur

View File

@ -36,6 +36,7 @@ class BoltGroup;
class BoltEntry;
class PictureResource;
class ViewPortResource;
class ViewPortListResource;
#define DECOMPRESS_SIZE 0x7000
@ -161,6 +162,7 @@ public:
PictureResource *_picResource;
ViewPortResource *_viewPortResource;
ViewPortListResource *_viewPortListResource;
public:
BoltEntry(Common::SeekableReadStream *f);
virtual ~BoltEntry();
@ -220,6 +222,15 @@ public:
virtual ~ViewPortResource() {}
};
class ViewPortListResource {
public:
byte *_field4;
Common::Array<byte *> _entries;
ViewPortListResource(BoltFilesState &state, const byte *src);
virtual ~ViewPortListResource() {}
};
} // End of namespace Voyeur
#endif /* VOYEUR_FILES_H */

View File

@ -49,6 +49,7 @@ public:
byte *_backgroundPage;
int _SVGAPage;
int _SVGAMode;
byte **_vPort;
private:
static void fadeIntFunc();
static void vDoFadeInt();