diff options
-rw-r--r-- | engines/titanic/core/saveable_object.cpp | 6 | ||||
-rw-r--r-- | engines/titanic/game/hammer_dispensor_button.cpp | 56 | ||||
-rw-r--r-- | engines/titanic/game/hammer_dispensor_button.h | 60 | ||||
-rw-r--r-- | engines/titanic/game/service_elevator_door.h | 2 | ||||
-rw-r--r-- | engines/titanic/game/start_action.cpp (renamed from engines/titanic/game/door_auto_sound_event.cpp) | 25 | ||||
-rw-r--r-- | engines/titanic/game/start_action.h (renamed from engines/titanic/game/door_auto_sound_event.h) | 20 | ||||
-rw-r--r-- | engines/titanic/messages/door_auto_sound_event.h | 2 | ||||
-rw-r--r-- | engines/titanic/module.mk | 2 |
8 files changed, 145 insertions, 28 deletions
diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp index e87325a84d..966e441050 100644 --- a/engines/titanic/core/saveable_object.cpp +++ b/engines/titanic/core/saveable_object.cpp @@ -36,9 +36,11 @@ #include "titanic/core/view_item.h" #include "titanic/game/announce.h" +#include "titanic/game/hammer_dispensor_button.h" #include "titanic/game/pet_position.h" #include "titanic/game/room_item.h" #include "titanic/game/service_elevator_door.h" +#include "titanic/game/start_action.h" #include "titanic/game/sub_glass.h" #include "titanic/game/television.h" @@ -129,9 +131,11 @@ DEFFN(CTreeItem); DEFFN(CViewItem); DEFFN(CAnnounce); +DEFFN(CHammerDispensorButton); DEFFN(CPETPosition); DEFFN(CRoomItem); DEFFN(CServiceElevatorDoor); +DEFFN(CStartAction); DEFFN(CSUBGlass); DEFFN(CTelevision); @@ -215,9 +219,11 @@ void CSaveableObject::initClassList() { ADDFN(CViewItem); ADDFN(CAnnounce); + ADDFN(CHammerDispensorButton); ADDFN(CPETPosition); ADDFN(CRoomItem); ADDFN(CServiceElevatorDoor); + ADDFN(CStartAction); ADDFN(CSUBGlass); ADDFN(CTelevision); diff --git a/engines/titanic/game/hammer_dispensor_button.cpp b/engines/titanic/game/hammer_dispensor_button.cpp new file mode 100644 index 0000000000..eb9fa3845b --- /dev/null +++ b/engines/titanic/game/hammer_dispensor_button.cpp @@ -0,0 +1,56 @@ +/* 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/hammer_dispensor_button.h" + +namespace Titanic { + +CHammerDispensorButton::CHammerDispensorButton() : CStartAction(), + _fieldF8(0), _fieldFC(0), _field100(0), _field104(56), + _field108(6), _field10C(0), _field110(0) { +} + +void CHammerDispensorButton::save(SimpleFile *file, int indent) const { + file->writeNumberLine(1, indent); + file->writeNumberLine(_fieldF8, indent); + file->writeNumberLine(_fieldFC, indent); + file->writeNumberLine(_field100, indent); + file->writeNumberLine(_field104, indent); + file->writeNumberLine(_field108, indent); + file->writeNumberLine(_field110, indent); + + CStartAction::save(file, indent); +} + +void CHammerDispensorButton::load(SimpleFile *file) { + file->readNumber(); + _fieldF8 = file->readNumber(); + _fieldFC = file->readNumber(); + _field100 = file->readNumber(); + _field104 = file->readNumber(); + _field108 = file->readNumber(); + _field110 = file->readNumber(); + + CStartAction::load(file); +} + +} // End of namespace Titanic diff --git a/engines/titanic/game/hammer_dispensor_button.h b/engines/titanic/game/hammer_dispensor_button.h new file mode 100644 index 0000000000..e4b5fc13b1 --- /dev/null +++ b/engines/titanic/game/hammer_dispensor_button.h @@ -0,0 +1,60 @@ +/* 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_HAMMER_DISPENSOR_H +#define TITANIC_HAMMER_DISPENSOR_H + +#include "titanic/game/start_action.h" + +namespace Titanic { + +class CHammerDispensorButton : public CStartAction { +private: + int _fieldF8; + int _fieldFC; + int _field100; + int _field104; + int _field108; + int _field10C; + int _field110; +public: + CHammerDispensorButton(); + + /** + * Return the class name + */ + virtual const char *getClassName() const { return "CHammerDispensorButton"; } + + /** + * 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_HAMMER_DISPENSOR_H */ diff --git a/engines/titanic/game/service_elevator_door.h b/engines/titanic/game/service_elevator_door.h index 3ad897c089..a3a8388405 100644 --- a/engines/titanic/game/service_elevator_door.h +++ b/engines/titanic/game/service_elevator_door.h @@ -23,7 +23,7 @@ #ifndef TITANIC_SERVICE_ELEVATOR_DOOR_H #define TITANIC_SERVICE_ELEVATOR_DOOR_H -#include "titanic/game/door_auto_sound_event.h" +#include "titanic/messages/door_auto_sound_event.h" namespace Titanic { diff --git a/engines/titanic/game/door_auto_sound_event.cpp b/engines/titanic/game/start_action.cpp index 158c147296..9bafd01282 100644 --- a/engines/titanic/game/door_auto_sound_event.cpp +++ b/engines/titanic/game/start_action.cpp @@ -20,32 +20,27 @@ * */ -#include "titanic/game/door_auto_sound_event.h" +#include "titanic/game/start_action.h" namespace Titanic { -CDoorAutoSoundEvent::CDoorAutoSoundEvent() : CAutoSoundEvent(), - _string1("z#44.wav"), _string2("z#43.wav"), _fieldDC(25), _fieldE0(25) { +CStartAction::CStartAction() : CBackground() { } -void CDoorAutoSoundEvent::save(SimpleFile *file, int indent) const { +void CStartAction::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); + file->writeQuotedLine(_string3, indent); + file->writeQuotedLine(_string4, indent); - CAutoSoundEvent::save(file, indent); + CBackground::save(file, indent); } -void CDoorAutoSoundEvent::load(SimpleFile *file) { +void CStartAction::load(SimpleFile *file) { file->readNumber(); - _string1 = file->readString(); - _string2 = file->readString(); - _fieldDC = file->readNumber(); - _fieldE0 = file->readNumber(); + _string3 = file->readString(); + _string4 = file->readString(); - CAutoSoundEvent::load(file); + CBackground::load(file); } } // End of namespace Titanic diff --git a/engines/titanic/game/door_auto_sound_event.h b/engines/titanic/game/start_action.h index 9bba304daa..3725dbc4a0 100644 --- a/engines/titanic/game/door_auto_sound_event.h +++ b/engines/titanic/game/start_action.h @@ -20,26 +20,24 @@ * */ -#ifndef TITANIC_DOOR_AUTO_SOUND_EVENT_H -#define TITANIC_DOOR_AUTO_SOUND_EVENT_H +#ifndef TITANIC_START_ACTION_H +#define TITANIC_START_ACTION_H -#include "titanic/messages/auto_sound_event.h" +#include "titanic/core/background.h" namespace Titanic { -class CDoorAutoSoundEvent : public CAutoSoundEvent { +class CStartAction : public CBackground { protected: - CString _string1; - CString _string2; - int _fieldDC; - int _fieldE0; + CString _string3; + CString _string4; public: - CDoorAutoSoundEvent(); + CStartAction(); /** * Return the class name */ - virtual const char *getClassName() const { return "CDoorAutoSoundEvent"; } + virtual const char *getClassName() const { return "CStartAction"; } /** * Save the data for the class to file @@ -54,4 +52,4 @@ public: } // End of namespace Titanic -#endif /* TITANIC_DOOR_AUTO_SOUND_EVENT_H */ +#endif /* TITANIC_START_ACTION_H */ diff --git a/engines/titanic/messages/door_auto_sound_event.h b/engines/titanic/messages/door_auto_sound_event.h index a231b2fa52..9bba304daa 100644 --- a/engines/titanic/messages/door_auto_sound_event.h +++ b/engines/titanic/messages/door_auto_sound_event.h @@ -28,7 +28,7 @@ namespace Titanic { class CDoorAutoSoundEvent : public CAutoSoundEvent { -private: +protected: CString _string1; CString _string2; int _fieldDC; diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk index d8d87f0b8d..e10fe31e42 100644 --- a/engines/titanic/module.mk +++ b/engines/titanic/module.mk @@ -34,9 +34,11 @@ MODULE_OBJS := \ core/tree_item.o \ core/view_item.o \ game/announce.o \ + game/hammer_dispensor_button.o \ game/pet_position.o \ game/room_item.o \ game/service_elevator_door.o \ + game/start_action.o \ game/sub_glass.o \ game/television.o \ gfx/act_button.o \ |