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

megath at users.sourceforge.net megath at users.sourceforge.net
Sat Oct 31 19:49:47 CET 2009


Revision: 45575
          http://scummvm.svn.sourceforge.net/scummvm/?rev=45575&view=rev
Author:   megath
Date:     2009-10-31 18:49:47 +0000 (Sat, 31 Oct 2009)

Log Message:
-----------
added cutscenes where needed, fixed invalid skipping of fullscreen messages.

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

Modified: scummvm/trunk/engines/teenagent/callbacks.cpp
===================================================================
--- scummvm/trunk/engines/teenagent/callbacks.cpp	2009-10-31 18:36:13 UTC (rev 45574)
+++ scummvm/trunk/engines/teenagent/callbacks.cpp	2009-10-31 18:49:47 UTC (rev 45575)
@@ -2096,7 +2096,7 @@
 			SET_FLAG(0xDBE6, 1);
 			setOns(1, 0x66);
 			moveTo(224, 194, 0, true);
-			debug(0, "FIXME: add cut message: 57DF at 30423");
+			displayCutsceneMessage(0x57df, 30423);
 			inventory->remove(0x59);
 		} else {
 			displayMessage(0x5de2);
@@ -3623,7 +3623,7 @@
 			for (uint i = 0; i < 8; ++i)
 				playSound(26, 30 + i * 11);
 			playActorAnimation(661);
-			//cutscene 3c80 at 30484
+			displayCutsceneMessage(0x3c80, 30484);
 			playSound(56, 10);
 			playSound(56, 21);
 
@@ -3637,7 +3637,7 @@
 			waitAnimation();
 			setOns(1, 49);
 
-			//cutscene 0x3c9a at 30453
+			displayCutsceneMessage(0x3c9a, 30453);
 			moveTo(162, 184, 0, true);
 			playSound(26, 6);
 			playSound(26, 17);
@@ -3708,7 +3708,7 @@
 		byte id = scene->getId();
 
 		playMusic(11);
-		debug(0, "FIXME: cutscene: meanwhile in a mansion #%u, %04x", tries, ptr);
+		displayCutsceneMessage(0x580a, 30484);
 		processCallback(ptr);
 		playMusic(6);
 		if (scene->getId() == 11 && CHECK_FLAG(0xDBEC, 1))

Modified: scummvm/trunk/engines/teenagent/font.cpp
===================================================================
--- scummvm/trunk/engines/teenagent/font.cpp	2009-10-31 18:36:13 UTC (rev 45574)
+++ scummvm/trunk/engines/teenagent/font.cpp	2009-10-31 18:49:47 UTC (rev 45575)
@@ -63,12 +63,16 @@
 		for (uint j = 0; j < w; ++j) {
 			byte v = *glyph++;
 			switch (v) {
+			case 0:
+				break;
 			case 1:
 				dst[j] = shadow_color;
 				break;
 			case 2:
 				dst[j] = color;
 				break;
+			default:
+				dst[j] = v;
 			}
 		}
 		dst += surface->pitch;

Modified: scummvm/trunk/engines/teenagent/scene.cpp
===================================================================
--- scummvm/trunk/engines/teenagent/scene.cpp	2009-10-31 18:36:13 UTC (rev 45574)
+++ scummvm/trunk/engines/teenagent/scene.cpp	2009-10-31 18:49:47 UTC (rev 45575)
@@ -316,12 +316,13 @@
 			sounds.clear();
 			current_event.clear();
 			message_color = 0xd1;
+			Resources::instance()->font7.color = 0xd1;
 			for (int i = 0; i < 4; ++i)
 				custom_animation[i].free();
 			_engine->playMusic(4);
 			init(10, Common::Point(136, 153));
 		}
-		return false;
+		return true;
 
 	default:
 		return false;
