aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
authorTravis Howell2005-04-21 16:02:37 +0000
committerTravis Howell2005-04-21 16:02:37 +0000
commitd7f263ff1a7b291af01004cfb8951f27617bfd52 (patch)
tree402d192ba9109f7d620933d581580e4b5469b445 /scumm
parent098e0cce58a0c4039ac05fd7134c378ce33e1b71 (diff)
downloadscummvm-rg350-d7f263ff1a7b291af01004cfb8951f27617bfd52.tar.gz
scummvm-rg350-d7f263ff1a7b291af01004cfb8951f27617bfd52.tar.bz2
scummvm-rg350-d7f263ff1a7b291af01004cfb8951f27617bfd52.zip
Add palette function for HE99+ games.
svn-id: r17737
Diffstat (limited to 'scumm')
-rw-r--r--scumm/intern.h1
-rw-r--r--scumm/palette_he.cpp8
-rw-r--r--scumm/script_v90he.cpp14
3 files changed, 16 insertions, 7 deletions
diff --git a/scumm/intern.h b/scumm/intern.h
index 06e1ab6962..7b73fa8e14 100644
--- a/scumm/intern.h
+++ b/scumm/intern.h
@@ -1003,6 +1003,7 @@ protected:
uint8 *getHEPaletteIndex(int palSlot);
int getHEPaletteColor(int palSlot, int color);
int getPaletteUnk1(int palSlot, int arg_4, int arg_8, int start, int end);
+ int getPaletteUnk2(int palSlot, int unk1, int unk2);
void setHEPaletteColor(int palSlot, uint8 color, uint8 r, uint8 g, uint8 b);
void setHEPaletteFromPtr(int palSlot, const uint8 *palData);
diff --git a/scumm/palette_he.cpp b/scumm/palette_he.cpp
index ed2c27ab26..4999e0891a 100644
--- a/scumm/palette_he.cpp
+++ b/scumm/palette_he.cpp
@@ -131,6 +131,14 @@ int ScummEngine_v90he::getPaletteUnk1(int palSlot, int arg_4, int arg_8, int sta
return bestitem;
}
+int ScummEngine_v90he::getPaletteUnk2(int palSlot, int unk1, int unk2) {
+ assert(palSlot >= 1 && palSlot <= _numPalettes);
+ assert(unk1 >= 1 && unk1 <= 255);
+
+ return _hePalettes[palSlot * 1024 + unk1 * 3 + unk2 / 3];
+}
+
+
int ScummEngine_v90he::getHEPaletteColor(int palSlot, int color) {
assert(palSlot >= 1 && palSlot <= _numPalettes);
assert(color >= 1 && color <= 255);
diff --git a/scumm/script_v90he.cpp b/scumm/script_v90he.cpp
index 28bfc3175f..4a99c17d5b 100644
--- a/scumm/script_v90he.cpp
+++ b/scumm/script_v90he.cpp
@@ -2273,10 +2273,10 @@ void ScummEngine_v90he::o90_getPaletteData() {
push(getPaletteUnk1(palSlot, b, c, d, e));
break;
case 7:
- pop();
- pop();
- pop();
- push(0);
+ c = pop();
+ b = pop();
+ palSlot = pop();
+ push(getPaletteUnk2(palSlot, b, c));
break;
case 21:
color = pop();
@@ -2284,9 +2284,9 @@ void ScummEngine_v90he::o90_getPaletteData() {
push(getHEPaletteColor(palSlot, color));
break;
case 87:
- pop();
- pop();
- push(0);
+ c = pop();
+ b = pop();
+ push(getPaletteUnk2(1, b, c));
break;
case 172:
pop();