diff options
author | Max Horn | 2002-05-20 14:28:02 +0000 |
---|---|---|
committer | Max Horn | 2002-05-20 14:28:02 +0000 |
commit | cb150cd11db05aeb25afa5f835d61325851bcd09 (patch) | |
tree | a4e26aedc11ac42e56f8f0d3f516fb16b471febf /script_v2.cpp | |
parent | 4aabb0378c88d77d544aad41376552f9ce4fa198 (diff) | |
download | scummvm-rg350-cb150cd11db05aeb25afa5f835d61325851bcd09.tar.gz scummvm-rg350-cb150cd11db05aeb25afa5f835d61325851bcd09.tar.bz2 scummvm-rg350-cb150cd11db05aeb25afa5f835d61325851bcd09.zip |
setupShadowPalette doesn't belong into actor.cpp; it's only used in script_v2.cpp, hence moving it there
svn-id: r4360
Diffstat (limited to 'script_v2.cpp')
-rw-r--r-- | script_v2.cpp | 40 |
1 files changed, 34 insertions, 6 deletions
diff --git a/script_v2.cpp b/script_v2.cpp index d384796638..3d60d537b9 100644 --- a/script_v2.cpp +++ b/script_v2.cpp @@ -2987,6 +2987,15 @@ void Scumm::o6_pickOneOfDefault() push(i); } +void Scumm::o6_getActorPriority() +{ + Actor *a; + + a = derefActorSafe(pop(), "getActorPriority"); + + push(a->layer); +} + void Scumm::decodeParseString2(int m, int n) { byte b; @@ -3071,11 +3080,30 @@ void Scumm::decodeParseString2(int m, int n) } } -void Scumm::o6_getActorPriority() +void Scumm::setupShadowPalette(int slot, int rfact, int gfact, int bfact, + int from, int to) { - Actor *a; - - a = derefActorSafe(pop(), "getActorPriority"); - - push(a->layer); + byte *table; + int i, num; + byte *curpal; + + if (slot < 0 || slot > 7) + error("setupShadowPalette: invalid slot %d", slot); + + if (from < 0 || from > 255 || to < 0 || from > 255 || to < from) + error("setupShadowPalette: invalid range from %d to %d", from, to); + + table = _shadowPalette + slot * 256; + for (i = 0; i < 256; i++) + table[i] = i; + + table += from; + curpal = _currentPalette + from * 3; + num = to - from + 1; + do { + *table++ = remapPaletteColor((curpal[0] * rfact) >> 8, + curpal[1] * gfact >> 8, + curpal[2] * bfact >> 8, (uint) - 1); + curpal += 3; + } while (--num); } |