[Scummvm-cvs-logs] CVS: scummvm/scumm actor.cpp,1.84,1.85 costume.cpp,1.38,1.39

Max Horn fingolfin at users.sourceforge.net
Tue May 13 16:04:22 CEST 2003


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1:/tmp/cvs-serv4610

Modified Files:
	actor.cpp costume.cpp 
Log Message:
cleanup

Index: actor.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/actor.cpp,v
retrieving revision 1.84
retrieving revision 1.85
diff -u -d -r1.84 -r1.85
--- actor.cpp	12 May 2003 17:50:09 -0000	1.84
+++ actor.cpp	13 May 2003 23:03:14 -0000	1.85
@@ -780,32 +780,6 @@
 	}
 }
 
-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 @@
 }
 
 void Scumm::actorTalk() {
-	int oldact;
 	Actor *a;
 
 	_msgPtrToAdd = _charsetBuffer;
@@ -1159,9 +1132,10 @@
 		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 @@
 			}
 			oldact = VAR(VAR_TALK_ACTOR);
 		}
+		if (oldact >= 0x80)
+			return;
 	}
-	if (oldact >= 0x80)
-		return;
 
 	if (VAR(VAR_TALK_ACTOR) > 0x7F) {
 		_charsetColor = (byte)_string[0].color;
@@ -1189,6 +1163,32 @@
 	_haveMsg = 0xFF;
 	VAR(VAR_HAVE_MSG) = 0xFF;
 	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) {

Index: costume.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/costume.cpp,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- costume.cpp	12 May 2003 21:50:28 -0000	1.38
+++ costume.cpp	13 May 2003 23:03:18 -0000	1.39
@@ -1326,21 +1326,18 @@
 			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;
 		}
 	}
 }





More information about the Scummvm-git-logs mailing list