[Scummvm-cvs-logs] scummvm master -> 9a40cd8fd784bbb52186f8dc14bbea8198e1a239

Strangerke Strangerke at scummvm.org
Mon Dec 19 23:16:12 CET 2011


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
9a40cd8fd7 TSAGE: R2R - Implement scene 3125


Commit: 9a40cd8fd784bbb52186f8dc14bbea8198e1a239
    https://github.com/scummvm/scummvm/commit/9a40cd8fd784bbb52186f8dc14bbea8198e1a239
Author: Strangerke (strangerke at scummvm.org)
Date: 2011-12-19T14:15:42-08:00

Commit Message:
TSAGE: R2R - Implement scene 3125

Changed paths:
    engines/tsage/ringworld2/ringworld2_logic.cpp
    engines/tsage/ringworld2/ringworld2_scenes3.cpp
    engines/tsage/ringworld2/ringworld2_scenes3.h



diff --git a/engines/tsage/ringworld2/ringworld2_logic.cpp b/engines/tsage/ringworld2/ringworld2_logic.cpp
index 42f3b16..e5a3919 100644
--- a/engines/tsage/ringworld2/ringworld2_logic.cpp
+++ b/engines/tsage/ringworld2/ringworld2_logic.cpp
@@ -175,6 +175,8 @@ Scene *Ringworld2Game::createScene(int sceneNumber) {
 	case 3100:
 		return new Scene3100();
 	case 3125:
+		// Ghouls dormitory
+		return new Scene3125();
 	case 3150:
 	case 3175:
 	case 3200:
diff --git a/engines/tsage/ringworld2/ringworld2_scenes3.cpp b/engines/tsage/ringworld2/ringworld2_scenes3.cpp
index 22e58b6..488fda5 100644
--- a/engines/tsage/ringworld2/ringworld2_scenes3.cpp
+++ b/engines/tsage/ringworld2/ringworld2_scenes3.cpp
@@ -202,5 +202,174 @@ void Scene3100::dispatch() {
 	Scene::dispatch();
 }
 
+/*--------------------------------------------------------------------------
+ * Scene 3125 - Ghouls dormitory
+ *
+ *--------------------------------------------------------------------------*/
+Scene3125::Scene3125() {
+	_field412 = 0;
+}
+
+void Scene3125::synchronize(Serializer &s) {
+	SceneExt::synchronize(s);
+
+	s.syncAsSint16LE(_field412);
+}
+
+bool Scene3125::Item1::startAction(CursorType action, Event &event) {
+	Scene3125 *scene = (Scene3125 *)R2_GLOBALS._sceneManager._scene;
+
+	switch (action) {
+	case CURSOR_USE:
+		if (_useLineNum != -1)
+			SceneItem::display(_resNum, _useLineNum, 0, 280, 1, 160, 9, 1, 2, 20, 7, 154, -999);
+		break;
+	case CURSOR_LOOK:
+		if (_lookLineNum != -1)
+			SceneItem::display(_resNum, _lookLineNum, 0, 280, 1, 160, 9, 1, 2, 20, 7, 154, -999);
+		break;
+	case CURSOR_TALK:
+		if (_talkLineNum != -1)
+			SceneItem::display(_resNum, _talkLineNum, 0, 280, 1, 160, 9, 1, 2, 20, 7, 154, -999);
+		break;
+	default:
+		warning("scene->display() called with two parameters");
+		return scene->display(action);
+		break;
+	}
+
+	return true;
+}
+
+bool Scene3125::Item2::startAction(CursorType action, Event &event) {
+	Scene3125 *scene = (Scene3125 *)R2_GLOBALS._sceneManager._scene;
+
+	switch (action) {
+	case CURSOR_USE:
+		R2_GLOBALS._player.disableControl();
+		scene->_sceneMode = 3125;
+		scene->setAction(&scene->_sequenceManager1, scene, 3125, &R2_GLOBALS._player, NULL);
+		break;
+	case CURSOR_LOOK:
+		SceneItem::display(3125, 15, 0, 280, 1, 160, 9, 1, 2, 20, 7, 154, -999);
+		break;
+	case CURSOR_TALK:
+		SceneItem::display(3125, 13, 0, 280, 1, 160, 9, 1, 2, 20, 7, 154, -999);
+		break;
+	default:
+		return SceneHotspot::startAction(action, event);
+		break;
+	}
+
+	return true;
+}
+
+bool Scene3125::Item3::startAction(CursorType action, Event &event) {
+	Scene3125 *scene = (Scene3125 *)R2_GLOBALS._sceneManager._scene;
+
+	switch (action) {
+	case CURSOR_USE:
+		R2_GLOBALS._player.disableControl();
+		scene->_actor5.postInit();
+		scene->_sceneMode = 3126;
+		scene->setAction(&scene->_sequenceManager1, scene, 3126, &R2_GLOBALS._player, &scene->_actor2, &scene->_actor3, &scene->_actor4, &scene->_actor1, &scene->_actor5, NULL);
+		break;
+	case CURSOR_LOOK:
+		SceneItem::display(3125, 9, 0, 280, 1, 160, 9, 1, 2, 20, 7, 154, -999);
+		break;
+	case CURSOR_TALK:
+		SceneItem::display(3125, 13, 0, 280, 1, 160, 9, 1, 2, 20, 7, 154, -999);
+		break;
+	default:
+		return SceneHotspot::startAction(action, event);
+		break;
+	}
+
+	return true;
+}
+
+bool Scene3125::Actor1::startAction(CursorType action, Event &event) {
+	Scene3125 *scene = (Scene3125 *)R2_GLOBALS._sceneManager._scene;
+
+	if (action != CURSOR_USE)
+		return SceneActor::startAction(action, event);
+
+	R2_GLOBALS._player.disableControl();
+	scene->_sceneMode = 3176;
+	scene->setAction(&scene->_sequenceManager1, scene, 3176, &R2_GLOBALS._player, &scene->_actor1, NULL);
+	return true;
+}
+
+void Scene3125::postInit(SceneObjectList *OwnerList) {
+	loadScene(3125);
+	SceneExt::postInit();
+	_field412 = 0;
+
+	_actor1.postInit();
+	_actor1.setup(3175, 1, 1);
+	_actor1.setPosition(Common::Point(35, 72));
+	_actor1.setDetails(3125, 12, 13, -1, 1, NULL);
+
+	_actor2.postInit();
+	_actor2.setup(3126, 4, 1);
+	_actor2.setPosition(Common::Point(71, 110));
+	_actor2._numFrames = 20;
+
+	_actor3.postInit();
+	_actor3.setup(3126, 1, 1);
+	_actor3.setPosition(Common::Point(215, 62));
+	_actor3.fixPriority(71);
+
+	_actor4.postInit();
+	_actor4.setup(3126, 1, 1);
+	_actor4.setPosition(Common::Point(171, 160));
+	_actor4.fixPriority(201);
+	
+	_item3.setDetails(12, 3125, 9, 13, -1);
+	_item2.setDetails(11, 3125, 15, 13, -1);
+	_item1.setDetails(Rect(0, 0, 320, 200), 3125, 0, 1, 2, 1, NULL);
+
+	R2_GLOBALS._sound1.play(262);
+	R2_GLOBALS._player.postInit();
+
+	if (R2_GLOBALS._player._oldCharacterScene[3] == 3250) {
+		_sceneMode = 3175;
+		setAction(&_sequenceManager1, this, 3175, &R2_GLOBALS._player, &_actor1, NULL);
+	} else {
+		R2_GLOBALS._player.setup(30, 5, 1);
+		R2_GLOBALS._player.animate(ANIM_MODE_1, NULL);
+		R2_GLOBALS._player.setPosition(Common::Point(89, 76));
+		R2_GLOBALS._player.enableControl();
+	}
+	R2_GLOBALS._player._oldCharacterScene[3] = 3125;
+}
+
+void Scene3125::signal() {
+	switch (_sceneMode) {
+	case 3125:
+		SceneItem::display(3125, 3, 0, 280, 1, 160, 9, 1, 2, 20, 7, 154, -999);
+		_sceneMode = 3127;
+		setAction(&_sequenceManager1, this, 3127, &R2_GLOBALS._player, NULL);
+		break;
+	case 3126:
+		R2_GLOBALS.setFlag(79);
+	// No break on purpose
+	case 3176:
+		R2_GLOBALS._sceneManager.changeScene(3250);
+		break;
+	default:
+		R2_GLOBALS._player.enableControl();
+		break;
+	}
+}
+
+void Scene3125::dispatch() {
+	if ((_sceneMode == 3126) && (_actor2._frame == 2) && (_field412 == 0)) {
+		_field412 = 1;
+		R2_GLOBALS._sound1.play(265);
+	}
+	Scene::dispatch();
+}
+
 } // End of namespace Ringworld2
 } // End of namespace TsAGE
