diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/titanic/module.mk | 5 | ||||
-rw-r--r-- | engines/titanic/objects/saveable_object.cpp | 10 | ||||
-rw-r--r-- | engines/titanic/rooms/announce.cpp | 50 | ||||
-rw-r--r-- | engines/titanic/rooms/announce.h | 57 | ||||
-rw-r--r-- | engines/titanic/rooms/pet_position.cpp | 37 | ||||
-rw-r--r-- | engines/titanic/rooms/pet_position.h | 50 | ||||
-rw-r--r-- | engines/titanic/rooms/sub_glass.cpp | 54 | ||||
-rw-r--r-- | engines/titanic/rooms/sub_glass.h | 59 |
8 files changed, 321 insertions, 1 deletions
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk index 1120f699b0..e74e8114f4 100644 --- a/engines/titanic/module.mk +++ b/engines/titanic/module.mk @@ -31,9 +31,12 @@ MODULE_OBJS := \ objects/saveable_object.o \ objects/tree_item.o \ objects/view_item.o \ + rooms/announce.o \ rooms/door_auto_sound_event.o \ + rooms/pet_position.o \ rooms/room_item.o \ - rooms/service_elevator_door.o + rooms/service_elevator_door.o \ + rooms/sub_glass.o # This module can be built as a plugin ifeq ($(ENABLE_TITANIC), DYNAMIC_PLUGIN) diff --git a/engines/titanic/objects/saveable_object.cpp b/engines/titanic/objects/saveable_object.cpp index b6611680ed..73980d159b 100644 --- a/engines/titanic/objects/saveable_object.cpp +++ b/engines/titanic/objects/saveable_object.cpp @@ -28,10 +28,14 @@ #include "titanic/objects/movie_clip.h" #include "titanic/objects/node_item.h" #include "titanic/objects/project_item.h" +#include "titanic/objects/saveable_object.h" #include "titanic/objects/tree_item.h" #include "titanic/objects/view_item.h" +#include "titanic/rooms/announce.h" +#include "titanic/rooms/pet_position.h" #include "titanic/rooms/room_item.h" #include "titanic/rooms/service_elevator_door.h" +#include "titanic/rooms/sub_glass.h" namespace Titanic { @@ -41,6 +45,7 @@ Common::HashMap<Common::String, CSaveableObject::CreateFunction> * #define DEFFN(T) CSaveableObject *Function##T() { return new T(); } #define ADDFN(T) (*_classList)[#T] = Function##T +DEFFN(CAnnounce); DEFFN(CFileItem); DEFFN(CFileListItem); DEFFN(CLinkItem); @@ -48,14 +53,17 @@ DEFFN(CMessageTarget); DEFFN(CMovieClip); DEFFN(CMovieClipList); DEFFN(CNodeItem); +DEFFN(CPETPosition); DEFFN(CProjectItem); DEFFN(CRoomItem); DEFFN(CServiceElevatorDoor); +DEFFN(CSUBGlass); DEFFN(CTreeItem); DEFFN(CViewItem); void CSaveableObject::initClassList() { _classList = new Common::HashMap<Common::String, CreateFunction>(); + ADDFN(CAnnounce); ADDFN(CFileItem); ADDFN(CFileListItem); ADDFN(CLinkItem); @@ -63,9 +71,11 @@ void CSaveableObject::initClassList() { ADDFN(CMovieClip); ADDFN(CMovieClipList); ADDFN(CNodeItem); + ADDFN(CPETPosition); ADDFN(CProjectItem); ADDFN(CRoomItem); ADDFN(CServiceElevatorDoor); + ADDFN(CSUBGlass); ADDFN(CTreeItem); ADDFN(CViewItem); } diff --git a/engines/titanic/rooms/announce.cpp b/engines/titanic/rooms/announce.cpp new file mode 100644 index 0000000000..b79056637b --- /dev/null +++ b/engines/titanic/rooms/announce.cpp @@ -0,0 +1,50 @@ +/* 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/rooms/announce.h" + +namespace Titanic { + +CAnnounce::CAnnounce() : _fieldBC(0), _fieldC0(0), _fieldC4(1), _fieldC8(0) { +} + +void CAnnounce::save(SimpleFile *file, int indent) const { + file->writeNumberLine(1, indent); + file->writeNumberLine(_fieldBC, indent); + file->writeNumberLine(_fieldC0, indent); + file->writeNumberLine(_fieldC4, indent); + file->writeNumberLine(_fieldC8, indent); + + CGameObject::save(file, indent); +} + +void CAnnounce::load(SimpleFile *file) { + file->readNumber(); + _fieldBC = file->readNumber(); + _fieldC0 = file->readNumber(); + _fieldC4 = file->readNumber(); + _fieldC8 = file->readNumber(); + + CGameObject::load(file); +} + +} // End of namespace Titanic diff --git a/engines/titanic/rooms/announce.h b/engines/titanic/rooms/announce.h new file mode 100644 index 0000000000..58f928d559 --- /dev/null +++ b/engines/titanic/rooms/announce.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_ANNOUNCE_H +#define TITANIC_ANNOUNCE_H + +#include "titanic/objects/game_object.h" + +namespace Titanic { + +class CAnnounce : public CGameObject { +private: + int _fieldBC; + int _fieldC0; + int _fieldC4; + int _fieldC8; +public: + CAnnounce(); + + /** + * Return the class name + */ + virtual const char *getClassName() const { return "CAnnounce"; } + + /** + * 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_ROOM_ITEM_H */ diff --git a/engines/titanic/rooms/pet_position.cpp b/engines/titanic/rooms/pet_position.cpp new file mode 100644 index 0000000000..b5bf2e6c01 --- /dev/null +++ b/engines/titanic/rooms/pet_position.cpp @@ -0,0 +1,37 @@ +/* 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/rooms/pet_position.h" + +namespace Titanic { + +void CPETPosition::save(SimpleFile *file, int indent) const { + file->writeNumberLine(1, indent); + CGameObject::save(file, indent); +} + +void CPETPosition::load(SimpleFile *file) { + file->readNumber(); + CGameObject::load(file); +} + +} // End of namespace Titanic diff --git a/engines/titanic/rooms/pet_position.h b/engines/titanic/rooms/pet_position.h new file mode 100644 index 0000000000..dc27377eec --- /dev/null +++ b/engines/titanic/rooms/pet_position.h @@ -0,0 +1,50 @@ +/* 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_PET_POSITION_H +#define TITANIC_PET_POSITION_H + +#include "titanic/objects/game_object.h" + +namespace Titanic { + +class CPETPosition : public CGameObject { +public: + /** + * Return the class name + */ + virtual const char *getClassName() const { return "CPETPosition"; } + + /** + * 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_ROOM_ITEM_H */ diff --git a/engines/titanic/rooms/sub_glass.cpp b/engines/titanic/rooms/sub_glass.cpp new file mode 100644 index 0000000000..27f47fd017 --- /dev/null +++ b/engines/titanic/rooms/sub_glass.cpp @@ -0,0 +1,54 @@ +/* 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/rooms/sub_glass.h" + +namespace Titanic { + +CSUBGlass::CSUBGlass() : _fieldBC(0), _fieldC0(0), _fieldC4(1), _fieldC8(0) { +} + +void CSUBGlass::save(SimpleFile *file, int indent) const { + file->writeNumberLine(1, indent); + file->writeNumberLine(_fieldBC, indent); + file->writeNumberLine(_fieldC0, indent); + file->writeNumberLine(_fieldC4, indent); + file->writeNumberLine(_fieldC8, indent); + file->writeNumberLine(_fieldCC, indent); + file->writeQuotedLine(_string, indent); + + CGameObject::save(file, indent); +} + +void CSUBGlass::load(SimpleFile *file) { + file->readNumber(); + _fieldBC = file->readNumber(); + _fieldC0 = file->readNumber(); + _fieldC4 = file->readNumber(); + _fieldC8 = file->readNumber(); + _fieldCC = file->readNumber(); + _string = file->readString(); + + CGameObject::load(file); +} + +} // End of namespace Titanic diff --git a/engines/titanic/rooms/sub_glass.h b/engines/titanic/rooms/sub_glass.h new file mode 100644 index 0000000000..b7a992db9c --- /dev/null +++ b/engines/titanic/rooms/sub_glass.h @@ -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. + * + */ + +#ifndef TITANIC_SUB_GLASS_H +#define TITANIC_SUB_GLASS_H + +#include "titanic/objects/game_object.h" + +namespace Titanic { + +class CSUBGlass : public CGameObject { +private: + int _fieldBC; + int _fieldC0; + int _fieldC4; + int _fieldC8; + int _fieldCC; + CString _string; +public: + CSUBGlass(); + + /** + * Return the class name + */ + virtual const char *getClassName() const { return "CSUBGlass"; } + + /** + * 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_ROOM_ITEM_H */ |