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

megath at users.sourceforge.net megath at users.sourceforge.net
Thu Nov 12 11:32:30 CET 2009


Revision: 45857
          http://scummvm.svn.sourceforge.net/scummvm/?rev=45857&view=rev
Author:   megath
Date:     2009-11-12 10:32:29 +0000 (Thu, 12 Nov 2009)

Log Message:
-----------
fixed dialog positioning for mark

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

Modified: scummvm/trunk/engines/teenagent/callbacks.cpp
===================================================================
--- scummvm/trunk/engines/teenagent/callbacks.cpp	2009-11-12 10:07:44 UTC (rev 45856)
+++ scummvm/trunk/engines/teenagent/callbacks.cpp	2009-11-12 10:32:29 UTC (rev 45857)
@@ -100,6 +100,7 @@
 		setLan(2, 1);
 		Dialog::show(scene, 0x748e, 914, 915, 0xe7, 0xd7, 2, 1);
 		displayCredits(0xe3c2);
+		
 		loadScene(42, 139, 156, 3);
 		playSound(15, 20);
 		playAnimation(916, 1);
@@ -112,7 +113,7 @@
 		playAnimation(917, 1, true);
 		waitAnimation();
 		displayCredits(0xe3e6);
-
+		
 		loadScene(40, 139, 156, 3);
 		playMusic(3);
 		Dialog::show(scene, 0x750d, 920, 924, 0xe7, 0xeb, 1, 2); //as i told you, our organization...
@@ -120,7 +121,7 @@
 		playAnimation(925, 0, true);
 		playAnimation(926, 1, true);
 		waitAnimation();
-		Dialog::show(scene, 0x78a6, 927, 920, 0xeb, 0xeb, 2, 1);
+		Dialog::show(scene, 0x78a6, 927, 920, 0xeb, 0xe7, 2, 1);
 		displayCredits(0xe3ff);
 
 		loadScene(39, 139, 156, 3);
@@ -163,7 +164,7 @@
 		playAnimation(851, 0, true);
 		playActorAnimation(934, true);
 		waitAnimation();
-		loadScene(10, 136, 153);
+		loadScene(10, 136, 153, 3);
 
 		return true;
 

Modified: scummvm/trunk/engines/teenagent/dialog.cpp
===================================================================
--- scummvm/trunk/engines/teenagent/dialog.cpp	2009-11-12 10:07:44 UTC (rev 45856)
+++ scummvm/trunk/engines/teenagent/dialog.cpp	2009-11-12 10:32:29 UTC (rev 45857)
@@ -29,8 +29,6 @@
 namespace TeenAgent {
 
 void Dialog::show(Scene *scene, uint16 addr, uint16 animation1, uint16 animation2, byte color1, byte color2, byte slot1, byte slot2) {
-	--slot1;
-	--slot2;
 	debug(0, "Dialog::show(%04x, %u:%u, %u:%u)", addr, slot1, animation1, slot2, animation2);
 	Resources *res = Resources::instance();
 	int n = 0;
@@ -102,9 +100,9 @@
 					SceneEvent e(SceneEvent::kMessage);
 					e.message = message;
 					e.color = color;
-					if (animation1 != 0 && color == color1)
+					if (color == color1)
 						e.slot = slot1;
-					if (animation2 != 0 && color == color2)
+					if (color == color2)
 						e.slot = slot2;
 					scene->push(e);
 					message.clear();

Modified: scummvm/trunk/engines/teenagent/scene.cpp
===================================================================
--- scummvm/trunk/engines/teenagent/scene.cpp	2009-11-12 10:07:44 UTC (rev 45856)
+++ scummvm/trunk/engines/teenagent/scene.cpp	2009-11-12 10:32:29 UTC (rev 45857)
@@ -392,8 +392,16 @@
 			}
 		}
 
+		//render on
+		if (on.pixels != NULL) {
+			if (_id != 16 || getOns(16)[0] != 0) {
+				on.render(surface); //do not render boat on isle. I double checked all callbacks, there's no code switching off the boat :(
+			}
+		}
+
 		bool got_any_animation = false;
 
+
 		for (byte i = 0; i < 4; ++i) {
 			Animation *a = custom_animation + i;
 			Surface *s = a->currentFrame();
@@ -495,14 +503,6 @@
 			}
 		}
 
