aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
authorTravis Howell2004-01-16 01:52:49 +0000
committerTravis Howell2004-01-16 01:52:49 +0000
commit555caf225131389d878ba35f484b00bb1d1ba2f1 (patch)
tree3c27be5ffd678e9e92e4aa445d2d183e3268d06f /scumm
parent34e1dca97e246e73742c0107b88600c7fed9ccac (diff)
downloadscummvm-rg350-555caf225131389d878ba35f484b00bb1d1ba2f1.tar.gz
scummvm-rg350-555caf225131389d878ba35f484b00bb1d1ba2f1.tar.bz2
scummvm-rg350-555caf225131389d878ba35f484b00bb1d1ba2f1.zip
Add correct actor palette color changing for HE games.
svn-id: r12419
Diffstat (limited to 'scumm')
-rw-r--r--scumm/actor.cpp34
-rw-r--r--scumm/actor.h1
-rw-r--r--scumm/script_v6.cpp5
3 files changed, 39 insertions, 1 deletions
diff --git a/scumm/actor.cpp b/scumm/actor.cpp
index 82e2b6613b..4fac4740b2 100644
--- a/scumm/actor.cpp
+++ b/scumm/actor.cpp
@@ -1586,6 +1586,40 @@ byte *Actor::getActorName() {
return ptr;
}
+void Actor::remapActorPaletteColor(int color, int new_color) {
+ const byte *akos, *akpl;
+ int akpl_size, i;
+ byte akpl_color;
+
+ akos = _vm->getResourceAddress(rtCostume, costume);
+ if (!akos) {
+ warning("Can't remap actor %d, costume %d not found", number, costume);
+ return;
+ }
+
+ akpl = findResource(MKID('AKPL'), akos);
+ if (!akpl) {
+ warning("Can't remap actor %d, costume %d doesn't contain an AKPL block", number, costume);
+ return;
+ }
+
+ //get num palette entries
+ akpl_size = RES_SIZE(akpl) - 8;
+
+ //skip resource header
+ akpl = RES_DATA(akpl);
+
+ for (i = 0; i < akpl_size; i++) {
+ akpl_color = *akpl++;
+ if (akpl_color == color) {
+ palette[i] = new_color;
+ return;
+ }
+ }
+
+ warning("Color %d not found in actor %d", color, number);
+}
+
void Actor::remapActorPalette(int r_fact, int g_fact, int b_fact, int threshold) {
const byte *akos, *rgbs, *akpl;
int akpl_size, i;
diff --git a/scumm/actor.h b/scumm/actor.h
index 90e735516e..335efd96ca 100644
--- a/scumm/actor.h
+++ b/scumm/actor.h
@@ -167,6 +167,7 @@ public:
void startAnimActor(int frame);
void remapActorPalette(int r_fact, int g_fact, int b_fact, int threshold);
+ void remapActorPaletteColor(int slot, int color);
void animateActor(int anim);
diff --git a/scumm/script_v6.cpp b/scumm/script_v6.cpp
index e6f8da5f53..2edf01ffbe 100644
--- a/scumm/script_v6.cpp
+++ b/scumm/script_v6.cpp
@@ -1705,7 +1705,10 @@ void ScummEngine_v6::o6_actorOps() {
j = pop();
i = pop();
checkRange(255, 0, i, "Illegal palette slot %d");
- a->setPalette(i, j);
+ if (_features & GF_HUMONGOUS)
+ a->remapActorPaletteColor(i, j);
+ else
+ a->setPalette(i, j);
break;
case 87: // SO_TALK_COLOR
a->talkColor = pop();