aboutsummaryrefslogtreecommitdiff
path: root/scumm/actor.cpp
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/actor.cpp
parentfea9aed00ae4b542cac7a78d097c70e3613f9c7a (diff)
downloadscummvm-rg350-796fa748062564b4bf1993b6a150ce1d2da91259.tar.gz
scummvm-rg350-796fa748062564b4bf1993b6a150ce1d2da91259.tar.bz2
scummvm-rg350-796fa748062564b4bf1993b6a150ce1d2da91259.zip
cleanup
svn-id: r7487
Diffstat (limited to 'scumm/actor.cpp')
-rw-r--r--scumm/actor.cpp60
1 files changed, 30 insertions, 30 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;