From 32d84ed33d88e42bc521b3736b35bacdfa5c13e7 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 1 Mar 2016 08:07:05 -0500 Subject: TITANIC: Added lots more miscellaneous classes --- engines/titanic/game/phonograph.cpp | 58 +++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 engines/titanic/game/phonograph.cpp (limited to 'engines/titanic/game/phonograph.cpp') diff --git a/engines/titanic/game/phonograph.cpp b/engines/titanic/game/phonograph.cpp new file mode 100644 index 0000000000..3461e34cb6 --- /dev/null +++ b/engines/titanic/game/phonograph.cpp @@ -0,0 +1,58 @@ +/* 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/phonograph.h" + +namespace Titanic { + +CPhonograph::CPhonograph() : CMusicPlayer(), + _fieldE0(0), _fieldE4(0), _fieldE8(0), _fieldEC(0), + _fieldF0(0), _fieldF4(0) { +} + +void CPhonograph::save(SimpleFile *file, int indent) const { + file->writeNumberLine(1, indent); + file->writeQuotedLine(_string2, indent); + file->writeNumberLine(_fieldE0, indent); + file->writeNumberLine(_fieldE4, indent); + file->writeNumberLine(_fieldE8, indent); + file->writeNumberLine(_fieldEC, indent); + file->writeNumberLine(_fieldF0, indent); + file->writeNumberLine(_fieldF4, indent); + + CMusicPlayer::save(file, indent); +} + +void CPhonograph::load(SimpleFile *file) { + file->readNumber(); + _string2 = file->readString(); + _fieldE0 = file->readNumber(); + _fieldE4 = file->readNumber(); + _fieldE8 = file->readNumber(); + _fieldEC = file->readNumber(); + _fieldF0 = file->readNumber(); + _fieldF4 = file->readNumber(); + + CMusicPlayer::load(file); +} + +} // End of namespace Titanic -- cgit v1.2.3 From 12ae5e10f3a20b1b909a6ec40257e39e063b78c5 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 17 Mar 2016 20:55:32 -0400 Subject: TITANIC: Added stubbed CEnterRoomMsg event handlers as needed --- engines/titanic/game/phonograph.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'engines/titanic/game/phonograph.cpp') diff --git a/engines/titanic/game/phonograph.cpp b/engines/titanic/game/phonograph.cpp index 3461e34cb6..2ff8ca99bb 100644 --- a/engines/titanic/game/phonograph.cpp +++ b/engines/titanic/game/phonograph.cpp @@ -55,4 +55,9 @@ void CPhonograph::load(SimpleFile *file) { CMusicPlayer::load(file); } +bool CPhonograph::handleEvent(const CEnterRoomMsg &msg) { + warning("CPhonograph::handleEvent"); + return true; +} + } // End of namespace Titanic -- cgit v1.2.3 From 4f5202f958d55ccfda6e67a6b8933630de240e87 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 18 Mar 2016 23:18:59 -0400 Subject: TITANIC: Remove const prefix from passed messages Turns out that some of the messages have properties that the objects that handle them can set. For example, the CMouseDragStartMsg has a _dragItem property that an item that allows dragging will explicitly set, allowing the input handler to keep track of what was dragged. --- engines/titanic/game/phonograph.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/titanic/game/phonograph.cpp') diff --git a/engines/titanic/game/phonograph.cpp b/engines/titanic/game/phonograph.cpp index 2ff8ca99bb..f7a696e549 100644 --- a/engines/titanic/game/phonograph.cpp +++ b/engines/titanic/game/phonograph.cpp @@ -55,7 +55,7 @@ void CPhonograph::load(SimpleFile *file) { CMusicPlayer::load(file); } -bool CPhonograph::handleEvent(const CEnterRoomMsg &msg) { +bool CPhonograph::handleEvent(CEnterRoomMsg &msg) { warning("CPhonograph::handleEvent"); return true; } -- cgit v1.2.3 From 66e198d665a8aacd1724848a40e6533f3d5cfebc Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 24 Mar 2016 07:49:59 -0400 Subject: TITANIC: Cleanup and fixes for message hierarchy --- engines/titanic/game/phonograph.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/titanic/game/phonograph.cpp') diff --git a/engines/titanic/game/phonograph.cpp b/engines/titanic/game/phonograph.cpp index f7a696e549..749bf33b24 100644 --- a/engines/titanic/game/phonograph.cpp +++ b/engines/titanic/game/phonograph.cpp @@ -55,7 +55,7 @@ void CPhonograph::load(SimpleFile *file) { CMusicPlayer::load(file); } -bool CPhonograph::handleEvent(CEnterRoomMsg &msg) { +bool CPhonograph::handleMessage(CEnterRoomMsg &msg) { warning("CPhonograph::handleEvent"); return true; } -- cgit v1.2.3 From 9f1bab55972b8a6f88b83c2391c40a038ffb509d Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 7 Apr 2016 22:03:35 -0400 Subject: TITANIC: Converting other message stubs to new format --- engines/titanic/game/phonograph.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/titanic/game/phonograph.cpp') diff --git a/engines/titanic/game/phonograph.cpp b/engines/titanic/game/phonograph.cpp index 749bf33b24..f086376651 100644 --- a/engines/titanic/game/phonograph.cpp +++ b/engines/titanic/game/phonograph.cpp @@ -55,7 +55,7 @@ void CPhonograph::load(SimpleFile *file) { CMusicPlayer::load(file); } -bool CPhonograph::handleMessage(CEnterRoomMsg &msg) { +bool CPhonograph::EnterRoomMsg(CEnterRoomMsg *msg) { warning("CPhonograph::handleEvent"); return true; } -- cgit v1.2.3 From 5ccc0a66da38d23520234e7060efaf966d3345b9 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 29 Jun 2016 19:53:16 -0400 Subject: TITANIC: Removed const modifier from all saveable objects Turns out that CGameObject::save regenerates the _movieRangeInfo list. So the const suffix can no longer be used for the entire hierarchy --- engines/titanic/game/phonograph.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/titanic/game/phonograph.cpp') diff --git a/engines/titanic/game/phonograph.cpp b/engines/titanic/game/phonograph.cpp index f086376651..9740e29273 100644 --- a/engines/titanic/game/phonograph.cpp +++ b/engines/titanic/game/phonograph.cpp @@ -29,7 +29,7 @@ CPhonograph::CPhonograph() : CMusicPlayer(), _fieldF0(0), _fieldF4(0) { } -void CPhonograph::save(SimpleFile *file, int indent) const { +void CPhonograph::save(SimpleFile *file, int indent) { file->writeNumberLine(1, indent); file->writeQuotedLine(_string2, indent); file->writeNumberLine(_fieldE0, indent); -- cgit v1.2.3