aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
authorMax Horn2003-12-25 22:36:55 +0000
committerMax Horn2003-12-25 22:36:55 +0000
commitcb628da846d37fc275e69a1a264c146fc59da0b9 (patch)
treed92f93ebb8222f097f12953d31297b81879eb3e6 /scumm
parent3959b96c9a84829e931a53a99846c04f0b1c792a (diff)
downloadscummvm-rg350-cb628da846d37fc275e69a1a264c146fc59da0b9.tar.gz
scummvm-rg350-cb628da846d37fc275e69a1a264c146fc59da0b9.tar.bz2
scummvm-rg350-cb628da846d37fc275e69a1a264c146fc59da0b9.zip
fix indirect palette cycling
svn-id: r11929
Diffstat (limited to 'scumm')
-rw-r--r--scumm/gfx.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/scumm/gfx.cpp b/scumm/gfx.cpp
index 7b9c3a2a83..8a124e245b 100644
--- a/scumm/gfx.cpp
+++ b/scumm/gfx.cpp
@@ -2790,13 +2790,15 @@ static void doCyclePalette(byte *palette, int cycleStart, int cycleEnd, int size
}
/**
- * Adjust an 'indirect' color palette for the color cycling performed on its master
- * palette. An indirect palette is a palette which contains indices pointing into
- * another palette - it provides a level of indirection to map palette colors to
- * other colors. Now when the target palette is cycled, the indirect palette suddenly
- * point at the wrong color(s). This function takes care of adjusting an indirect
- * palette by searching through it and replacing all indices that are in the
- * cycle range by the new (cycled) index.
+ * Adjust an 'indirect' color palette for the color cycling performed on its
+ * master palette. An indirect palette is a palette which contains indices
+ * pointing into another palette - it provides a level of indirection to map
+ * palette colors to other colors. Now when the target palette is cycled, the
+ * indirect palette suddenly point at the wrong color(s). This function takes
+ * care of adjusting an indirect palette by searching through it and replacing
+ * all indices that are in the cycle range by the new (cycled) index.
+ *
+ * Finally, the palette entries still have to be cycled normally.
*/
static void doCycleIndirectPalette(byte *palette, int cycleStart, int cycleEnd, bool forward) {
int num = cycleEnd - cycleStart + 1;
@@ -2808,6 +2810,8 @@ static void doCycleIndirectPalette(byte *palette, int cycleStart, int cycleEnd,
palette[i] = (palette[i] - cycleStart + offset) % num + cycleStart;
}
}
+
+ doCyclePalette(palette, cycleStart, cycleEnd, 1, forward);
}