[Scummvm-cvs-logs] scummvm master -> fde400c33267fcb7b48ba1508e6191008a1de4de

dreammaster dreammaster at scummvm.org
Fri Aug 26 04:55:39 CEST 2016


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:
fde400c332 TITANIC: Implemented nav helmet classes


Commit: fde400c33267fcb7b48ba1508e6191008a1de4de
    https://github.com/scummvm/scummvm/commit/fde400c33267fcb7b48ba1508e6191008a1de4de
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-08-25T22:55:34-04:00

Commit Message:
TITANIC: Implemented nav helmet classes

Changed paths:
  A engines/titanic/game/nav_helmet_off.cpp
  A engines/titanic/game/nav_helmet_off.h
  A engines/titanic/game/nav_helmet_on.cpp
  A engines/titanic/game/nav_helmet_on.h
    engines/titanic/carry/napkin.cpp
    engines/titanic/game/nav_helmet.cpp
    engines/titanic/game/nav_helmet.h
    engines/titanic/module.mk



diff --git a/engines/titanic/carry/napkin.cpp b/engines/titanic/carry/napkin.cpp
index ace5a38..d25e8b5 100644
--- a/engines/titanic/carry/napkin.cpp
+++ b/engines/titanic/carry/napkin.cpp
@@ -57,5 +57,4 @@ bool CNapkin::UseWithOtherMsg(CUseWithOtherMsg *msg) {
 	return CCarry::UseWithOtherMsg(msg);
 }
 
-
 } // End of namespace Titanic
diff --git a/engines/titanic/game/nav_helmet.cpp b/engines/titanic/game/nav_helmet.cpp
index 770eb73..08ff073 100644
--- a/engines/titanic/game/nav_helmet.cpp
+++ b/engines/titanic/game/nav_helmet.cpp
@@ -21,19 +21,114 @@
  */
 
 #include "titanic/game/nav_helmet.h"
+#include "titanic/pet_control/pet_control.h"
 
 namespace Titanic {
 
+BEGIN_MESSAGE_MAP(CNavHelmet, CGameObject)
+	ON_MESSAGE(MovieEndMsg)
+	ON_MESSAGE(EnterViewMsg)
+	ON_MESSAGE(LeaveViewMsg)
+	ON_MESSAGE(PETHelmetOnOffMsg)
+	ON_MESSAGE(PETPhotoOnOffMsg)
+	ON_MESSAGE(PETStarFieldLockMsg)
+	ON_MESSAGE(PETSetStarDestinationMsg)
+END_MESSAGE_MAP()
+
 void CNavHelmet::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
-	file->writeNumberLine(_value, indent);
+	file->writeNumberLine(_flag, indent);
 	CGameObject::save(file, indent);
 }
 
 void CNavHelmet::load(SimpleFile *file) {
 	file->readNumber();
-	_value = file->readNumber();
+	_flag = file->readNumber();
 	CGameObject::load(file);
 }
 