-		//render on
-		if (on.pixels != NULL) {
-			if (_id != 16 || getOns(16)[0] != 0) {
-				on.render(surface); //do not render boat on isle. I double checked all callbacks, there's no code switching off the boat :(
-			}
-		}
-
-
 		if (!message.empty()) {
 			bool visible = true;
 			if (message_first_frame != 0 && message_animation != NULL) {
@@ -634,8 +634,8 @@
 					message_timer = 0;
 					message_first_frame = current_event.first_frame;
 					message_last_frame = current_event.last_frame;
-					if (current_event.slot < 4) {
-						message_animation = custom_animation + current_event.slot;
+					if (current_event.slot > 0) {
+						message_animation = custom_animation + (current_event.slot - 1);
 						//else if (!animation[current_event.slot].empty())
 						//	message_animation = animation + current_event.slot;
 					} else 
@@ -652,16 +652,19 @@
 				} else {
 					p = current_event.dst;
 				}
-				//FIXME: rewrite it:
-				if (current_event.slot < 4) {
-					const Surface *s = custom_animation[current_event.slot].currentFrame(0);
+
+				byte message_slot = current_event.slot;
+				if (message_slot != 0) {
+					--message_slot;
+					assert(message_slot < 4);
+					const Surface *s = custom_animation[message_slot].currentFrame(0);
 					if (s == NULL)
-						s = animation[current_event.slot].currentFrame(0);
+						s = animation[message_slot].currentFrame(0);
 					if (s != NULL) {
 						p.x = s->x + s->w / 2;
 						p.y = s->y;
 					} else 
-						warning("no animation in slot %u", current_event.slot);
+						warning("no animation in slot %u", message_slot);
 				}
 				message_pos = messagePosition(message, p);
 				message_color = current_event.color;
@@ -671,20 +674,33 @@
 			}
 			break;
 
-		case SceneEvent::kPlayAnimation:
-			if (current_event.animation != 0) {
-				debug(0, "playing animation %u in slot %u", current_event.animation, current_event.slot & 3);
-				playAnimation(current_event.slot & 3, current_event.animation, (current_event.slot & 0x80) != 0, (current_event.slot & 0x40) != 0, (current_event.slot & 0x20) != 0);
-			} else {
-				debug(0, "cancelling animation in slot %u", current_event.slot & 3);
-				custom_animation[current_event.slot & 3].free();
+		case SceneEvent::kPlayAnimation: {
+				byte slot = current_event.slot & 7; //0 - mark's
+				if (current_event.animation != 0) {
+					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 {
+					if (slot != 0) {
+						--slot;
+						debug(0, "cancelling animation in slot %u", slot);
+						assert(slot < 4);
+						custom_animation[slot].free();
+					}
+				}
+				current_event.clear();
 			}
-			current_event.clear();
 			break;
 
 		case SceneEvent::kPauseAnimation:
-			debug(0, "pause animation in slot %u", current_event.slot & 3);
-			custom_animation[current_event.slot & 3].paused = (current_event.slot & 0x80) != 0;
+			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;
+			}
 			current_event.clear();
 			break;
 

Modified: scummvm/trunk/engines/teenagent/teenagent.cpp
===================================================================
--- scummvm/trunk/engines/teenagent/teenagent.cpp	2009-11-12 10:07:44 UTC (rev 45856)
+++ scummvm/trunk/engines/teenagent/teenagent.cpp	2009-11-12 10:32:29 UTC (rev 45857)
@@ -400,7 +400,7 @@
 	SceneEvent event(SceneEvent::kMessage);
 	event.message = str;
 	event.color = color;
-	event.slot = 4;
+	event.slot = 0;
 	event.dst.x = position % 320;
 	event.dst.y = position / 320;
 
@@ -414,7 +414,7 @@
 void TeenAgentEngine::displayAsyncMessage(uint16 addr, uint16 position, uint16 first_frame, uint16 last_frame, byte color) {
 	SceneEvent event(SceneEvent::kMessage);
 	event.message = parseMessage(addr);
-	event.slot = 4;
+	event.slot = 0;
 	event.color = color;
 	event.dst.x = position % 320;
 	event.dst.y = position / 320;
@@ -427,7 +427,7 @@
 void TeenAgentEngine::displayAsyncMessageInSlot(uint16 addr, byte slot, uint16 first_frame, uint16 last_frame, byte color) {
 	SceneEvent event(SceneEvent::kMessage);
 	event.message = parseMessage(addr);
-	event.slot = slot;
+	event.slot = slot + 1;
 	event.color = color;
 	event.first_frame = first_frame;
 	event.last_frame = last_frame;
@@ -504,7 +504,7 @@
 void TeenAgentEngine::playAnimation(uint16 id, byte slot, bool async, bool ignore, bool loop) {
 	SceneEvent event(SceneEvent::kPlayAnimation);
 	event.animation = id;
-	event.slot = slot | (ignore? 0x20: 0) | (loop? 0x80: 0);
+	event.slot = (slot + 1) | (ignore? 0x20: 0) | (loop? 0x80: 0);
 	scene->push(event);
 	if (!async)
 		waitAnimation();


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