aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
authorMax Horn2004-01-05 16:30:00 +0000
committerMax Horn2004-01-05 16:30:00 +0000
commitf506056c3b0fee25445133aa9763fced5a131330 (patch)
treeb7bea930c94043e637a96478039f46a4e1944098 /scumm
parenta469559d134822121b2268aebc9ca733985c2146 (diff)
downloadscummvm-rg350-f506056c3b0fee25445133aa9763fced5a131330.tar.gz
scummvm-rg350-f506056c3b0fee25445133aa9763fced5a131330.tar.bz2
scummvm-rg350-f506056c3b0fee25445133aa9763fced5a131330.zip
more cleanup
svn-id: r12161
Diffstat (limited to 'scumm')
-rw-r--r--scumm/actor.h17
-rw-r--r--scumm/script_v2.cpp3
-rw-r--r--scumm/script_v5.cpp11
-rw-r--r--scumm/script_v6.cpp13
-rw-r--r--scumm/script_v8.cpp7
5 files changed, 29 insertions, 22 deletions
diff --git a/scumm/actor.h b/scumm/actor.h
index 815690e368..92112181e9 100644
--- a/scumm/actor.h
+++ b/scumm/actor.h
@@ -105,12 +105,12 @@ public:
byte walkbox;
int16 talkPosX, talkPosY;
uint16 talkScript, walkScript;
- bool ignoreTurns; // TODO - we do not honor this flag at all currently!
+ bool ignoreTurns;
int8 layer;
uint16 sound[8];
CostumeData cost;
- byte palette[256];
protected:
+ byte palette[256];
int elevation;
uint16 facing;
uint16 targetFacing;
@@ -206,6 +206,19 @@ public:
}
}
+ void setPalette(int idx, int val) {
+ palette[idx] = val;
+ needRedraw = true;
+ }
+
+ void setScale(int sx, int sy) {
+ if (sx != -1)
+ scalex = sx;
+ if (sy != -1)
+ scaley = sy;
+ needRedraw = true;
+ }
+
void classChanged(int cls, bool value);
// Used by the save/load syste:
diff --git a/scumm/script_v2.cpp b/scumm/script_v2.cpp
index 6fc9047594..aafdac4930 100644
--- a/scumm/script_v2.cpp
+++ b/scumm/script_v2.cpp
@@ -691,8 +691,7 @@ void ScummEngine_v2::o2_actorOps() {
else
i = fetchScriptByte();
- a->palette[i] = arg;
- a->needRedraw = true;
+ a->setPalette(i, arg);
break;
case 3: // SO_ACTOR_NAME
loadPtrToResource(rtActorName, a->number, NULL);
diff --git a/scumm/script_v5.cpp b/scumm/script_v5.cpp
index f151d19571..412b630d40 100644
--- a/scumm/script_v5.cpp
+++ b/scumm/script_v5.cpp
@@ -459,8 +459,7 @@ void ScummEngine_v5::o5_actorOps() {
i = getVarOrDirectByte(PARAM_1);
j = getVarOrDirectByte(PARAM_2);
checkRange(31, 0, i, "Illegal palette slot %d");
- a->palette[i] = j;
- a->needRedraw = true;
+ a->setPalette(i, j);
break;
case 12: // SO_TALK_COLOR
@@ -498,13 +497,13 @@ void ScummEngine_v5::o5_actorOps() {
break;
case 17: // SO_ACTOR_SCALE
if (_version == 4) {
- a->scalex = a->scaley = getVarOrDirectByte(PARAM_1);
+ i = j = getVarOrDirectByte(PARAM_1);
} else {
- a->scalex = getVarOrDirectByte(PARAM_1);
- a->scaley = getVarOrDirectByte(PARAM_2);
+ i = getVarOrDirectByte(PARAM_1);
+ j = getVarOrDirectByte(PARAM_2);
}
- a->needRedraw = true;
+ a->setScale(i, j);
break;
case 18: // SO_NEVER_ZCLIP
a->forceClip = 0;
diff --git a/scumm/script_v6.cpp b/scumm/script_v6.cpp
index 725c68615b..1b5c9196f4 100644
--- a/scumm/script_v6.cpp
+++ b/scumm/script_v6.cpp
@@ -1705,8 +1705,7 @@ void ScummEngine_v6::o6_actorOps() {
j = pop();
i = pop();
checkRange(255, 0, i, "Illegal palette slot %d");
- a->palette[i] = j;
- a->needRedraw = true;
+ a->setPalette(i, j);
break;
case 87: // SO_TALK_COLOR
a->talkColor = pop();
@@ -1721,8 +1720,8 @@ void ScummEngine_v6::o6_actorOps() {
a->width = pop();
break;
case 92: // SO_SCALE
- a->scalex = a->scaley = pop();
- a->needRedraw = true;
+ i = pop();
+ a->setScale(i, i);
break;
case 93: // SO_NEVER_ZCLIP
a->forceClip = 0;
@@ -2546,8 +2545,7 @@ void ScummEngine_v6::o6_kernelSetFunctions() {
break;
case 107:
a = derefActor(args[1], "o6_kernelSetFunctions: 107");
- a->scalex = (unsigned char)args[2];
- a->needRedraw = true;
+ a->setScale((unsigned char)args[2], -1);
break;
case 108:
setupShadowPalette(args[1], args[2], args[3], args[4], args[5], args[6]);
@@ -2610,8 +2608,7 @@ void ScummEngine_v6::o6_kernelSetFunctions() {
break;
case 107: /* set actor scale */
a = derefActor(args[1], "o6_kernelSetFunctions: 107");
- a->scalex = (unsigned char)args[2];
- a->needRedraw = true;
+ a->setScale((unsigned char)args[2], -1);
break;
case 108: /* create proc_special_palette */
case 109:
diff --git a/scumm/script_v8.cpp b/scumm/script_v8.cpp
index 75c240fd10..eb8ac316d6 100644
--- a/scumm/script_v8.cpp
+++ b/scumm/script_v8.cpp
@@ -973,8 +973,7 @@ void ScummEngine_v8::o8_actorOps() {
j = pop();
i = pop();
checkRange(31, 0, i, "Illegal palette slot %d");
- a->palette[i] = j;
- a->needRedraw = true;
+ a->setPalette(i, j);
break;
case 0x70: // SO_ACTOR_TALK_COLOR Set actor talk color
a->talkColor = pop();
@@ -986,8 +985,8 @@ void ScummEngine_v8::o8_actorOps() {
a->width = pop();
break;
case 0x73: // SO_ACTOR_SCALE Set scaling of actor
- a->scalex = a->scaley = pop();
- a->needRedraw = true;
+ i = pop();
+ a->setScale(i, i);
break;
case 0x74: // SO_ACTOR_NEVER_ZCLIP
a->forceClip = 0;