[Scummvm-cvs-logs] SF.net SVN: scummvm:[45917] scummvm/trunk/engines/teenagent

megath at users.sourceforge.net megath at users.sourceforge.net
Sun Nov 15 12:07:53 CET 2009


Revision: 45917
          http://scummvm.svn.sourceforge.net/scummvm/?rev=45917&view=rev
Author:   megath
Date:     2009-11-15 11:07:52 +0000 (Sun, 15 Nov 2009)

Log Message:
-----------
added real face animation handling

Modified Paths:
--------------
    scummvm/trunk/engines/teenagent/dialog.cpp
    scummvm/trunk/engines/teenagent/scene.cpp

Modified: scummvm/trunk/engines/teenagent/dialog.cpp
===================================================================
--- scummvm/trunk/engines/teenagent/dialog.cpp	2009-11-15 10:54:29 UTC (rev 45916)
+++ scummvm/trunk/engines/teenagent/dialog.cpp	2009-11-15 11:07:52 UTC (rev 45917)
@@ -66,12 +66,12 @@
 				//debug(0, "displaymessage %s", message.c_str());
 				if (color == color2) {
 					//pause animation in other slot
-					if (animation1 != 0) {
+					{
 						SceneEvent e(SceneEvent::kPauseAnimation);
 						e.slot = 0x80 | slot1;
 						scene->push(e);
 					}
-					if (animation2 != 0) {
+					{
 						SceneEvent e(SceneEvent::kPlayAnimation);
 						e.animation = animation2;
 						e.slot = 0x80 | slot2;
@@ -79,12 +79,12 @@
 					}
 				} else if (color == color1) {
 					//pause animation in other slot
-					if (animation2 != 0) {
+					{
 						SceneEvent e(SceneEvent::kPauseAnimation);
 						e.slot = 0x80 | slot2;
 						scene->push(e);
 					}
-					if (animation1 != 0) {
+					{
 						SceneEvent e(SceneEvent::kPlayAnimation);
 						e.animation = animation1;
 						e.slot = 0x80 | slot1;

Modified: scummvm/trunk/engines/teenagent/scene.cpp
===================================================================
--- scummvm/trunk/engines/teenagent/scene.cpp	2009-11-15 10:54:29 UTC (rev 45916)
+++ scummvm/trunk/engines/teenagent/scene.cpp	2009-11-15 11:07:52 UTC (rev 45917)
@@ -667,7 +667,7 @@
 						busy = true;
 					} else
 						busy = true;
-				} else
+				} else 
 					actor_animation_position = teenagent.render(surface, position, orientation, 0, actor_talking);
 			}
 		}
@@ -857,36 +857,43 @@
 		case SceneEvent::kPlayAnimation: {
 				byte slot = current_event.slot & 7; //0 - mark's
 				if (current_event.animation != 0) {
+					debug(0, "playing animation %u in slot %u", current_event.animation, slot);
 					if (slot != 0) {
 						--slot;
-						debug(0, "playing animation %u in slot %u", current_event.animation, slot);
 						assert(slot < 4);
 						playAnimation(slot, current_event.animation, (current_event.slot & 0x80) != 0, (slot & 0x40) != 0, (slot & 0x20) != 0);
-					}
+					} else
+						actor_talking = true;
 				} else {
 					if (slot != 0) {
 						--slot;
 						debug(0, "cancelling animation in slot %u", slot);
 						assert(slot < 4);
 						custom_animation[slot].free();
-					}
+					} else
+						actor_talking = true;
 				}
 				current_event.clear();
 			}
 			break;
 
-		case SceneEvent::kPauseAnimation:
-			if (current_event.slot != 0) {
-				--current_event.slot;
-				debug(0, "pause animation in slot %u", current_event.slot & 3);
-				custom_animation[current_event.slot & 3].paused = (current_event.slot & 0x80) != 0;
+		case SceneEvent::kPauseAnimation: {
+				byte slot = current_event.slot & 7; //0 - mark's
+				if (slot != 0) {
+					--slot;
+					debug(0, "pause animation in slot %u", slot);
+					custom_animation[slot].paused = (current_event.slot & 0x80) != 0;
+				} else {
+					actor_talking = false;
+				}
+				current_event.clear();
 			}
-			current_event.clear();
 			break;
 
 		case SceneEvent::kClearAnimations:
 			for (byte i = 0; i < 4; ++i)
 				custom_animation[i].free();
+			actor_talking = false;
 			current_event.clear();
 			break;
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list