diff options
author | Paul Gilbert | 2016-02-07 16:22:16 -0500 |
---|---|---|
committer | Paul Gilbert | 2016-02-07 16:22:16 -0500 |
commit | bc7bc8ab3487df70263721493c26c16aab9c7b81 (patch) | |
tree | 2cbc0f70ee278eea0cf3f131ff73c15c8417da23 /engines/titanic | |
parent | 0874af38dbad54551e143e541f37163ec9e7e0e7 (diff) | |
download | scummvm-rg350-bc7bc8ab3487df70263721493c26c16aab9c7b81.tar.gz scummvm-rg350-bc7bc8ab3487df70263721493c26c16aab9c7b81.tar.bz2 scummvm-rg350-bc7bc8ab3487df70263721493c26c16aab9c7b81.zip |
TITANIC: Class stubs and beginnings of CSaveableObject hierarchy
Diffstat (limited to 'engines/titanic')
-rw-r--r-- | engines/titanic/direct_draw.cpp | 45 | ||||
-rw-r--r-- | engines/titanic/direct_draw.h | 56 | ||||
-rw-r--r-- | engines/titanic/image.cpp | 2 | ||||
-rw-r--r-- | engines/titanic/list.cpp | 27 | ||||
-rw-r--r-- | engines/titanic/list.h | 37 | ||||
-rw-r--r-- | engines/titanic/main_game_window.cpp | 4 | ||||
-rw-r--r-- | engines/titanic/main_game_window.h | 5 | ||||
-rw-r--r-- | engines/titanic/module.mk | 6 | ||||
-rw-r--r-- | engines/titanic/saveable_object.cpp | 61 | ||||
-rw-r--r-- | engines/titanic/saveable_object.h | 59 | ||||
-rw-r--r-- | engines/titanic/titanic.cpp | 3 | ||||
-rw-r--r-- | engines/titanic/titanic.h | 8 | ||||
-rw-r--r-- | engines/titanic/video_surface.cpp | 27 | ||||
-rw-r--r-- | engines/titanic/video_surface.h | 42 |
14 files changed, 379 insertions, 3 deletions
diff --git a/engines/titanic/direct_draw.cpp b/engines/titanic/direct_draw.cpp new file mode 100644 index 0000000000..a79edf9279 --- /dev/null +++ b/engines/titanic/direct_draw.cpp @@ -0,0 +1,45 @@ +/* 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/direct_draw.h" + +namespace Titanic { + +DirectDraw::DirectDraw(TitanicEngine *vm) : Manager(vm) { + _field8 = 0; + _fieldC = 0; + _width = 0; + _height = 0; + _bpp = 0; + _field1C = 0; + _field24 = 0; +} + +/*------------------------------------------------------------------------*/ + +DirectDrawManager::DirectDrawManager(TitanicEngine *vm) : + Manager(vm), _directDraw(vm) { + _mainSurface = nullptr; + _backSurfaces[0] = _backSurfaces[1] = nullptr; +} + +} // End of namespace Titanic diff --git a/engines/titanic/direct_draw.h b/engines/titanic/direct_draw.h new file mode 100644 index 0000000000..f88df717e0 --- /dev/null +++ b/engines/titanic/direct_draw.h @@ -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. + * + */ + +#ifndef TITANIC_DIRECT_DRAW_H +#define TITANIC_DIRECT_DRAW_H + +#include "common/scummsys.h" +#include "common/array.h" +#include "titanic/titanic.h" + +namespace Titanic { + +class DirectDraw: public Manager { +public: + int _field8; + int _fieldC; + int _width; + int _height; + int _bpp; + int _field1C; + int _field24; +public: + DirectDraw(TitanicEngine *vm); +}; + +class DirectDrawManager: public Manager { +public: + DirectDraw _directDraw; + void *_mainSurface; + void *_backSurfaces[2]; +public: + DirectDrawManager(TitanicEngine *vm); +}; + +} // End of namespace Titanic + +#endif /* TITANIC_DIRECT_DRAW_H */ diff --git a/engines/titanic/image.cpp b/engines/titanic/image.cpp index b18d591d37..0a130419a1 100644 --- a/engines/titanic/image.cpp +++ b/engines/titanic/image.cpp @@ -35,7 +35,7 @@ BITMAPINFOHEADER::BITMAPINFOHEADER() { _biSizeImage = 0; _biXPelsPerMeter = 0; _biYPelsPerMeter = 0; - _biCirUsed = 0; + _biClrUsed = 0; _biClrImportant = 0; } diff --git a/engines/titanic/list.cpp b/engines/titanic/list.cpp new file mode 100644 index 0000000000..2b6496f3b2 --- /dev/null +++ b/engines/titanic/list.cpp @@ -0,0 +1,27 @@ +/* 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/list.h" + +namespace Titanic { + +} // End of namespace Titanic diff --git a/engines/titanic/list.h b/engines/titanic/list.h new file mode 100644 index 0000000000..d94ccb99ac --- /dev/null +++ b/engines/titanic/list.h @@ -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. + * + */ + +#ifndef TITANIC_LIST_H +#define TITANIC_LIST_H + +#include "common/scummsys.h" +#include "titanic/saveable_object.h" + +namespace Titanic { + +class List : public CSaveableObject { + +}; + +} // End of namespace Titanic + +#endif /* TITANIC_LIST_H */ diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp index 54fb6c23a4..9087cafb80 100644 --- a/engines/titanic/main_game_window.cpp +++ b/engines/titanic/main_game_window.cpp @@ -32,11 +32,13 @@ CMainGameWindow::CMainGameWindow(TitanicEngine *vm): _vm(vm) { _field50 = 0; _image = nullptr; _cursor = nullptr; +} +bool CMainGameWindow::Create() { Image image; bool result = image.loadResource("TITANIC"); if (!result) - return; + return true; } } // End of namespace Titanic diff --git a/engines/titanic/main_game_window.h b/engines/titanic/main_game_window.h index 91e68600e0..9b41212d7a 100644 --- a/engines/titanic/main_game_window.h +++ b/engines/titanic/main_game_window.h @@ -43,6 +43,11 @@ public: void *_cursor; public: CMainGameWindow(TitanicEngine *vm); + + /** + * Creates the window + */ + bool Create(); }; } // End of namespace Titanic diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk index 18cde154ab..a2a7722592 100644 --- a/engines/titanic/module.mk +++ b/engines/titanic/module.mk @@ -2,11 +2,15 @@ MODULE := engines/titanic MODULE_OBJS := \ detection.o \ + direct_draw.o \ font.o \ image.o \ + list.o \ main_game_window.o \ + saveable_object.o \ screen_manager.o \ - titanic.o + titanic.o \ + video_surface.o # This module can be built as a plugin ifeq ($(ENABLE_TITANIC), DYNAMIC_PLUGIN) diff --git a/engines/titanic/saveable_object.cpp b/engines/titanic/saveable_object.cpp new file mode 100644 index 0000000000..c1b6612d59 --- /dev/null +++ b/engines/titanic/saveable_object.cpp @@ -0,0 +1,61 @@ +/* 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/saveable_object.h" +#include "titanic/list.h" + +namespace Titanic { + +Common::HashMap<Common::String, CSaveableObject::CreateFunction> * + CSaveableObject::_classList = nullptr; + +#define DEFFN(T) CSaveableObject *Function##T() { return new T(); } +#define ADDFN(T) (*_classList)["TEST"] = Function##T + +DEFFN(List); + +void CSaveableObject::initClassList() { + _classList = new Common::HashMap<Common::String, CreateFunction>(); + ADDFN(List); +} + +void CSaveableObject::freeClassList() { + delete _classList; +} + +CSaveableObject *CSaveableObject::createInstance(const Common::String &name) { + return (*_classList)[name](); +} + +void CSaveableObject::proc4() { + +} + +void CSaveableObject::proc5() { + +} + +void CSaveableObject::proc6() { + +} + +} // End of namespace Titanic diff --git a/engines/titanic/saveable_object.h b/engines/titanic/saveable_object.h new file mode 100644 index 0000000000..5253892f51 --- /dev/null +++ b/engines/titanic/saveable_object.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_SAVEABLE_OBJECT_H +#define TITANIC_SAVEABLE_OBJECT_H + +#include "common/scummsys.h" +#include "common/array.h" +#include "common/hash-str.h" + +namespace Titanic { + +class CSaveableObject { + typedef CSaveableObject *(*CreateFunction)(); +private: + static Common::HashMap<Common::String, CreateFunction> *_classList; +public: + /** + * Sets up the list of saveable object classes + */ + static void initClassList(); + + /** + * Free the list of saveable object classes + */ + static void freeClassList(); + + /** + * Creates a new instance of a saveable object class + */ + static CSaveableObject *createInstance(const Common::String &name); +public: + virtual void proc4(); + virtual void proc5(); + virtual void proc6(); +}; + +} // End of namespace Titanic + +#endif /* TITANIC_SAVEABLE_OBJECT_H */ diff --git a/engines/titanic/titanic.cpp b/engines/titanic/titanic.cpp index 9230717c8e..c438c353ef 100644 --- a/engines/titanic/titanic.cpp +++ b/engines/titanic/titanic.cpp @@ -28,6 +28,7 @@ #include "graphics/scaler.h" #include "graphics/thumbnail.h" #include "titanic/titanic.h" +#include "titanic/saveable_object.h" namespace Titanic { @@ -40,6 +41,7 @@ TitanicEngine::TitanicEngine(OSystem *syst, const TitanicGameDescription *gameDe TitanicEngine::~TitanicEngine() { delete _window; delete _screenManager; + CSaveableObject::freeClassList(); } void TitanicEngine::initialize() { @@ -49,6 +51,7 @@ void TitanicEngine::initialize() { DebugMan.addDebugChannel(kDebugGraphics, "graphics", "Graphics handling"); DebugMan.addDebugChannel(kDebugSound, "sound", "Sound and Music handling"); + CSaveableObject::initClassList(); _window = new CMainGameWindow(this); _screenManager = new OSScreenManager(); } diff --git a/engines/titanic/titanic.h b/engines/titanic/titanic.h index 1265e70658..2e51a9d75a 100644 --- a/engines/titanic/titanic.h +++ b/engines/titanic/titanic.h @@ -51,6 +51,7 @@ enum TitanicDebugChannels { #define TITANIC_SAVEGAME_VERSION 1 struct TitanicGameDescription; +class TitanicEngine; struct TitanicSavegameHeader { uint8 _version; @@ -61,6 +62,13 @@ struct TitanicSavegameHeader { int _totalFrames; }; +class Manager { +protected: + TitanicEngine *_vm; +public: + Manager(TitanicEngine *vm) : _vm(vm) {} +}; + class TitanicEngine : public Engine { private: /** diff --git a/engines/titanic/video_surface.cpp b/engines/titanic/video_surface.cpp new file mode 100644 index 0000000000..d25e9da77a --- /dev/null +++ b/engines/titanic/video_surface.cpp @@ -0,0 +1,27 @@ +/* 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/video_surface.h" + +namespace Titanic { + +} // End of namespace Titanic diff --git a/engines/titanic/video_surface.h b/engines/titanic/video_surface.h new file mode 100644 index 0000000000..259c5b0ebf --- /dev/null +++ b/engines/titanic/video_surface.h @@ -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. + * + */ + +#ifndef TITANIC_VIDEO_SURFACE_H +#define TITANIC_VIDEO_SURFACE_H + +#include "common/scummsys.h" +#include "common/array.h" +#include "titanic/font.h" + +namespace Titanic { + +class CVideoSurface { + +}; + +class OSVideoSurface : CVideoSurface { + +}; + +} // End of namespace Titanic + +#endif /* TITANIC_VIDEO_SURFACE_H */ |