diff options
author | Travis Howell | 2005-04-06 23:56:50 +0000 |
---|---|---|
committer | Travis Howell | 2005-04-06 23:56:50 +0000 |
commit | 19ff0b0085df624918ee9ab438f1c40bfec57c83 (patch) | |
tree | 46639b401430a04f036a00e90d819255248a5a40 /scumm | |
parent | 60a64494d13f2266bf30c0c17633e23316cadb97 (diff) | |
download | scummvm-rg350-19ff0b0085df624918ee9ab438f1c40bfec57c83.tar.gz scummvm-rg350-19ff0b0085df624918ee9ab438f1c40bfec57c83.tar.bz2 scummvm-rg350-19ff0b0085df624918ee9ab438f1c40bfec57c83.zip |
Add hePalette function.
svn-id: r17424
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/intern.h | 1 | ||||
-rw-r--r-- | scumm/script_v100he.cpp | 12 | ||||
-rw-r--r-- | scumm/script_v90he.cpp | 18 |
3 files changed, 25 insertions, 6 deletions
diff --git a/scumm/intern.h b/scumm/intern.h index c1757fbb4a..addc66968a 100644 --- a/scumm/intern.h +++ b/scumm/intern.h @@ -940,6 +940,7 @@ protected: void sortArray(int array, int dim2start, int dim2end, int dim1start, int dim1end, int sortOrder); uint8 *getHEPalette(int palSlot); + int getHEPaletteColor(int palSlot, int color); void setHEPaletteColor(int palSlot, uint8 color, uint8 r, uint8 g, uint8 b); void setHEPaletteFromPtr(int palSlot, const uint8 *palData); void setHEPaletteFromCostume(int palSlot, int resId); diff --git a/scumm/script_v100he.cpp b/scumm/script_v100he.cpp index 61a12c95bc..1e74d4971b 100644 --- a/scumm/script_v100he.cpp +++ b/scumm/script_v100he.cpp @@ -2430,16 +2430,20 @@ void ScummEngine_v100he::o100_getWizData() { } void ScummEngine_v100he::o100_getPaletteData() { + int palSlot, color; + byte subOp = fetchScriptByte(); switch (subOp) { case 13: pop(); pop(); + push(0); break; case 20: - pop(); - pop(); + color = pop(); + palSlot = pop(); + push(getHEPaletteColor(palSlot, color)); break; case 33: pop(); @@ -2448,21 +2452,23 @@ void ScummEngine_v100he::o100_getPaletteData() { pop(); pop(); pop(); + push(0); break; case 53: pop(); pop(); pop(); + push(0); break; case 73: pop(); pop(); pop(); + push(0); break; default: error("o100_getPaletteData: Unknown case %d", subOp); } - push(0); debug(0, "o100_getPaletteData stub (%d)", subOp); } diff --git a/scumm/script_v90he.cpp b/scumm/script_v90he.cpp index e7a66775ac..10679bdbfd 100644 --- a/scumm/script_v90he.cpp +++ b/scumm/script_v90he.cpp @@ -2139,6 +2139,13 @@ uint8 *ScummEngine_v90he::getHEPalette(int palSlot) { } } +int ScummEngine_v90he::getHEPaletteColor(int palSlot, int color) { + assert(palSlot >= 1 && palSlot <= _numPalettes); + assert(color >= 1 && color <= 255); + + return _hePalettes[palSlot * 1024 + 768 + color]; +} + void ScummEngine_v90he::setHEPaletteColor(int palSlot, uint8 color, uint8 r, uint8 g, uint8 b) { assert(palSlot >= 1 && palSlot <= _numPalettes); uint8 *p = _hePalettes + palSlot * 1024 + color * 3; @@ -2211,6 +2218,8 @@ void ScummEngine_v90he::copyHEPaletteColor(int palSlot, uint8 dstColor, uint8 sr } void ScummEngine_v90he::o90_getPaletteData() { + int palSlot, color; + byte subOp = fetchScriptByte(); subOp -= 45; @@ -2221,24 +2230,27 @@ void ScummEngine_v90he::o90_getPaletteData() { pop(); pop(); pop(); + push(0); break; case 21: - pop(); - pop(); + color = pop(); + palSlot = pop(); + push(getHEPaletteColor(palSlot, color)); break; case 87: pop(); pop(); + push(0); break; case 172: pop(); pop(); pop(); + push(0); break; default: error("o90_getPaletteData: Unknown case %d", subOp); } - push(0); debug(1,"o90_getPaletteData stub (%d)", subOp); } |