From c5847f5b8093833edc5dc4c26bf239d462b9f2f1 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 26 Feb 2016 00:16:25 -0500 Subject: TITANIC: Start of new messages sub-folder --- engines/titanic/core/auto_sound_event.cpp | 46 ----------------- engines/titanic/core/auto_sound_event.h | 55 --------------------- engines/titanic/core/saveable_object.cpp | 9 ++++ engines/titanic/core/tree_item.cpp | 2 + engines/titanic/game/door_auto_sound_event.h | 2 +- engines/titanic/messages/auto_sound_event.cpp | 46 +++++++++++++++++ engines/titanic/messages/auto_sound_event.h | 55 +++++++++++++++++++++ engines/titanic/messages/door_auto_sound_event.cpp | 51 +++++++++++++++++++ engines/titanic/messages/door_auto_sound_event.h | 57 ++++++++++++++++++++++ engines/titanic/module.mk | 4 +- 10 files changed, 223 insertions(+), 104 deletions(-) delete mode 100644 engines/titanic/core/auto_sound_event.cpp delete mode 100644 engines/titanic/core/auto_sound_event.h create mode 100644 engines/titanic/messages/auto_sound_event.cpp create mode 100644 engines/titanic/messages/auto_sound_event.h create mode 100644 engines/titanic/messages/door_auto_sound_event.cpp create mode 100644 engines/titanic/messages/door_auto_sound_event.h (limited to 'engines') diff --git a/engines/titanic/core/auto_sound_event.cpp b/engines/titanic/core/auto_sound_event.cpp deleted file mode 100644 index 1bd5f5473a..0000000000 --- a/engines/titanic/core/auto_sound_event.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/* 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/core/auto_sound_event.h" - -namespace Titanic { - -CAutoSoundEvent::CAutoSoundEvent() : CGameObject(), _fieldBC(-1), _fieldC0(0xFFFFFF) { -} - -void CAutoSoundEvent::save(SimpleFile *file, int indent) const { - file->writeNumberLine(1, indent); - file->writeNumberLine(_fieldBC, indent); - file->writeNumberLine(_fieldC0, indent); - - CGameObject::save(file, indent); -} - -void CAutoSoundEvent::load(SimpleFile *file) { - file->readNumber(); - _fieldBC = file->readNumber(); - _fieldC0 = file->readNumber(); - - CGameObject::load(file); -} - -} // End of namespace Titanic diff --git a/engines/titanic/core/auto_sound_event.h b/engines/titanic/core/auto_sound_event.h deleted file mode 100644 index 4180a68aa2..0000000000 --- a/engines/titanic/core/auto_sound_event.h +++ /dev/null @@ -1,55 +0,0 @@ -/* 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_AUTO_SOUND_EVENT_H -#define TITANIC_AUTO_SOUND_EVENT_H - -#include "titanic/core/game_object.h" - -namespace Titanic { - -class CAutoSoundEvent : public CGameObject { -private: - int _fieldBC; - int _fieldC0; -public: - CAutoSoundEvent(); - - /** - * Return the class name - */ - virtual const char *getClassName() const { return "CAutoSoundEvent"; } - - /** - * Save the data for the class to file - */ - virtual void save(SimpleFile *file, int indent) const; - - /** - * Load the data for the class from file - */ - virtual void load(SimpleFile *file); -}; - -} // End of namespace Titanic - -#endif /* TITANIC_AUTO_SOUND_EVENT_H */ diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp index 080cdb6aa2..296ee6a9fe 100644 --- a/engines/titanic/core/saveable_object.cpp +++ b/engines/titanic/core/saveable_object.cpp @@ -38,6 +38,9 @@ #include "titanic/game/service_elevator_door.h" #include "titanic/game/sub_glass.h" +#include "titanic/messages/auto_sound_event.h" +#include "titanic/messages/door_auto_sound_event.h" + #include "titanic/moves/enter_bomb_room.h" #include "titanic/moves/exit_arboretum.h" #include "titanic/moves/exit_bridge.h" @@ -89,6 +92,9 @@ DEFFN(CRoomItem); DEFFN(CServiceElevatorDoor); DEFFN(CSUBGlass); +DEFFN(CAutoSoundEvent); +DEFFN(CDoorAutoSoundEvent); + DEFFN(CEnterBombRoom); DEFFN(CExitArboretum); DEFFN(CExitBridge); @@ -134,6 +140,9 @@ void CSaveableObject::initClassList() { ADDFN(CServiceElevatorDoor); ADDFN(CSUBGlass); + ADDFN(CAutoSoundEvent); + ADDFN(CDoorAutoSoundEvent); + ADDFN(CEnterBombRoom); ADDFN(CExitArboretum); ADDFN(CExitBridge); diff --git a/engines/titanic/core/tree_item.cpp b/engines/titanic/core/tree_item.cpp index d20e1da4f0..8c9080fd84 100644 --- a/engines/titanic/core/tree_item.cpp +++ b/engines/titanic/core/tree_item.cpp @@ -79,6 +79,8 @@ CDontSaveFileItem *CTreeItem::getDontSaveFileItem() { item = item->getNextSibling(); } + + return nullptr; } void CTreeItem::addUnder(CTreeItem *newParent) { diff --git a/engines/titanic/game/door_auto_sound_event.h b/engines/titanic/game/door_auto_sound_event.h index 66e9594b40..9bba304daa 100644 --- a/engines/titanic/game/door_auto_sound_event.h +++ b/engines/titanic/game/door_auto_sound_event.h @@ -23,7 +23,7 @@ #ifndef TITANIC_DOOR_AUTO_SOUND_EVENT_H #define TITANIC_DOOR_AUTO_SOUND_EVENT_H -#include "titanic/core/auto_sound_event.h" +#include "titanic/messages/auto_sound_event.h" namespace Titanic { diff --git a/engines/titanic/messages/auto_sound_event.cpp b/engines/titanic/messages/auto_sound_event.cpp new file mode 100644 index 0000000000..a9c8fc3dcd --- /dev/null +++ b/engines/titanic/messages/auto_sound_event.cpp @@ -0,0 +1,46 @@ +/* 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/messages/auto_sound_event.h" + +namespace Titanic { + +CAutoSoundEvent::CAutoSoundEvent() : CGameObject(), _fieldBC(-1), _fieldC0(0xFFFFFF) { +} + +void CAutoSoundEvent::save(SimpleFile *file, int indent) const { + file->writeNumberLine(1, indent); + file->writeNumberLine(_fieldBC, indent); + file->writeNumberLine(_fieldC0, indent); + + CGameObject::save(file, indent); +} + +void CAutoSoundEvent::load(SimpleFile *file) { + file->readNumber(); + _fieldBC = file->readNumber(); + _fieldC0 = file->readNumber(); + + CGameObject::load(file); +} + +} // End of namespace Titanic diff --git a/engines/titanic/messages/auto_sound_event.h b/engines/titanic/messages/auto_sound_event.h new file mode 100644 index 0000000000..f3a805c1e1 --- /dev/null +++ b/engines/titanic/messages/auto_sound_event.h @@ -0,0 +1,55 @@ +/* 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_AUTO_SOUND_EVENT_H +#define TITANIC_AUTO_SOUND_EVENT_H + +#include "titanic/core/game_object.h" + +namespace Titanic { + +class CAutoSoundEvent : public CGameObject { +protected: + int _fieldBC; + int _fieldC0; +public: + CAutoSoundEvent(); + + /** + * Return the class name + */ + virtual const char *getClassName() const { return "CAutoSoundEvent"; } + + /** + * Save the data for the class to file + */ + virtual void save(SimpleFile *file, int indent) const; + + /** + * Load the data for the class from file + */ + virtual void load(SimpleFile *file); +}; + +} // End of namespace Titanic + +#endif /* TITANIC_AUTO_SOUND_EVENT_H */ diff --git a/engines/titanic/messages/door_auto_sound_event.cpp b/engines/titanic/messages/door_auto_sound_event.cpp new file mode 100644 index 0000000000..69191a6576 --- /dev/null +++ b/engines/titanic/messages/door_auto_sound_event.cpp @@ -0,0 +1,51 @@ +/* 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/messages/door_auto_sound_event.h" + +namespace Titanic { + +CDoorAutoSoundEvent::CDoorAutoSoundEvent() : CAutoSoundEvent(), + _string1("z#44.wav"), _string2("z#43.wav"), _fieldDC(25), _fieldE0(25) { +} + +void CDoorAutoSoundEvent::save(SimpleFile *file, int indent) const { + file->writeNumberLine(1, indent); + file->writeQuotedLine(_string1, indent); + file->writeQuotedLine(_string2, indent); + file->writeNumberLine(_fieldDC, indent); + file->writeNumberLine(_fieldE0, indent); + + CAutoSoundEvent::save(file, indent); +} + +void CDoorAutoSoundEvent::load(SimpleFile *file) { + file->readNumber(); + _string1 = file->readString(); + _string2 = file->readString(); + _fieldDC = file->readNumber(); + _fieldE0 = file->readNumber(); + + CAutoSoundEvent::load(file); +} + +} // End of namespace Titanic diff --git a/engines/titanic/messages/door_auto_sound_event.h b/engines/titanic/messages/door_auto_sound_event.h new file mode 100644 index 0000000000..a231b2fa52 --- /dev/null +++ b/engines/titanic/messages/door_auto_sound_event.h @@ -0,0 +1,57 @@ +/* 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_DOOR_AUTO_SOUND_EVENT_H +#define TITANIC_DOOR_AUTO_SOUND_EVENT_H + +#include "titanic/messages/auto_sound_event.h" + +namespace Titanic { + +class CDoorAutoSoundEvent : public CAutoSoundEvent { +private: + CString _string1; + CString _string2; + int _fieldDC; + int _fieldE0; +public: + CDoorAutoSoundEvent(); + + /** + * Return the class name + */ + virtual const char *getClassName() const { return "CDoorAutoSoundEvent"; } + + /** + * Save the data for the class to file + */ + virtual void save(SimpleFile *file, int indent) const; + + /** + * Load the data for the class from file + */ + virtual void load(SimpleFile *file); +}; + +} // End of namespace Titanic + +#endif /* TITANIC_DOOR_AUTO_SOUND_EVENT_H */ diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk index dcfe38c2d5..c012fc2269 100644 --- a/engines/titanic/module.mk +++ b/engines/titanic/module.mk @@ -15,7 +15,6 @@ MODULE_OBJS := \ string.o \ titanic.o \ video_surface.o \ - core/auto_sound_event.o \ core/background.o \ core/dont_save_file_item.o \ core/file_item.o \ @@ -33,11 +32,12 @@ MODULE_OBJS := \ core/tree_item.o \ core/view_item.o \ game/announce.o \ - game/door_auto_sound_event.o \ game/pet_position.o \ game/room_item.o \ game/service_elevator_door.o \ game/sub_glass.o \ + messages/auto_sound_event.o \ + messages/door_auto_sound_event.o \ moves/enter_bomb_room.o \ moves/exit_arboretum.o \ moves/exit_bridge.o \ -- cgit v1.2.3