diff options
author | Travis Howell | 2005-10-16 09:50:27 +0000 |
---|---|---|
committer | Travis Howell | 2005-10-16 09:50:27 +0000 |
commit | 8dd91d9b165509c3dfb2d1980d31dae23905780b (patch) | |
tree | aabea8953a59966fdb3d277a01aea55001aaba62 | |
parent | e4b85675a6f0e8de9cc7b0ccdda3a4b3a42162f0 (diff) | |
download | scummvm-rg350-8dd91d9b165509c3dfb2d1980d31dae23905780b.tar.gz scummvm-rg350-8dd91d9b165509c3dfb2d1980d31dae23905780b.tar.bz2 scummvm-rg350-8dd91d9b165509c3dfb2d1980d31dae23905780b.zip |
Add missing function for getWizData.
svn-id: r19106
-rw-r--r-- | scumm/script_v100he.cpp | 11 | ||||
-rw-r--r-- | scumm/wiz_he.cpp | 24 | ||||
-rw-r--r-- | scumm/wiz_he.h | 1 |
3 files changed, 30 insertions, 6 deletions
diff --git a/scumm/script_v100he.cpp b/scumm/script_v100he.cpp index d6159848cc..9324d76209 100644 --- a/scumm/script_v100he.cpp +++ b/scumm/script_v100he.cpp @@ -2404,7 +2404,7 @@ void ScummEngine_v100he::o100_getSpriteGroupInfo() { void ScummEngine_v100he::o100_getWizData() { byte filename[4096]; - int state, resId; + int resId, state, type; int32 w, h; int16 x, y; @@ -2437,11 +2437,10 @@ void ScummEngine_v100he::o100_getWizData() { push(h); break; case 34: - pop(); - pop(); - pop(); - push(0); - debug(0, "o100_getWizData() case 34 unhandled"); + type = pop(); + state = pop(); + resId = pop(); + push(_wiz->getWizImageData(resId, state, type)); break; case 64: state = pop(); diff --git a/scumm/wiz_he.cpp b/scumm/wiz_he.cpp index 3ee89d1260..55bd2e2832 100644 --- a/scumm/wiz_he.cpp +++ b/scumm/wiz_he.cpp @@ -1884,6 +1884,30 @@ void Wiz::processWizImage(const WizParameters *params) { } } +int Wiz::getWizImageData(int resNum, int state, int type) { + uint8 *dataPtr, *wizh; + + dataPtr = _vm->getResourceAddress(rtImage, resNum); + assert(dataPtr); + + switch (type) { + case 0: + wizh = _vm->findWrappedBlock(MKID('WIZH'), dataPtr, state, 0); + assert(wizh); + return READ_LE_UINT32(wizh + 0x0); + case 1: + return (_vm->findWrappedBlock(MKID('RGBS'), dataPtr, state, 0) != NULL) ? 1 : 0; + case 2: + return (_vm->findWrappedBlock(MKID('RMAP'), dataPtr, state, 0) != NULL) ? 1 : 0; + case 3: + return (_vm->findWrappedBlock(MKID('TRNS'), dataPtr, state, 0) != NULL) ? 1 : 0; + case 4: + return (_vm->findWrappedBlock(MKID('XMAP'), dataPtr, state, 0) != NULL) ? 1 : 0; + default: + error("getWizImageData: Unknown type %d", type); + } +} + int Wiz::getWizImageStates(int resNum) { const uint8 *dataPtr = _vm->getResourceAddress(rtImage, resNum); assert(dataPtr); diff --git a/scumm/wiz_he.h b/scumm/wiz_he.h index f3b0529674..3e118a169e 100644 --- a/scumm/wiz_he.h +++ b/scumm/wiz_he.h @@ -170,6 +170,7 @@ public: int getWizImageStates(int resnum); int isWizPixelNonTransparent(int resnum, int state, int x, int y, int flags); uint8 getWizPixelColor(int resnum, int state, int x, int y, int flags); + int getWizImageData(int resNum, int state, int type); void flushWizBuffer(); |