diff --git a/engines/tsage/ringworld2/ringworld2_scenes3.h b/engines/tsage/ringworld2/ringworld2_scenes3.h
index fe00e2c..b135ddc 100644
--- a/engines/tsage/ringworld2/ringworld2_scenes3.h
+++ b/engines/tsage/ringworld2/ringworld2_scenes3.h
@@ -67,6 +67,44 @@ public:
 	virtual void synchronize(Serializer &s);
 };
 
+class Scene3125 : public SceneExt {
+	class Item1 : public NamedHotspot {
+	public:
+		virtual bool startAction(CursorType action, Event &event);
+	};
+	class Item2 : public Item1 {
+	public:
+		virtual bool startAction(CursorType action, Event &event);
+	};
+	class Item3 : public Item1 {
+	public:
+		virtual bool startAction(CursorType action, Event &event);
+	};
+
+	class Actor1 : public SceneActor {
+		virtual bool startAction(CursorType action, Event &event);
+	};
+public:
+
+	int _field412;
+	Item1 _item1;
+	Actor1 _actor1;
+	Item2 _item2;
+	Item3 _item3;
+	SceneActor _actor2;
+	SceneActor _actor3;
+	SceneActor _actor4;
+	SceneActor _actor5;
+	SequenceManager _sequenceManager1;
+	// Second sequence manager... Unused?
+	SequenceManager _sequenceManager2;
+
+	Scene3125();
+	virtual void postInit(SceneObjectList *OwnerList = NULL);
+	virtual void signal();
+	virtual void dispatch();
+	virtual void synchronize(Serializer &s);
+};
 } // End of namespace Ringworld2
 } // End of namespace TsAGE
 






More information about the Scummvm-git-logs mailing list