diff options
author | Paul Gilbert | 2016-02-26 19:45:30 -0500 |
---|---|---|
committer | Paul Gilbert | 2016-02-26 19:45:30 -0500 |
commit | 859c30a4e1129cc3d1b5d4e4a0660229a16dfd24 (patch) | |
tree | 2e0a847ec4a417ab53ee3dcf046d7ec86b821ed7 /engines | |
parent | 1a98b49f607a9dcf133f54c0e133fb774def4a7c (diff) | |
download | scummvm-rg350-859c30a4e1129cc3d1b5d4e4a0660229a16dfd24.tar.gz scummvm-rg350-859c30a4e1129cc3d1b5d4e4a0660229a16dfd24.tar.bz2 scummvm-rg350-859c30a4e1129cc3d1b5d4e4a0660229a16dfd24.zip |
TITANIC: Implemented CTelevision
Diffstat (limited to 'engines')
-rw-r--r-- | engines/titanic/core/saveable_object.cpp | 3 | ||||
-rw-r--r-- | engines/titanic/game/television.cpp | 72 | ||||
-rw-r--r-- | engines/titanic/game/television.h | 65 | ||||
-rw-r--r-- | engines/titanic/module.mk | 1 |
4 files changed, 141 insertions, 0 deletions
diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp index 1cbae873db..a52b53da05 100644 --- a/engines/titanic/core/saveable_object.cpp +++ b/engines/titanic/core/saveable_object.cpp @@ -40,6 +40,7 @@ #include "titanic/game/room_item.h" #include "titanic/game/service_elevator_door.h" #include "titanic/game/sub_glass.h" +#include "titanic/game/television.h" #include "titanic/messages/auto_sound_event.h" #include "titanic/messages/door_auto_sound_event.h" @@ -100,6 +101,7 @@ DEFFN(CPETPosition); DEFFN(CRoomItem); DEFFN(CServiceElevatorDoor); DEFFN(CSUBGlass); +DEFFN(CTelevision); DEFFN(CAutoSoundEvent); DEFFN(CDoorAutoSoundEvent); @@ -154,6 +156,7 @@ void CSaveableObject::initClassList() { ADDFN(CRoomItem); ADDFN(CServiceElevatorDoor); ADDFN(CSUBGlass); + ADDFN(CTelevision); ADDFN(CAutoSoundEvent); ADDFN(CDoorAutoSoundEvent); diff --git a/engines/titanic/game/television.cpp b/engines/titanic/game/television.cpp new file mode 100644 index 0000000000..4c6b38ad32 --- /dev/null +++ b/engines/titanic/game/television.cpp @@ -0,0 +1,72 @@ +/* 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/television.h" + +namespace Titanic { + +int CTelevision::_v1; +int CTelevision::_v2; +int CTelevision::_v3; +int CTelevision::_v4; +int CTelevision::_v5; +int CTelevision::_v6; + +CTelevision::CTelevision() : CBackground(), _fieldE0(1), + _fieldE4(7), _fieldE8(0), _fieldEC(0), _fieldF0(0) { +} + +void CTelevision::save(SimpleFile *file, int indent) const { + file->writeNumberLine(1, indent); + file->writeNumberLine(_fieldE0, indent); + file->writeNumberLine(_v1, indent); + file->writeNumberLine(_fieldE4, indent); + file->writeNumberLine(_v2, indent); + file->writeNumberLine(_fieldE8, indent); + file->writeNumberLine(_v3, indent); + file->writeNumberLine(_fieldEC, indent); + file->writeNumberLine(_v4, indent); + file->writeNumberLine(_fieldF0, indent); + file->writeNumberLine(_v5, indent); + file->writeNumberLine(_v6, indent); + + CBackground::save(file, indent); +} + +void CTelevision::load(SimpleFile *file) { + file->readNumber(); + _fieldE0 = file->readNumber(); + _v1 = file->readNumber(); + _fieldE4 = file->readNumber(); + _v2 = file->readNumber(); + _fieldE8 = file->readNumber(); + _v3 = file->readNumber(); + _fieldEC = file->readNumber(); + _v4 = file->readNumber(); + _fieldF0 = file->readNumber(); + _v5 = file->readNumber(); + _v6 = file->readNumber(); + + CBackground::load(file); +} + +} // End of namespace Titanic diff --git a/engines/titanic/game/television.h b/engines/titanic/game/television.h new file mode 100644 index 0000000000..4f39d60b9f --- /dev/null +++ b/engines/titanic/game/television.h @@ -0,0 +1,65 @@ +/* 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_TELEVISION_H +#define TITANIC_TELEVISION_H + +#include "titanic/core/background.h" + +namespace Titanic { + +class CTelevision : public CBackground { +private: + static int _v1; + static int _v2; + static int _v3; + static int _v4; + static int _v5; + static int _v6; +private: + int _fieldE0; + int _fieldE4; + int _fieldE8; + int _fieldEC; + int _fieldF0; +public: + CTelevision(); + + /** + * Return the class name + */ + virtual const char *getClassName() const { return "CTelevision"; } + + /** + * 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_TELEVISION_H */ diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk index fb24d5018d..e28f0f3e1c 100644 --- a/engines/titanic/module.mk +++ b/engines/titanic/module.mk @@ -38,6 +38,7 @@ MODULE_OBJS := \ game/room_item.o \ game/service_elevator_door.o \ game/sub_glass.o \ + game/television.o \ messages/auto_sound_event.o \ messages/door_auto_sound_event.o \ moves/enter_bomb_room.o \ |