[Scummvm-cvs-logs] SF.net SVN: scummvm:[48400] scummvm/branches/branch-1-1-0/engines/teenagent

megath at users.sourceforge.net megath at users.sourceforge.net
Thu Mar 25 11:11:26 CET 2010


Revision: 48400
          http://scummvm.svn.sourceforge.net/scummvm/?rev=48400&view=rev
Author:   megath
Date:     2010-03-25 10:11:26 +0000 (Thu, 25 Mar 2010)

Log Message:
-----------
-fixed fan room
-shake screen when barmans felt
-fixed warning in messageDuration

Modified Paths:
--------------
    scummvm/branches/branch-1-1-0/engines/teenagent/scene.cpp
    scummvm/branches/branch-1-1-0/engines/teenagent/teenagent.cpp

Modified: scummvm/branches/branch-1-1-0/engines/teenagent/scene.cpp
===================================================================
--- scummvm/branches/branch-1-1-0/engines/teenagent/scene.cpp	2010-03-24 23:19:42 UTC (rev 48399)
+++ scummvm/branches/branch-1-1-0/engines/teenagent/scene.cpp	2010-03-25 10:11:26 UTC (rev 48400)
@@ -1119,7 +1119,22 @@
 			break;
 
 		case SceneEvent::kEffect:
-			debug(0, "*stub* shaking the screen");
+			_system->delayMillis(80); //2 vsyncs
+			_system->setShakePos(8);
+			_system->updateScreen();
+
+			_system->delayMillis(80); //2 vsyncs
+			_system->setShakePos(0);
+			_system->updateScreen();
+
+			_system->delayMillis(80); //2 vsyncs
+			_system->setShakePos(4);
+			_system->updateScreen();
+
+			_system->delayMillis(80); //2 vsyncs
+			_system->setShakePos(0);
+			_system->updateScreen();
+
 			current_event.clear();
 			break;
 
@@ -1188,7 +1203,7 @@
 	return &scene_objects[id];
 }
 
-Common::Point Scene::messagePosition(const Common::String &str, Common::Point position) {
+Common::Point Scene::messagePosition(const Common::String &str, Common::Point message_position) {
 	Resources *res = Resources::instance();
 	int lines = 1;
 	for(uint i = 0; i < str.size(); ++i)
@@ -1198,19 +1213,19 @@
 	uint w = res->font7.render(NULL, 0, 0, str, 0);
 	uint h = res->font7.height * lines + 3;
 
-	position.x -= w / 2;
-	position.y -= h;
+	message_position.x -= w / 2;
+	message_position.y -= h;
 
-	if (position.x + w > 320)
-		position.x = 320 - w;
-	if (position.x < 0)
-		position.x = 0;
-	if (position.y + h > 320)
-		position.y = 200 - h;
-	if (position.y < 0)
-		position.y = 0;
+	if (message_position.x + w > 320)
+		message_position.x = 320 - w;
+	if (message_position.x < 0)
+		message_position.x = 0;
+	if (message_position.y + h > 320)
+		message_position.y = 200 - h;
+	if (message_position.y < 0)
+		message_position.y = 0;
 
-	return position;
+	return message_position;
 }
 
 uint Scene::messageDuration(const Common::String &str) {

Modified: scummvm/branches/branch-1-1-0/engines/teenagent/teenagent.cpp
===================================================================
--- scummvm/branches/branch-1-1-0/engines/teenagent/teenagent.cpp	2010-03-24 23:19:42 UTC (rev 48399)
+++ scummvm/branches/branch-1-1-0/engines/teenagent/teenagent.cpp	2010-03-25 10:11:26 UTC (rev 48400)
@@ -145,7 +145,7 @@
 		debug(0, "click %d, %d, object %d, %d", point.x, point.y, dst.x, dst.y);
 		action = kActionExamine;
 		if (object->actor_rect.valid())
-			scene->moveTo(dst, object->actor_orientation);
+			scene->moveTo(dst, object->actor_orientation, true); //validate examine message. Original engine does not let you into walkboxes
 		dst_object = object;
 	} else if (!scene_busy) {
 		//do not reset anything while scene is busy, but allow interrupts while walking.


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