diff options
author | Paul Gilbert | 2016-02-26 22:36:59 -0500 |
---|---|---|
committer | Paul Gilbert | 2016-02-26 22:36:59 -0500 |
commit | 03f842f8ebe6413db2592785a5e69830f9a6e58b (patch) | |
tree | f32e7ce20c03c9d6c7de70d17336ad7ff744d09a | |
parent | 405c1d97330a1f158bdc5c472ff1bf778542fb5a (diff) | |
download | scummvm-rg350-03f842f8ebe6413db2592785a5e69830f9a6e58b.tar.gz scummvm-rg350-03f842f8ebe6413db2592785a5e69830f9a6e58b.tar.bz2 scummvm-rg350-03f842f8ebe6413db2592785a5e69830f9a6e58b.zip |
TITANIC: Implement computer and CDROM classes
-rw-r--r-- | engines/titanic/core/saveable_object.cpp | 12 | ||||
-rw-r--r-- | engines/titanic/game/cdrom.cpp | 42 | ||||
-rw-r--r-- | engines/titanic/game/cdrom.h | 54 | ||||
-rw-r--r-- | engines/titanic/game/cdrom_computer.cpp | 51 | ||||
-rw-r--r-- | engines/titanic/game/cdrom_computer.h | 57 | ||||
-rw-r--r-- | engines/titanic/game/cdrom_tray.cpp | 46 | ||||
-rw-r--r-- | engines/titanic/game/cdrom_tray.h | 55 | ||||
-rw-r--r-- | engines/titanic/game/computer_screen.cpp | 40 | ||||
-rw-r--r-- | engines/titanic/game/computer_screen.h | 52 | ||||
-rw-r--r-- | engines/titanic/module.mk | 4 |
10 files changed, 413 insertions, 0 deletions
diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp index 7451852520..83b1d3c46a 100644 --- a/engines/titanic/core/saveable_object.cpp +++ b/engines/titanic/core/saveable_object.cpp @@ -36,6 +36,10 @@ #include "titanic/core/view_item.h" #include "titanic/game/announce.h" +#include "titanic/game/cdrom.h" +#include "titanic/game/cdrom_computer.h" +#include "titanic/game/cdrom_tray.h" +#include "titanic/game/computer_screen.h" #include "titanic/game/dead_area.h" #include "titanic/game/hammer_dispensor_button.h" #include "titanic/game/pet_position.h" @@ -132,6 +136,10 @@ DEFFN(CTreeItem); DEFFN(CViewItem); DEFFN(CAnnounce); +DEFFN(CCDROM); +DEFFN(CCDROMComputer); +DEFFN(CCDROMTray); +DEFFN(CComputerScreen); DEFFN(CDeadArea); DEFFN(CHammerDispensorButton); DEFFN(CPETPosition); @@ -221,6 +229,10 @@ void CSaveableObject::initClassList() { ADDFN(CViewItem); ADDFN(CAnnounce); + ADDFN(CCDROM); + ADDFN(CCDROMComputer); + ADDFN(CCDROMTray); + ADDFN(CComputerScreen); ADDFN(CDeadArea); ADDFN(CHammerDispensorButton); ADDFN(CPETPosition); diff --git a/engines/titanic/game/cdrom.cpp b/engines/titanic/game/cdrom.cpp new file mode 100644 index 0000000000..40e8ed05d8 --- /dev/null +++ b/engines/titanic/game/cdrom.cpp @@ -0,0 +1,42 @@ +/* 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/cdrom.h" + +namespace Titanic { + +CCDROM::CCDROM() : CGameObject() { +} + +void CCDROM::save(SimpleFile *file, int indent) const { + file->writeNumberLine(1, indent); + file->writePoint(_pos1, indent); + CGameObject::save(file, indent); +} + +void CCDROM::load(SimpleFile *file) { + file->readNumber(); + _pos1 = file->readPoint(); + CGameObject::load(file); +} + +} // End of namespace Titanic diff --git a/engines/titanic/game/cdrom.h b/engines/titanic/game/cdrom.h new file mode 100644 index 0000000000..cd05c79d0a --- /dev/null +++ b/engines/titanic/game/cdrom.h @@ -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. + * + */ + +#ifndef TITANIC_CDROM_H +#define TITANIC_CDROM_H + +#include "titanic/core/game_object.h" + +namespace Titanic { + +class CCDROM : public CGameObject { +private: + Common::Point _pos1; +public: + CCDROM(); + + /** + * Return the class name + */ + virtual const char *getClassName() const { return "CCDROM"; } + + /** + * 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_CDROM_H */ diff --git a/engines/titanic/game/cdrom_computer.cpp b/engines/titanic/game/cdrom_computer.cpp new file mode 100644 index 0000000000..e67e4fb1d8 --- /dev/null +++ b/engines/titanic/game/cdrom_computer.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/game/cdrom_computer.h" + +namespace Titanic { + +CCDROMComputer::CCDROMComputer() : CGameObject(), + _fieldBC(0), _fieldC0(3), _fieldC4(55), _fieldC8(32) { +} + +void CCDROMComputer::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 CCDROMComputer::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/game/cdrom_computer.h b/engines/titanic/game/cdrom_computer.h new file mode 100644 index 0000000000..368c45f266 --- /dev/null +++ b/engines/titanic/game/cdrom_computer.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_CDROM_COMPUTER_H +#define TITANIC_CDROM_COMPUTER_H + +#include "titanic/core/game_object.h" + +namespace Titanic { + +class CCDROMComputer : public CGameObject { +private: + int _fieldBC; + int _fieldC0; + int _fieldC4; + int _fieldC8; +public: + CCDROMComputer(); + + /** + * Return the class name + */ + virtual const char *getClassName() const { return "CCDROMComputer"; } + + /** + * 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_CDROM_COMPUTER_H */ diff --git a/engines/titanic/game/cdrom_tray.cpp b/engines/titanic/game/cdrom_tray.cpp new file mode 100644 index 0000000000..32eea0648b --- /dev/null +++ b/engines/titanic/game/cdrom_tray.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/game/cdrom_tray.h" + +namespace Titanic { + +CCDROMTray::CCDROMTray() : CGameObject(), _fieldBC(0) { +} + +void CCDROMTray::save(SimpleFile *file, int indent) const { + file->writeNumberLine(1, indent); + file->writeNumberLine(_fieldBC, indent); + file->writeQuotedLine(_string1, indent); + + CGameObject::save(file, indent); +} + +void CCDROMTray::load(SimpleFile *file) { + file->readNumber(); + _fieldBC = file->readNumber(); + _string1 = file->readString(); + + CGameObject::load(file); +} + +} // End of namespace Titanic diff --git a/engines/titanic/game/cdrom_tray.h b/engines/titanic/game/cdrom_tray.h new file mode 100644 index 0000000000..371187e946 --- /dev/null +++ b/engines/titanic/game/cdrom_tray.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_CDROM_TRAY_H +#define TITANIC_CDROM_TRAY_H + +#include "titanic/core/game_object.h" + +namespace Titanic { + +class CCDROMTray : public CGameObject { +private: + int _fieldBC; + CString _string1; +public: + CCDROMTray(); + + /** + * Return the class name + */ + virtual const char *getClassName() const { return "CCDROMTray"; } + + /** + * 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_CDROM_TRAY_H */ diff --git a/engines/titanic/game/computer_screen.cpp b/engines/titanic/game/computer_screen.cpp new file mode 100644 index 0000000000..04de5e50d8 --- /dev/null +++ b/engines/titanic/game/computer_screen.cpp @@ -0,0 +1,40 @@ +/* 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/computer_screen.h" + +namespace Titanic { + +CComputerScreen::CComputerScreen() : CGameObject() { +} + +void CComputerScreen::save(SimpleFile *file, int indent) const { + file->writeNumberLine(1, indent); + CGameObject::save(file, indent); +} + +void CComputerScreen::load(SimpleFile *file) { + file->readNumber(); + CGameObject::load(file); +} + +} // End of namespace Titanic diff --git a/engines/titanic/game/computer_screen.h b/engines/titanic/game/computer_screen.h new file mode 100644 index 0000000000..adb8b99093 --- /dev/null +++ b/engines/titanic/game/computer_screen.h @@ -0,0 +1,52 @@ +/* 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_COMPUTER_SCREEN_H +#define TITANIC_COMPUTER_SCREEN_H + +#include "titanic/core/game_object.h" + +namespace Titanic { + +class CComputerScreen : public CGameObject { +public: + CComputerScreen(); + + /** + * Return the class name + */ + virtual const char *getClassName() const { return "CComputerScreen"; } + + /** + * 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_COMPUTER_SCREEN_H */ diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk index c90f300274..40b5b3280d 100644 --- a/engines/titanic/module.mk +++ b/engines/titanic/module.mk @@ -34,6 +34,10 @@ MODULE_OBJS := \ core/tree_item.o \ core/view_item.o \ game/announce.o \ + game/cdrom.o \ + game/cdrom_computer.o \ + game/cdrom_tray.o \ + game/computer_screen.o \ game/dead_area.o \ game/hammer_dispensor_button.o \ game/pet_position.o \ |