diff options
author | Paul Gilbert | 2013-05-28 23:57:16 -0400 |
---|---|---|
committer | Paul Gilbert | 2013-05-28 23:57:16 -0400 |
commit | 452fdc64af09d2f4dc95212581d3ee4d571ca04b (patch) | |
tree | 9cf2ff5ab163ddeb1c6b9429ec7a5e2d75a1fbf8 /engines/voyeur | |
parent | d770907c33c8991fa683500686ff3af3a09639fc (diff) | |
download | scummvm-rg350-452fdc64af09d2f4dc95212581d3ee4d571ca04b.tar.gz scummvm-rg350-452fdc64af09d2f4dc95212581d3ee4d571ca04b.tar.bz2 scummvm-rg350-452fdc64af09d2f4dc95212581d3ee4d571ca04b.zip |
VOYEUR: Fixes to pointer fields in viewport setup
Diffstat (limited to 'engines/voyeur')
-rw-r--r-- | engines/voyeur/files.cpp | 29 | ||||
-rw-r--r-- | engines/voyeur/files.h | 14 | ||||
-rw-r--r-- | engines/voyeur/graphics.h | 2 | ||||
-rw-r--r-- | engines/voyeur/voyeur.cpp | 2 |
4 files changed, 29 insertions, 18 deletions
diff --git a/engines/voyeur/files.cpp b/engines/voyeur/files.cpp index 70a6a6ef08..51a414f8f0 100644 --- a/engines/voyeur/files.cpp +++ b/engines/voyeur/files.cpp @@ -252,15 +252,22 @@ bool BoltFile::getBoltGroup(uint32 id) { } BoltEntry &BoltFile::getBoltEntry(uint32 id) { - BoltGroup &group = _groups[id >> 8]; - assert(!group._loaded); + BoltGroup &group = _groups[id >> 24]; + assert(group._loaded); - BoltEntry &entry = group._entries[id & 0xff]; + BoltEntry &entry = group._entries[(id >> 16) & 0xff]; assert(!entry.hasResource() || (id & 0xffff) == 0); return entry; } +PictureResource *BoltFile::getPictureResouce(uint32 id) { + if ((int32)id == -1) + return NULL; + + return getBoltEntry(id)._picResource; +} + byte *BoltFile::memberAddr(uint32 id) { BoltGroup &group = _groups[id >> 8]; if (!group._loaded) @@ -275,7 +282,7 @@ byte *BoltFile::memberAddr(uint32 id) { } byte *BoltFile::memberAddrOffset(uint32 id) { - BoltGroup &group = _groups[(id >> 24) << 4]; + BoltGroup &group = _groups[id >> 24]; if (!group._loaded) return NULL; @@ -581,17 +588,18 @@ PictureResource::~PictureResource() { ViewPortResource::ViewPortResource(BoltFilesState &state, const byte *src): _state(state) { - state._curLibPtr->resolveIt(READ_LE_UINT32(src + 2), &_field2); + _next = state._curLibPtr->getBoltEntry(READ_LE_UINT32(src + 2))._viewPortResource; _fieldC = READ_LE_UINT16(src + 0xC); _fieldE = READ_LE_UINT16(src + 0xE); _field10 = READ_LE_UINT16(src + 0x10); _field12 = READ_LE_UINT16(src + 0x12); _field18 = READ_LE_UINT16(src + 0x18); - state._curLibPtr->resolveIt(READ_LE_UINT32(src + 0x20), &_field20); + _picResource = state._curLibPtr->getPictureResouce(READ_LE_UINT32(src + 0x20)); state._curLibPtr->resolveIt(READ_LE_UINT32(src + 0x24), &_field24); - state._curLibPtr->resolveIt(READ_LE_UINT32(src + 0x28), &_field28); - state._curLibPtr->resolveIt(READ_LE_UINT32(src + 0x2c), &_field2C); + _picResource2 = state._curLibPtr->getPictureResouce(READ_LE_UINT32(src + 0x28)); + _picResource3 = state._curLibPtr->getPictureResouce(READ_LE_UINT32(src + 0x2C)); + state._curLibPtr->resolveIt(READ_LE_UINT32(src + 0x30), &_field30); state._curLibPtr->resolveIt(READ_LE_UINT32(src + 0x34), &_field34); state._curLibPtr->resolveIt(READ_LE_UINT32(src + 0x38), &_field38); @@ -614,8 +622,9 @@ ViewPortResource::ViewPortResource(BoltFilesState &state, const byte *src): } void ViewPortResource::setupViewPort(int v, ViewPortMethodPtr setupFn, - ViewPortMethodPtr addRectFn, ViewPortMethodPtr restoreFn, byte *page) { - byte *fld20 = _field20; + ViewPortMethodPtr addRectFn, ViewPortMethodPtr restoreFn, + PictureResource *page) { + PictureResource *pic = _picResource; // TODO: More stuff } diff --git a/engines/voyeur/files.h b/engines/voyeur/files.h index 1bc9a9d8a3..9d66cbab60 100644 --- a/engines/voyeur/files.h +++ b/engines/voyeur/files.h @@ -126,13 +126,15 @@ public: ~BoltFile(); bool getBoltGroup(uint32 id); - BoltEntry &getBoltEntry(uint32 id); byte *memberAddr(uint32 id); byte *memberAddrOffset(uint32 id); void resolveIt(uint32 id, byte **p); void resolveFunction(uint32 id, BoltMethodPtr *fn); void addRectNoSaveBack() {} // TODO + + BoltEntry &getBoltEntry(uint32 id); + PictureResource *getPictureResouce(uint32 id); }; class BoltGroup { @@ -220,18 +222,18 @@ private: void addRectOptSaveRect(); private: void setupViewPort(int v, ViewPortMethodPtr setupFn, ViewPortMethodPtr addRectFn, - ViewPortMethodPtr restoreFn, byte *page); + ViewPortMethodPtr restoreFn, PictureResource *page); public: - byte *_field2; + ViewPortResource *_next; int _fieldC; int _fieldE; int _field10; int _field12; int _field18; - byte *_field20; + PictureResource *_picResource; byte *_field24; - byte *_field28; - byte *_field2C; + PictureResource *_picResource2; + PictureResource *_picResource3; byte *_field30; byte *_field34; byte *_field38; diff --git a/engines/voyeur/graphics.h b/engines/voyeur/graphics.h index ae23d28ebe..6598cb0ba0 100644 --- a/engines/voyeur/graphics.h +++ b/engines/voyeur/graphics.h @@ -47,7 +47,7 @@ public: bool _palFlag; byte _VGAColors[PALETTE_SIZE]; Common::Array<byte *> _colorChain; - byte *_backgroundPage; + PictureResource *_backgroundPage; int _SVGAPage; int _SVGAMode; ViewPortResource *_vPort; diff --git a/engines/voyeur/voyeur.cpp b/engines/voyeur/voyeur.cpp index 2a4a1cdf6c..dc25ec4745 100644 --- a/engines/voyeur/voyeur.cpp +++ b/engines/voyeur/voyeur.cpp @@ -142,7 +142,7 @@ void VoyeurEngine::doHeadTitle() { _eventsManager.startMainClockInt(); if (_bVoy->getBoltGroup(0x10500)) { - _graphicsManager._backgroundPage = _bVoy->memberAddr(0x502); + _graphicsManager._backgroundPage = _bVoy->getBoltEntry(0x5020000)._picResource; _graphicsManager._vPort->setupViewPort(); } |