From decec97c4b7611c56135cf222544afa9f043c894 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 28 Feb 2016 10:57:45 -0500 Subject: TITANIC: Implement various parrot classes --- .../titanic/game/parrot/parrot_lobby_object.cpp | 59 ++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 engines/titanic/game/parrot/parrot_lobby_object.cpp (limited to 'engines/titanic/game/parrot/parrot_lobby_object.cpp') diff --git a/engines/titanic/game/parrot/parrot_lobby_object.cpp b/engines/titanic/game/parrot/parrot_lobby_object.cpp new file mode 100644 index 0000000000..137f3e2ff9 --- /dev/null +++ b/engines/titanic/game/parrot/parrot_lobby_object.cpp @@ -0,0 +1,59 @@ +/* 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/parrot/parrot_lobby_object.h" + +namespace Titanic { + +int CParrotLobbyObject::_v1; +int CParrotLobbyObject::_v2; +int CParrotLobbyObject::_v3; +int CParrotLobbyObject::_v4; + +void CParrotLobbyObject::init() { + _v1 = 1; + _v2 = 1; + _v3 = 1; + _v4 = 7; +} + +void CParrotLobbyObject::save(SimpleFile *file, int indent) const { + file->writeNumberLine(1, indent); + file->writeNumberLine(_v1, indent); + file->writeNumberLine(_v2, indent); + file->writeNumberLine(_v3, indent); + file->writeNumberLine(_v4, indent); + + CGameObject::save(file, indent); +} + +void CParrotLobbyObject::load(SimpleFile *file) { + file->readNumber(); + _v1 = file->readNumber(); + _v2 = file->readNumber(); + _v3 = file->readNumber(); + _v4 = file->readNumber(); + + CGameObject::load(file); +} + +} // End of namespace Titanic -- cgit v1.2.3 From 5c2a39e74ac1cf8b67e17fe25e00bcca487c9f99 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 28 Jun 2016 21:18:13 -0400 Subject: TITANIC: Set up empty message targets for classes without messages --- engines/titanic/game/parrot/parrot_lobby_object.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'engines/titanic/game/parrot/parrot_lobby_object.cpp') diff --git a/engines/titanic/game/parrot/parrot_lobby_object.cpp b/engines/titanic/game/parrot/parrot_lobby_object.cpp index 137f3e2ff9..8090a1d46c 100644 --- a/engines/titanic/game/parrot/parrot_lobby_object.cpp +++ b/engines/titanic/game/parrot/parrot_lobby_object.cpp @@ -24,6 +24,8 @@ namespace Titanic { +EMPTY_MESSAGE_MAP(CParrotLobbyObject, CGameObject) + int CParrotLobbyObject::_v1; int CParrotLobbyObject::_v2; int CParrotLobbyObject::_v3; -- 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/parrot/parrot_lobby_object.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/titanic/game/parrot/parrot_lobby_object.cpp') diff --git a/engines/titanic/game/parrot/parrot_lobby_object.cpp b/engines/titanic/game/parrot/parrot_lobby_object.cpp index 8090a1d46c..9d556b5b91 100644 --- a/engines/titanic/game/parrot/parrot_lobby_object.cpp +++ b/engines/titanic/game/parrot/parrot_lobby_object.cpp @@ -38,7 +38,7 @@ void CParrotLobbyObject::init() { _v4 = 7; } -void CParrotLobbyObject::save(SimpleFile *file, int indent) const { +void CParrotLobbyObject::save(SimpleFile *file, int indent) { file->writeNumberLine(1, indent); file->writeNumberLine(_v1, indent); file->writeNumberLine(_v2, indent); -- cgit v1.2.3 From eb98b984fb5a630422013ab5f030d49b0aa39552 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 24 Jul 2016 20:11:49 -0400 Subject: TITANIC: Add semicolon after EMPTY_MESSAGE_MAP macro usages --- engines/titanic/game/parrot/parrot_lobby_object.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/titanic/game/parrot/parrot_lobby_object.cpp') diff --git a/engines/titanic/game/parrot/parrot_lobby_object.cpp b/engines/titanic/game/parrot/parrot_lobby_object.cpp index 9d556b5b91..a78ab2b6d9 100644 --- a/engines/titanic/game/parrot/parrot_lobby_object.cpp +++ b/engines/titanic/game/parrot/parrot_lobby_object.cpp @@ -24,7 +24,7 @@ namespace Titanic { -EMPTY_MESSAGE_MAP(CParrotLobbyObject, CGameObject) +EMPTY_MESSAGE_MAP(CParrotLobbyObject, CGameObject); int CParrotLobbyObject::_v1; int CParrotLobbyObject::_v2; -- cgit v1.2.3 From 02f679180425f7f2b95236ffeaa67805d2a30e7a Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 26 Aug 2016 21:18:26 -0400 Subject: TITANIC: Implemented parrot lobby classes --- .../titanic/game/parrot/parrot_lobby_object.cpp | 32 +++++++++++----------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'engines/titanic/game/parrot/parrot_lobby_object.cpp') diff --git a/engines/titanic/game/parrot/parrot_lobby_object.cpp b/engines/titanic/game/parrot/parrot_lobby_object.cpp index a78ab2b6d9..06222fd063 100644 --- a/engines/titanic/game/parrot/parrot_lobby_object.cpp +++ b/engines/titanic/game/parrot/parrot_lobby_object.cpp @@ -26,34 +26,34 @@ namespace Titanic { EMPTY_MESSAGE_MAP(CParrotLobbyObject, CGameObject); -int CParrotLobbyObject::_v1; -int CParrotLobbyObject::_v2; -int CParrotLobbyObject::_v3; -int CParrotLobbyObject::_v4; +bool CParrotLobbyObject::_haveParrot; +bool CParrotLobbyObject::_havePerch; +bool CParrotLobbyObject::_haveStick; +int CParrotLobbyObject::_flags; void CParrotLobbyObject::init() { - _v1 = 1; - _v2 = 1; - _v3 = 1; - _v4 = 7; + _haveParrot = true; + _havePerch = true; + _haveStick = true; + _flags = 7; } void CParrotLobbyObject::save(SimpleFile *file, int indent) { file->writeNumberLine(1, indent); - file->writeNumberLine(_v1, indent); - file->writeNumberLine(_v2, indent); - file->writeNumberLine(_v3, indent); - file->writeNumberLine(_v4, indent); + file->writeNumberLine(_haveParrot, indent); + file->writeNumberLine(_havePerch, indent); + file->writeNumberLine(_haveStick, indent); + file->writeNumberLine(_flags, indent); CGameObject::save(file, indent); } void CParrotLobbyObject::load(SimpleFile *file) { file->readNumber(); - _v1 = file->readNumber(); - _v2 = file->readNumber(); - _v3 = file->readNumber(); - _v4 = file->readNumber(); + _haveParrot = file->readNumber(); + _havePerch = file->readNumber(); + _haveStick = file->readNumber(); + _flags = file->readNumber(); CGameObject::load(file); } -- cgit v1.2.3