diff options
author | Travis Howell | 2004-10-04 04:04:37 +0000 |
---|---|---|
committer | Travis Howell | 2004-10-04 04:04:37 +0000 |
commit | db6348300199c605a0a183157e4174da8e8e3edb (patch) | |
tree | 5e4beb1c7689a46119480db88c93faeb12262d22 | |
parent | 4364606894151216963fb0cc79216d6783853ceb (diff) | |
download | scummvm-rg350-db6348300199c605a0a183157e4174da8e8e3edb.tar.gz scummvm-rg350-db6348300199c605a0a183157e4174da8e8e3edb.tar.bz2 scummvm-rg350-db6348300199c605a0a183157e4174da8e8e3edb.zip |
Add missing roomOps case for HE games.
svn-id: r15404
-rw-r--r-- | scumm/intern.h | 1 | ||||
-rw-r--r-- | scumm/palette.cpp | 16 | ||||
-rw-r--r-- | scumm/script_v6.cpp | 2 | ||||
-rw-r--r-- | scumm/script_v6he.cpp | 4 | ||||
-rw-r--r-- | scumm/script_v72he.cpp | 4 | ||||
-rw-r--r-- | scumm/script_v8.cpp | 2 | ||||
-rw-r--r-- | scumm/script_v90he.cpp | 18 | ||||
-rw-r--r-- | scumm/scumm.cpp | 2 | ||||
-rw-r--r-- | scumm/scumm.h | 4 |
9 files changed, 31 insertions, 22 deletions
diff --git a/scumm/intern.h b/scumm/intern.h index 10f5d0c7e4..4f85e36624 100644 --- a/scumm/intern.h +++ b/scumm/intern.h @@ -823,6 +823,7 @@ protected: }; int _heObject, _heObjectNum; + int _hePaletteNum; struct WizParameters { byte filename[260]; diff --git a/scumm/palette.cpp b/scumm/palette.cpp index 4bc80dc40e..04cabf3944 100644 --- a/scumm/palette.cpp +++ b/scumm/palette.cpp @@ -356,7 +356,7 @@ void ScummEngine_v6::palManipulateInit(int resID, int start, int end, int time) const byte *new_pal; int i; - new_pal = getPalettePtr(resID); + new_pal = getPalettePtr(resID, _roomResource); new_pal += start*3; @@ -447,7 +447,7 @@ static inline uint colorWeight(int red, int green, int blue) { void ScummEngine::setupShadowPalette(int redScale, int greenScale, int blueScale, int startColor, int endColor, int start, int end) { - const byte *basepal = getPalettePtr(_curPalIndex); + const byte *basepal = getPalettePtr(_curPalIndex, _roomResource); const byte *compareptr; const byte *pal = basepal + start * 3; byte *table = _shadowPalette + start; @@ -533,7 +533,7 @@ void ScummEngine::darkenPalette(int redScale, int greenScale, int blueScale, int const byte *palptr; int color, idx, j; - palptr = getPalettePtr(_curPalIndex); + palptr = getPalettePtr(_curPalIndex, _roomResource); for (j = startColor; j <= endColor; j++) { idx = (_heversion == 70) ? _HEV7ActorPalette[j] : j; cptr = palptr + idx * 3; @@ -591,7 +591,7 @@ void ScummEngine::desaturatePalette(int hueScale, int satScale, int lightScale, byte *cur; int j; - cptr = getPalettePtr(_curPalIndex) + startColor * 3; + cptr = getPalettePtr(_curPalIndex, _roomResource) + startColor * 3; cur = _currentPalette + startColor * 3; for (j = startColor; j <= endColor; j++) { @@ -757,11 +757,11 @@ void ScummEngine::setPalColor(int idx, int r, int g, int b) { setDirtyColors(idx, idx); } -void ScummEngine::setPalette(int palindex) { +void ScummEngine::setPalette(int palindex, int room) { const byte *pals; _curPalIndex = palindex; - pals = getPalettePtr(_curPalIndex); + pals = getPalettePtr(_curPalIndex, room); setPaletteFromPtr(pals); } @@ -784,10 +784,10 @@ const byte *ScummEngine::findPalInPals(const byte *pal, int idx) { return offs + READ_LE_UINT32(offs + idx * sizeof(uint32)); } -const byte *ScummEngine::getPalettePtr(int palindex) { +const byte *ScummEngine::getPalettePtr(int palindex, int room) { const byte *cptr; - cptr = getResourceAddress(rtRoom, _roomResource); + cptr = getResourceAddress(rtRoom, room); assert(cptr); if (_CLUT_offs) { cptr += _CLUT_offs; diff --git a/scumm/script_v6.cpp b/scumm/script_v6.cpp index 53ce1d3b6e..eadcff9cb9 100644 --- a/scumm/script_v6.cpp +++ b/scumm/script_v6.cpp @@ -1754,7 +1754,7 @@ void ScummEngine_v6::o6_roomOps() { if (_gameId == GID_SAMNMAX && vm.slot[_currentScript].number == 64) setDirtyColors(0, 255); else - setPalette(a); + setPalette(a, _roomResource); break; default: error("o6_roomOps: default case %d", op); diff --git a/scumm/script_v6he.cpp b/scumm/script_v6he.cpp index ae3cd29be3..245ac464a0 100644 --- a/scumm/script_v6he.cpp +++ b/scumm/script_v6he.cpp @@ -535,7 +535,7 @@ void ScummEngine_v60he::o60_roomOps() { case 213: // SO_ROOM_NEW_PALETTE a = pop(); - setPalette(a); + setPalette(a, _roomResource); break; case 220: a = pop(); @@ -558,7 +558,7 @@ void ScummEngine_v60he::o60_roomOps() { case 236: // HE 7.2 b = pop(); a = pop(); - warning("o60_roomOps: case %d (%d, %d)", op, b, a); + setPalette(a, b); break; default: error("o60_roomOps: default case %d", op); diff --git a/scumm/script_v72he.cpp b/scumm/script_v72he.cpp index 6f86469752..2c75c41465 100644 --- a/scumm/script_v72he.cpp +++ b/scumm/script_v72he.cpp @@ -1006,7 +1006,7 @@ void ScummEngine_v72he::o72_roomOps() { case 213: // SO_ROOM_NEW_PALETTE a = pop(); - setPalette(a); + setPalette(a, _roomResource); break; case 220: @@ -1031,7 +1031,7 @@ void ScummEngine_v72he::o72_roomOps() { case 236: b = pop(); a = pop(); - warning("o72_roomOps: case %d (%d, %d)", op, b, a); + setPalette(a, b); break; default: diff --git a/scumm/script_v8.cpp b/scumm/script_v8.cpp index 0232b7f1fd..0873eb2809 100644 --- a/scumm/script_v8.cpp +++ b/scumm/script_v8.cpp @@ -867,7 +867,7 @@ void ScummEngine_v8::o8_roomOps() { break; case 0x5C: // SO_ROOM_NEW_PALETTE New palette a = pop(); - setPalette(a); + setPalette(a, _roomResource); break; case 0x5D: // SO_ROOM_SAVE_GAME Save game _saveTemporaryState = true; diff --git a/scumm/script_v90he.cpp b/scumm/script_v90he.cpp index eace071dbb..103f4958bb 100644 --- a/scumm/script_v90he.cpp +++ b/scumm/script_v90he.cpp @@ -1238,16 +1238,23 @@ void ScummEngine_v90he::o90_getPaletteData() { } void ScummEngine_v90he::o90_paletteOps() { - int subOp = fetchScriptByte(); + int idx, state; + + byte subOp = fetchScriptByte(); subOp -= 57; switch (subOp) { case 0: - pop(); + _hePaletteNum = pop(); break; case 6: - pop(); - pop(); + { + state = pop(); + idx = pop(); + const uint8 *dataPtr = getResourceAddress(rtImage, idx); + const uint8 *pal = findWrappedBlock(MKID('RGBS'), dataPtr, state, 0); + assert(pal); + } break; case 9: pop(); @@ -1274,11 +1281,12 @@ void ScummEngine_v90he::o90_paletteOps() { case 160: break; case 198: + _hePaletteNum = 0; break; default: error("o90_paletteOps: Unknown case %d", subOp); } - debug(1,"o90_paletteOps stub (%d)", subOp); + debug(0,"o90_paletteOps stub (%d)", subOp); } diff --git a/scumm/scumm.cpp b/scumm/scumm.cpp index aa74a3c7c4..cb3627d6ef 100644 --- a/scumm/scumm.cpp +++ b/scumm/scumm.cpp @@ -2343,7 +2343,7 @@ void ScummEngine::initRoomSubBlocks() { } if (_PALS_offs || _CLUT_offs) - setPalette(0); + setPalette(0, _roomResource); initBGBuffers(_roomHeight); } diff --git a/scumm/scumm.h b/scumm/scumm.h index eecce18b8a..bf349b3ddc 100644 --- a/scumm/scumm.h +++ b/scumm/scumm.h @@ -960,12 +960,12 @@ protected: void clampCameraPos(Common::Point *pt); void actorFollowCamera(int act); - const byte *getPalettePtr(int palindex); + const byte *getPalettePtr(int palindex, int room); void setupAmigaPalette(); void setupEGAPalette(); void setupV1ManiacPalette(); void setupV1ZakPalette(); - void setPalette(int pal); + void setPalette(int pal, int room); void setPaletteFromPtr(const byte *ptr, int numcolor = -1); void setPalColor(int index, int r, int g, int b); void setDirtyColors(int min, int max); |