+bool CNavHelmet::MovieEndMsg(CMovieEndMsg *msg) {
+	if (_flag) {
+		setVisible(false);
+
+		CPetControl *pet = getPetControl();
+		if (pet) {
+			pet->setArea(PET_STARFIELD);
+			petDisplayMessage(1, "Now would be an excellent opportunity to adjust your viewing apparatus.");
+			pet->incAreaLocks();
+		}
+
+		starFn1(0);
+		starFn1(12);
+	}
+
+	return true;
+}
+
+bool CNavHelmet::EnterViewMsg(CEnterViewMsg *msg) {
+	petSetRemoteTarget();
+	return true;
+}
+
+bool CNavHelmet::LeaveViewMsg(CLeaveViewMsg *msg) {
+	petClear();
+	return true;
+}
+
+bool CNavHelmet::PETHelmetOnOffMsg(CPETHelmetOnOffMsg *msg) {
+	CPetControl *pet = getPetControl();
+
+	if (_flag) {
+		_flag = false;
+		setVisible(true);
+		starFn1(1);
+		playMovie(61, 120, MOVIE_NOTIFY_OBJECT);
+		playSound("a#47.wav");
+		playSound("a#48.wav");
+
+		if (pet) {
+			pet->decAreaLocks();
+			pet->setArea(PET_REMOTE);
+		}
+
+		dec54();
+	} else {
+		inc54();
+		_flag = true;
+		setVisible(true);
+		playMovie(0, 60, MOVIE_NOTIFY_OBJECT);
+		playSound("a#48.wav");
+		playSound("a#47.wav");
+	}
+	
+	return true;
+}
+
+bool CNavHelmet::PETPhotoOnOffMsg(CPETPhotoOnOffMsg *msg) {
+	if (_flag)
+		starFn1(9);
+
+	return true;
+}
+
+bool CNavHelmet::PETStarFieldLockMsg(CPETStarFieldLockMsg *msg) {
+	if (_flag) {
+		if (msg->_value) {
+			playSound("a#6.wav");
+			starFn1(17);
+		} else {
+			playSound("a#5.wav");
+			starFn1(18);
+		}
+	}
+
+	return true;
+}
+
+bool CNavHelmet::PETSetStarDestinationMsg(CPETSetStarDestinationMsg *msg) {
+	CActMsg actMsg("SetDestin");
+	actMsg.execute("CaptainsWheel");
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/game/nav_helmet.h b/engines/titanic/game/nav_helmet.h
index 74caa52..c408d05 100644
--- a/engines/titanic/game/nav_helmet.h
+++ b/engines/titanic/game/nav_helmet.h
@@ -24,15 +24,24 @@
 #define TITANIC_NAV_HELMET_H
 
 #include "titanic/core/game_object.h"
+#include "titanic/messages/pet_messages.h"
 
 namespace Titanic {
 
 class CNavHelmet : public CGameObject {
+	DECLARE_MESSAGE_MAP;
+	bool MovieEndMsg(CMovieEndMsg *msg);
+	bool EnterViewMsg(CEnterViewMsg *msg);
+	bool LeaveViewMsg(CLeaveViewMsg *msg);
+	bool PETHelmetOnOffMsg(CPETHelmetOnOffMsg *msg);
+	bool PETPhotoOnOffMsg(CPETPhotoOnOffMsg *msg);
+	bool PETStarFieldLockMsg(CPETStarFieldLockMsg *msg);
+	bool PETSetStarDestinationMsg(CPETSetStarDestinationMsg *msg);
 private:
-	int _value;
+	bool _flag;
 public:
 	CLASSDEF;
-	CNavHelmet() : CGameObject(), _value(0) {}
+	CNavHelmet() : CGameObject(), _flag(false) {}
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/nav_helmet_off.cpp b/engines/titanic/game/nav_helmet_off.cpp
new file mode 100644
index 0000000..289e9e3
--- /dev/null
+++ b/engines/titanic/game/nav_helmet_off.cpp
@@ -0,0 +1,49 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/nav_helmet_off.h"
+#include "titanic/pet_control/pet_control.h"
+#include "titanic/messages/pet_messages.h"
+
+namespace Titanic {
+
+BEGIN_MESSAGE_MAP(CNavHelmetOff, CNavHelmet)
+	ON_MESSAGE(MouseButtonUpMsg)
+END_MESSAGE_MAP()
+
+void CNavHelmetOff::save(SimpleFile *file, int indent) {
+	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(_target, indent);
+}
+
+void CNavHelmetOff::load(SimpleFile *file) {
+	file->readNumber();
+	_target = file->readString();
+}
+
+bool CNavHelmetOff::MouseButtonUpMsg(CMouseButtonUpMsg *msg) {
+	CDoffNavHelmet doffMsg;
+	doffMsg.execute(_target);
+	return true;
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/nav_helmet_off.h b/engines/titanic/game/nav_helmet_off.h
new file mode 100644
index 0000000..c9529fe
--- /dev/null
+++ b/engines/titanic/game/nav_helmet_off.h
@@ -0,0 +1,53 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_NAV_HELMET_OFF_H
+#define TITANIC_NAV_HELMET_OFF_H
+
+#include "titanic/game/nav_helmet.h"
+#include "titanic/messages/pet_messages.h"
+
+namespace Titanic {
+
+class CNavHelmetOff : public CNavHelmet {
+	DECLARE_MESSAGE_MAP;
+	bool MouseButtonUpMsg(CMouseButtonUpMsg *msg);
+private:
+	CString _target;
+public:
+	CLASSDEF;
+	CNavHelmetOff() : CNavHelmet(), _target("NULL") {}
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent);
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_NAV_HELMET_OFF_H */
diff --git a/engines/titanic/game/nav_helmet_on.cpp b/engines/titanic/game/nav_helmet_on.cpp
new file mode 100644
index 0000000..59ceebc
--- /dev/null
+++ b/engines/titanic/game/nav_helmet_on.cpp
@@ -0,0 +1,49 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/nav_helmet_on.h"
+#include "titanic/pet_control/pet_control.h"
+#include "titanic/messages/pet_messages.h"
+
+namespace Titanic {
+
+BEGIN_MESSAGE_MAP(CNavHelmetOn, CNavHelmet)
+	ON_MESSAGE(MouseButtonUpMsg)
+END_MESSAGE_MAP()
+
+void CNavHelmetOn::save(SimpleFile *file, int indent) {
+	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(_target, indent);
+}
+
+void CNavHelmetOn::load(SimpleFile *file) {
+	file->readNumber();
+	_target = file->readString();
+}
+
+bool CNavHelmetOn::MouseButtonUpMsg(CMouseButtonUpMsg *msg) {
+	CDonNavHelmet donMsg;
+	donMsg.execute(_target);
+	return true;
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/nav_helmet_on.h b/engines/titanic/game/nav_helmet_on.h
new file mode 100644
index 0000000..452637c
--- /dev/null
+++ b/engines/titanic/game/nav_helmet_on.h
@@ -0,0 +1,53 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_NAV_HELMET_ON_H
+#define TITANIC_NAV_HELMET_ON_H
+
+#include "titanic/game/nav_helmet.h"
+#include "titanic/messages/pet_messages.h"
+
+namespace Titanic {
+
+class CNavHelmetOn : public CNavHelmet {
+	DECLARE_MESSAGE_MAP;
+	bool MouseButtonUpMsg(CMouseButtonUpMsg *msg);
+private:
+	CString _target;
+public:
+	CLASSDEF;
+	CNavHelmetOn() : CNavHelmet(), _target("NULL") {}
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent);
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_NAV_HELMET_ON_H */
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 924adb6..2182f58 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -157,6 +157,8 @@ MODULE_OBJS := \
 	game/music_system_lock.o \
 	game/musical_instrument.o \
 	game/nav_helmet.o \
+	game/nav_helmet_off.o \
+	game/nav_helmet_on.o \
 	game/navigation_computer.o \
 	game/no_nut_bowl.o \
 	game/nose_holder.o \






More information about the Scummvm-git-logs mailing list