aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
authorMax Horn2003-05-13 23:03:18 +0000
committerMax Horn2003-05-13 23:03:18 +0000
commit796fa748062564b4bf1993b6a150ce1d2da91259 (patch)
tree727f5263616f959ee753bafaba185184d611ef4a /scumm
parentfea9aed00ae4b542cac7a78d097c70e3613f9c7a (diff)
downloadscummvm-rg350-796fa748062564b4bf1993b6a150ce1d2da91259.tar.gz
scummvm-rg350-796fa748062564b4bf1993b6a150ce1d2da91259.tar.bz2
scummvm-rg350-796fa748062564b4bf1993b6a150ce1d2da91259.zip
cleanup
svn-id: r7487
Diffstat (limited to 'scumm')
-rw-r--r--scumm/actor.cpp60
-rw-r--r--scumm/costume.cpp15
2 files changed, 36 insertions, 39 deletions
diff --git a/scumm/actor.cpp b/scumm/actor.cpp
index bc02d86962..b6efdc3f5b 100644
--- a/scumm/actor.cpp
+++ b/scumm/actor.cpp
@@ -780,32 +780,6 @@ void Scumm::showActors() {
}
}
-void Scumm::stopTalk() {
- int act;
-
- _sound->stopTalkSound();
-
- _haveMsg = 0;
- _talkDelay = 0;
-
- act = VAR(VAR_TALK_ACTOR);
- if (act && act < 0x80) {
- Actor *a = derefActorSafe(act, "stopTalk");
- if ((a->isInCurrentRoom() && _useTalkAnims) || (_features & GF_NEW_COSTUMES)) {
- a->startAnimActor(a->talkFrame2);
- _useTalkAnims = false;
- }
- VAR(VAR_TALK_ACTOR) = 0xFF;
- }
- _keepText = false;
- restoreCharsetBg();
-}
-
-void Scumm::clearMsgQueue() {
- _messagePtr = (byte *)" ";
- stopTalk();
-}
-
void Scumm::walkActors() {
int i;
Actor *a;
@@ -1148,7 +1122,6 @@ int Scumm::getActorFromPos(int x, int y) {
}
void Scumm::actorTalk() {
- int oldact;
Actor *a;
_msgPtrToAdd = _charsetBuffer;
@@ -1159,9 +1132,10 @@ void Scumm::actorTalk() {
if (!_keepText)
stopTalk();
VAR(VAR_TALK_ACTOR) = 0xFF;
- oldact = 0;
} else {
+ int oldact;
a = derefActorSafe(_actorToPrintStrFor, "actorTalk");
+ assert(a);
if (!a->isInCurrentRoom() && !(_features & GF_NEW_COSTUMES)) {
oldact = 0xFF;
} else {
@@ -1174,9 +1148,9 @@ void Scumm::actorTalk() {
}
oldact = VAR(VAR_TALK_ACTOR);
}
+ if (oldact >= 0x80)
+ return;
}
- if (oldact >= 0x80)
- return;
if (VAR(VAR_TALK_ACTOR) > 0x7F) {
_charsetColor = (byte)_string[0].color;
@@ -1191,6 +1165,32 @@ void Scumm::actorTalk() {
CHARSET_1();
}
+void Scumm::stopTalk() {
+ int act;
+
+ _sound->stopTalkSound();
+
+ _haveMsg = 0;
+ _talkDelay = 0;
+
+ act = VAR(VAR_TALK_ACTOR);
+ if (act && act < 0x80) {
+ Actor *a = derefActorSafe(act, "stopTalk");
+ if ((a->isInCurrentRoom() && _useTalkAnims) || (_features & GF_NEW_COSTUMES)) {
+ a->startAnimActor(a->talkFrame2);
+ _useTalkAnims = false;
+ }
+ VAR(VAR_TALK_ACTOR) = 0xFF;
+ }
+ _keepText = false;
+ restoreCharsetBg();
+}
+
+void Scumm::clearMsgQueue() {
+ _messagePtr = (byte *)" ";
+ stopTalk();
+}
+
void Actor::setActorCostume(int c) {
int i;
diff --git a/scumm/costume.cpp b/scumm/costume.cpp
index a4b3b8d1a4..1955494d88 100644
--- a/scumm/costume.cpp
+++ b/scumm/costume.cpp
@@ -1326,21 +1326,18 @@ void CostumeRenderer::setPalette(byte *palette) {
memset(_palette, 8, 16);
_palette[12] = 0;
}
- // FIXME: is this actually anything more than a guess (i.e. verified by disassmbly) ?
- // A more "logical" thing would be if any 255 values in _palette are replaced
- // by this value, at least that would closely parallel the actor palette usage in
- // newer games (see below).
_palette[_loaded._ptr[8]] = _palette[0];
} else {
- for (i = 0; i < _loaded._numColors; i++) {
- if ((_vm->VAR(_vm->VAR_CURRENT_LIGHTS) & LIGHTMODE_actor_color) || (_vm->_features & GF_AFTER_V6)) {
+ if ((_vm->_features & GF_AFTER_V6) || (_vm->VAR(_vm->VAR_CURRENT_LIGHTS) & LIGHTMODE_actor_color)) {
+ for (i = 0; i < _loaded._numColors; i++) {
color = palette[i];
if (color == 255)
color = _loaded._ptr[8 + i];
- } else {
- color = (i == 12) ? 0 : 8;
+ _palette[i] = color;
}
- _palette[i] = color;
+ } else {
+ memset(_palette, 8, _loaded._numColors);
+ _palette[12] = 0;
}
}
}