aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
authorJamieson Christian2003-08-29 03:35:15 +0000
committerJamieson Christian2003-08-29 03:35:15 +0000
commitcec02390ed9b068bb12c3ab03b0d92c7c70d8c4f (patch)
tree09db8129a87562309172be18f392f5f8092dc0cc /scumm
parente32f17d803ccdd409758e21d1473d4d51389881a (diff)
downloadscummvm-rg350-cec02390ed9b068bb12c3ab03b0d92c7c70d8c4f.tar.gz
scummvm-rg350-cec02390ed9b068bb12c3ab03b0d92c7c70d8c4f.tar.bz2
scummvm-rg350-cec02390ed9b068bb12c3ab03b0d92c7c70d8c4f.zip
Fix for bug [770687] MI1: palette effect missing
Added support for CC resources in small-header games. Right now this is enabled for monkeyvga only. loomcd has CC resources but they don't make any sense, and the game doesn't use palette effects anyway. svn-id: r9899
Diffstat (limited to 'scumm')
-rw-r--r--scumm/gfx.cpp46
-rw-r--r--scumm/scummvm.cpp12
2 files changed, 39 insertions, 19 deletions
diff --git a/scumm/gfx.cpp b/scumm/gfx.cpp
index fecb9ca257..1eda39ae0b 100644
--- a/scumm/gfx.cpp
+++ b/scumm/gfx.cpp
@@ -2704,20 +2704,39 @@ void Scumm::initCycl(const byte *ptr) {
memset(_colorCycle, 0, sizeof(_colorCycle));
- while ((j = *ptr++) != 0) {
- if (j < 1 || j > 16) {
- error("Invalid color cycle index %d", j);
+ if (_features & GF_SMALL_HEADER) {
+ cycl = _colorCycle;
+ ptr += 6;
+ for (j = 0; j < 16; ++j, ++cycl) {
+ uint16 delay = READ_BE_UINT16(ptr);
+ ptr += 2;
+ byte start = *ptr++;
+ byte end = *ptr++;
+ if (!delay || start >= end)
+ continue;
+
+ cycl->counter = 0;
+ cycl->delay = 16384 / delay;
+ cycl->flags = 2;
+ cycl->start = start;
+ cycl->end = end;
}
- cycl = &_colorCycle[j - 1];
+ } else {
+ while ((j = *ptr++) != 0) {
+ if (j < 1 || j > 16) {
+ error("Invalid color cycle index %d", j);
+ }
+ cycl = &_colorCycle[j - 1];
- ptr += 2;
- cycl->counter = 0;
- cycl->delay = 16384 / READ_BE_UINT16(ptr);
- ptr += 2;
- cycl->flags = READ_BE_UINT16(ptr);
- ptr += 2;
- cycl->start = *ptr++;
- cycl->end = *ptr++;
+ ptr += 2;
+ cycl->counter = 0;
+ cycl->delay = 16384 / READ_BE_UINT16(ptr);
+ ptr += 2;
+ cycl->flags = READ_BE_UINT16(ptr);
+ ptr += 2;
+ cycl->start = *ptr++;
+ cycl->end = *ptr++;
+ }
}
}
@@ -2807,7 +2826,8 @@ void Scumm::cyclePalette() {
setDirtyColors(cycl->start, cycl->end);
moveMemInPalRes(cycl->start, cycl->end, cycl->flags & 2);
- ::cyclePalette(_currentPalette, cycl->start, cycl->end, 3, !(cycl->flags & 2));
+ if (!(_features & GF_SMALL_HEADER && _version > 2))
+ ::cyclePalette(_currentPalette, cycl->start, cycl->end, 3, !(cycl->flags & 2));
// Also cycle the other, indirect palettes
if (_proc_special_palette) {
diff --git a/scumm/scummvm.cpp b/scumm/scummvm.cpp
index 65d8f491ca..0c9a196b51 100644
--- a/scumm/scummvm.cpp
+++ b/scumm/scummvm.cpp
@@ -2238,13 +2238,13 @@ void Scumm::initRoomSubBlocks() {
}
// Color cycling
- if (_features & GF_OLD_BUNDLE)
- ptr = 0; // TODO / FIXME ???
- else if (_features & GF_SMALL_HEADER)
- //TODO loomcd/monkeyega use difference color cycle resource format.
- ptr = 0;
- else
+ ptr = 0;
+ if (_features & GF_SMALL_HEADER) {
+ if (_gameId == GID_MONKEY_VGA)
+ ptr = findResourceSmall (MKID('CYCL'), roomptr);
+ } else if (!(_features & GF_OLD_BUNDLE)) {
ptr = findResourceData(MKID('CYCL'), roomptr);
+ }
if (ptr)
initCycl(ptr);