diff options
-rw-r--r-- | engines/titanic/core/saveable_object.cpp | 9 | ||||
-rw-r--r-- | engines/titanic/core/tree_item.cpp | 2 | ||||
-rw-r--r-- | engines/titanic/game/door_auto_sound_event.h | 2 | ||||
-rw-r--r-- | engines/titanic/messages/auto_sound_event.cpp (renamed from engines/titanic/core/auto_sound_event.cpp) | 2 | ||||
-rw-r--r-- | engines/titanic/messages/auto_sound_event.h (renamed from engines/titanic/core/auto_sound_event.h) | 2 | ||||
-rw-r--r-- | engines/titanic/messages/door_auto_sound_event.cpp | 51 | ||||
-rw-r--r-- | engines/titanic/messages/door_auto_sound_event.h | 57 | ||||
-rw-r--r-- | engines/titanic/module.mk | 4 |
8 files changed, 124 insertions, 5 deletions
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/core/auto_sound_event.cpp b/engines/titanic/messages/auto_sound_event.cpp index 1bd5f5473a..a9c8fc3dcd 100644 --- a/engines/titanic/core/auto_sound_event.cpp +++ b/engines/titanic/messages/auto_sound_event.cpp @@ -20,7 +20,7 @@ * */ -#include "titanic/core/auto_sound_event.h" +#include "titanic/messages/auto_sound_event.h" namespace Titanic { diff --git a/engines/titanic/core/auto_sound_event.h b/engines/titanic/messages/auto_sound_event.h index 4180a68aa2..f3a805c1e1 100644 --- a/engines/titanic/core/auto_sound_event.h +++ b/engines/titanic/messages/auto_sound_event.h @@ -28,7 +28,7 @@ namespace Titanic { class CAutoSoundEvent : public CGameObject { -private: +protected: int _fieldBC; int _fieldC0; public: 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 \ |