@@ -331,22 +332,28 @@
 bool Scene::render(OSystem *system) {
 	//render background
 	Resources *res = Resources::instance();
-	if (current_event.type == SceneEvent::kCreditsMessage) {
-		system->fillScreen(0);
-		Graphics::Surface *surface = system->lockScreen();
-		res->font8.color = current_event.color;
-		res->font8.shadow_color = current_event.orientation;
-		res->font8.render(surface, current_event.dst.x, current_event.dst.y, message);
-		system->unlockScreen();
-		return true;
-	}
-
 	bool busy;
 	bool restart;
 
 	do {
 		restart = false;
 		busy = processEventQueue();
+
+		if (current_event.type == SceneEvent::kCreditsMessage) {
+			system->fillScreen(0);
+			Graphics::Surface *surface = system->lockScreen();
+			if (current_event.lan == 8) {
+				res->font8.color = current_event.color;
+				res->font8.shadow_color = current_event.orientation;
+				res->font8.render(surface, current_event.dst.x, current_event.dst.y, message);
+			} else {
+				res->font7.color = 0xd1;
+				res->font7.render(surface, current_event.dst.x, current_event.dst.y, message);
+			} 
+			system->unlockScreen();
+			return true;
+		}
+
 		system->copyRectToScreen((const byte *)background.pixels, background.pitch, 0, 0, background.w, background.h);
 
 		Graphics::Surface *surface = system->lockScreen();

Modified: scummvm/trunk/engines/teenagent/scene.h
===================================================================
--- scummvm/trunk/engines/teenagent/scene.h	2009-10-31 18:36:13 UTC (rev 45574)
+++ scummvm/trunk/engines/teenagent/scene.h	2009-10-31 18:49:47 UTC (rev 45575)
@@ -38,23 +38,23 @@
 
 struct SceneEvent {
 	enum Type {
-		kNone,
+		kNone,					//0
 		kMessage,
 		kWalk,
 		kPlayAnimation,
-		kPlayActorAnimation,
+		kPlayActorAnimation,	//4
 		kPauseAnimation,
 		kClearAnimations,
 		kLoadScene,
-		kSetOn,
+		kSetOn,					//8
 		kSetLan,
 		kPlayMusic,
 		kPlaySound,
-		kEnableObject,
+		kEnableObject,			//12
 		kHideActor,
 		kWaitForAnimation,
 		kCreditsMessage,
-		kQuit
+		kQuit					//16
 	} type;
 
 	Common::String message;

Modified: scummvm/trunk/engines/teenagent/teenagent.cpp
===================================================================
--- scummvm/trunk/engines/teenagent/teenagent.cpp	2009-10-31 18:36:13 UTC (rev 45574)
+++ scummvm/trunk/engines/teenagent/teenagent.cpp	2009-10-31 18:49:47 UTC (rev 45575)
@@ -377,6 +377,7 @@
 	const byte *src = Resources::instance()->dseg.ptr(addr);
 	event.orientation = *src++;
 	event.color = *src++;
+	event.lan = 8;
 
 	event.dst.y = *src;
 	while (true) {
@@ -393,6 +394,18 @@
 	scene->push(event);
 }
 
+void TeenAgentEngine::displayCutsceneMessage(uint16 addr, uint16 position) {
+	SceneEvent event(SceneEvent::kCreditsMessage);
+
+	event.message = parseMessage(addr);
+	event.dst.x = position % 320;
+	event.dst.y = position / 320;
+	event.lan = 7;
+	
+	scene->push(event);
+}
+
+
 void TeenAgentEngine::moveTo(const Common::Point &dst, byte o, bool warp) {
 	moveTo(dst.x, dst.y, o, warp);
 }

Modified: scummvm/trunk/engines/teenagent/teenagent.h
===================================================================
--- scummvm/trunk/engines/teenagent/teenagent.h	2009-10-31 18:36:13 UTC (rev 45574)
+++ scummvm/trunk/engines/teenagent/teenagent.h	2009-10-31 18:49:47 UTC (rev 45575)
@@ -68,6 +68,7 @@
 	void displayMessage(uint16 addr, byte color = 0xd1);
 	void displayMessage(const Common::String &str, byte color = 0xd1);
 	void displayCredits(uint16 addr);
+	void displayCutsceneMessage(uint16 addr, uint16 position);
 	void moveTo(const Common::Point &dst, byte o, bool warp = false);
 	void moveTo(uint16 x, uint16 y, byte o, bool warp = false);
 	void moveTo(Object *obj);


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