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

megath at users.sourceforge.net megath at users.sourceforge.net
Sun Sep 13 12:50:29 CEST 2009


Revision: 44049
          http://scummvm.svn.sourceforge.net/scummvm/?rev=44049&view=rev
Author:   megath
Date:     2009-09-13 10:50:29 +0000 (Sun, 13 Sep 2009)

Log Message:
-----------
added intro support

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

Modified: scummvm/trunk/engines/teenagent/callbacks.cpp
===================================================================
--- scummvm/trunk/engines/teenagent/callbacks.cpp	2009-09-13 10:32:55 UTC (rev 44048)
+++ scummvm/trunk/engines/teenagent/callbacks.cpp	2009-09-13 10:50:29 UTC (rev 44049)
@@ -88,6 +88,83 @@
 	
 	switch(addr) {
 	
+	case 0x024c: //intro
+		loadScene(41, 139, 156, 3);
+		playSound(41, 12);
+		playAnimation(912, 1);
+		setOns(0, 108);
+		playSound(62, 8);
+		playSound(58, 40);
+		playAnimation(913, 1);
+		setOns(1, 109);
+		Dialog::show(scene, 0x748e, 914, 915, 0xe7, 0xd7);
+		displayCredits(0xe3c2);
+		loadScene(42, 139, 156, 3);
+		playSound(15, 20);
+		playAnimation(916, 1);
+		playSound(40, 18);
+		playSound(40, 22);
+		for(byte i = 27; i < 37; i += 2)
+			playSound(40, i);
+		playSound(29, 44);
+		playAnimation(918, 0, true);
+		playAnimation(917, 1, true);
+		waitAnimation();
+		displayCredits(0xe3e6);
+
+		loadScene(40, 139, 156, 3);
+		playMusic(3);
+		Dialog::show(scene, 0x750d, 920, 924, 0xe7, 0xeb); //as i told you, our organization...
+		playSound(26, 50);
+		playAnimation(925, 0, true);
+		playAnimation(926, 1, true);
+		waitAnimation();
+		Dialog::show(scene, 0x78a6, 927, 920, 0xeb, 0xeb); 
+		displayCredits(0xe3ff);
+		
+		loadScene(39, 139, 156, 3);
+		playMusic(11);
+		playSound(81, 2);
+		playSound(81, 8);
+		playSound(81, 11);
+		playSound(81, 14);
+		playSound(81, 16);
+		playSound(81, 18);
+		playSound(81, 20);
+		playSound(81, 21);
+		playAnimation(928, 1);
+		setOns(0, 112);
+		Dialog::show(scene, 0x78e1, 929, 0, 0xd1); //he's coming
+		moveTo(319, 150, 1, true);
+		moveTo(63, 150, 1);
+		displayMessage(0x5da8); //fixme: with delay!
+		playAnimation(851, 0);
+		playSound(24, 11);
+		playActorAnimation(931);
+		displayCredits(0xe42f);
+
+		playMusic(3);
+		loadScene(40, 50, 186, 1);
+		setOns(0, 113);
+		Dialog::show(scene, 0x78f1, 919, 0, 0xe7);
+		moveTo(196, 186, 1);
+		Dialog::show(scene, 0x7958, 919, 0, 0xe7);
+		playActorAnimation(932);
+		Dialog::show(scene, 0x7e07, 919, 0, 0xe7);
+		playActorAnimation(932);
+		Dialog::show(scene, 0x7e1a, 919, 0, 0xe7);
+		playActorAnimation(932);
+		Dialog::show(scene, 0x7e2c, 919, 0, 0xe7);
+		playActorAnimation(933);
+		Dialog::show(scene, 0x7e70, 919, 0, 0xe7);
+		moveTo(174, 186, 1);
+		playAnimation(851, 0, true);
+		playActorAnimation(934, true);
+		waitAnimation();
+		loadScene(10, 136, 153);
+		
+		return true;
+	
 	case 0x4021:
 		//pulling out mysterious object
 		if (CHECK_FLAG(0xdbe1, 1)) {

Modified: scummvm/trunk/engines/teenagent/dialog.cpp
===================================================================
--- scummvm/trunk/engines/teenagent/dialog.cpp	2009-09-13 10:32:55 UTC (rev 44048)
+++ scummvm/trunk/engines/teenagent/dialog.cpp	2009-09-13 10:50:29 UTC (rev 44049)
@@ -28,12 +28,12 @@
 
 namespace TeenAgent {
 
-void Dialog::show(Scene * scene, uint16 addr, uint16 animation, uint16 actor_animation) {
+void Dialog::show(Scene * scene, uint16 addr, uint16 animation, uint16 actor_animation, byte color1, byte color2) {
 	debug(0, "Dialog::show(%04x, %u)", addr, animation);
 	Resources * res = Resources::instance();
 	int n = 0;
 	Common::String message;
-	byte color = 0xd1;
+	byte color = color1;
 	
 	while (n < 4) {
 		byte c = res->eseg.get_byte(addr++);
@@ -41,7 +41,7 @@
 		case 0:
 			++n;
 			if (n == 3) {
-				color = color == 0xd1? 0xd0: 0xd1;
+				color = color == color1? color2: color1;
 				//debug(0, "changing color", message);
 			}
 			continue;
@@ -86,7 +86,7 @@
 		if (animation != 0) {
 			SceneEvent e(SceneEvent::PlayAnimation);
 			e.animation = animation;
-			e.color = 0x83; //3rd slot, async animation
+			e.color = 0x41;
 			scene->push(e);
 		} //copy paste ninja was here
 		SceneEvent e(SceneEvent::Message);
@@ -96,7 +96,7 @@
 	}
 }
 
-uint16 Dialog::pop(Scene *scene, uint16 addr, uint16 animation, uint16 actor_animation) {
+uint16 Dialog::pop(Scene *scene, uint16 addr, uint16 animation, uint16 actor_animation, byte color1, byte color2) {
 	debug(0, "Dialog::pop(%04x, %u)", addr, animation);
 	Resources * res = Resources::instance();
 	uint16 next;
@@ -107,7 +107,7 @@
 	uint16 next2 = res->dseg.get_word(addr);
 	if (next2 != 0xffff)
 		res->dseg.set_word(addr - 2, 0);
-	show(scene, next, animation, actor_animation);
+	show(scene, next, animation, actor_animation, color1, color2);
 	return next;
 }
 

Modified: scummvm/trunk/engines/teenagent/dialog.h
===================================================================
--- scummvm/trunk/engines/teenagent/dialog.h	2009-09-13 10:32:55 UTC (rev 44048)
+++ scummvm/trunk/engines/teenagent/dialog.h	2009-09-13 10:50:29 UTC (rev 44049)
@@ -33,8 +33,8 @@
 class Scene;
 class Dialog {
 public: 
-	static uint16 pop(Scene *scene, uint16 addr, uint16 animation = 0, uint16 actor_animation = 0);
-	static void show(Scene *scene, uint16 addr, uint16 animation = 0, uint16 actor_animation = 0);
+	static uint16 pop(Scene *scene, uint16 addr, uint16 animation = 0, uint16 actor_animation = 0, byte color1 = 0xd1, byte color2 = 0xd0);
+	static void show(Scene *scene, uint16 addr, uint16 animation = 0, uint16 actor_animation = 0, byte color1 = 0xd1, byte color2 = 0xd0);
 };
 
 } // End of namespace TeenAgent

Modified: scummvm/trunk/engines/teenagent/scene.cpp
===================================================================
--- scummvm/trunk/engines/teenagent/scene.cpp	2009-09-13 10:32:55 UTC (rev 44048)
+++ scummvm/trunk/engines/teenagent/scene.cpp	2009-09-13 10:50:29 UTC (rev 44049)
@@ -33,7 +33,7 @@
 
 namespace TeenAgent {
 
-Scene::Scene() : _engine(NULL), 
+Scene::Scene() : intro(false), _engine(NULL), 
 	_system(NULL), 
 	_id(0), ons(0), walkboxes(0), 
 	orientation(Object::ActorRight), 
@@ -257,11 +257,10 @@
 }
 
 bool Scene::processEvent(const Common::Event &event) {
-	if (!message.empty()) {
-		if (
-			event.type == Common::EVENT_LBUTTONDOWN ||
-			event.type == Common::EVENT_RBUTTONDOWN
-		) {
+	switch(event.type) {
+	case Common::EVENT_LBUTTONDOWN:
+	case Common::EVENT_RBUTTONDOWN: 
+		if (!message.empty()) {
 			message.clear();
 			for(int i = 0; i < 4; ++i) {
 				if (custom_animations[i].loop)
@@ -270,8 +269,23 @@
 			nextEvent();
 			return true;
 		}
+		return false;
+
+	case Common::EVENT_KEYUP:
+		if (intro && event.kbd.keycode == Common::KEYCODE_ESCAPE) {
+			intro = false;
+			message.clear();
+			events.clear();
+			sounds.clear();
+			current_event.clear();
+			_engine->playMusic(4);
+			init(10, Common::Point(136, 153));
+		}
+		return false;
+
+	default:
+		return false;
 	}
-	return false;
 }
 
 bool Scene::render(OSystem * system) {
@@ -287,7 +301,7 @@
 		return true;
 	}
 	
-	bool busy = false;
+	bool busy = processEventQueue();
 	
 	system->copyRectToScreen((const byte *)background.pixels, background.pitch, 0, 0, background.w, background.h);
 	
@@ -373,7 +387,6 @@
 		nextEvent();
 	}
 		
-	busy |= processEventQueue();
 	//if (!current_event.empty())
 	//	current_event.dump();
 	/*

Modified: scummvm/trunk/engines/teenagent/scene.h
===================================================================
--- scummvm/trunk/engines/teenagent/scene.h	2009-09-13 10:32:55 UTC (rev 44048)
+++ scummvm/trunk/engines/teenagent/scene.h	2009-09-13 10:50:29 UTC (rev 44049)
@@ -90,6 +90,8 @@
 
 class Scene {
 public: 
+	bool intro; 
+	
 	Scene();
 	
 	void init(TeenAgentEngine *engine, OSystem * system);

Modified: scummvm/trunk/engines/teenagent/teenagent.cpp
===================================================================
--- scummvm/trunk/engines/teenagent/teenagent.cpp	2009-09-13 10:32:55 UTC (rev 44048)
+++ scummvm/trunk/engines/teenagent/teenagent.cpp	2009-09-13 10:50:29 UTC (rev 44049)
@@ -211,19 +211,22 @@
 
 	_system->setMouseCursor(res->dseg.ptr(0x00da), 8, 12, 0, 0, 1);
 
-	scene->init(10, Common::Point(136, 153));
-	
 	syncSoundSettings();
 	
-	music->load(4);
+	music->load(1);
 	_mixer->playInputStream(Audio::Mixer::kMusicSoundType, &_musicHandle, music, -1, 255, 0, true, false);
 	music->start();
 	
 	{
 		int load_slot = Common::ConfigManager::instance().getInt("save_slot");
 		debug(0, "slot: %d", load_slot);
-		if (load_slot >= 0)
+		if (load_slot >= 0) {
 			loadGameState(load_slot);
+		} else {
+			scene->intro = true;
+			scene_busy = true;
+			processCallback(0x24c);
+		}
 	}
 
 	uint32 frame = 0;


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