diff --git a/engines/stark/console.cpp b/engines/stark/console.cpp index 31102fe731e..c6ba646540c 100644 --- a/engines/stark/console.cpp +++ b/engines/stark/console.cpp @@ -28,6 +28,7 @@ #include "engines/stark/resources/location.h" #include "engines/stark/resources/root.h" #include "engines/stark/services/archiveloader.h" +#include "engines/stark/services/global.h" #include "engines/stark/services/resourceprovider.h" #include "common/file.h" diff --git a/engines/stark/resourcereference.cpp b/engines/stark/resourcereference.cpp index f7e3b006cb0..c4d8039eb4f 100644 --- a/engines/stark/resourcereference.cpp +++ b/engines/stark/resourcereference.cpp @@ -25,6 +25,7 @@ #include "engines/stark/debug.h" #include "engines/stark/resources/level.h" #include "engines/stark/resources/location.h" +#include "engines/stark/services/global.h" #include "engines/stark/services/resourceprovider.h" #include "engines/stark/stark.h" diff --git a/engines/stark/resources/anim.cpp b/engines/stark/resources/anim.cpp index b8668fd09d2..5249ce74567 100644 --- a/engines/stark/resources/anim.cpp +++ b/engines/stark/resources/anim.cpp @@ -22,14 +22,14 @@ #include "common/debug.h" -#include "engines/stark/services/archiveloader.h" #include "engines/stark/resources/anim.h" #include "engines/stark/resources/bonesmesh.h" #include "engines/stark/resources/direction.h" #include "engines/stark/resources/image.h" #include "engines/stark/resources/item.h" #include "engines/stark/resources/textureset.h" -#include "engines/stark/services/resourceprovider.h" +#include "engines/stark/services/archiveloader.h" +#include "engines/stark/services/global.h" #include "engines/stark/skeleton_anim.h" #include "engines/stark/stark.h" #include "engines/stark/visual/actor.h" diff --git a/engines/stark/resources/animscript.cpp b/engines/stark/resources/animscript.cpp index abf13ab2ec4..de652c275e7 100644 --- a/engines/stark/resources/animscript.cpp +++ b/engines/stark/resources/animscript.cpp @@ -26,7 +26,7 @@ #include "common/random.h" #include "engines/stark/resources/anim.h" -#include "engines/stark/services/resourceprovider.h" +#include "engines/stark/services/global.h" #include "engines/stark/stark.h" #include "engines/stark/xrcreader.h" diff --git a/engines/stark/resources/script.cpp b/engines/stark/resources/script.cpp index 17fba990efa..a69b3c3b6cf 100644 --- a/engines/stark/resources/script.cpp +++ b/engines/stark/resources/script.cpp @@ -24,7 +24,7 @@ #include "engines/stark/resources/command.h" #include "engines/stark/resources/item.h" -#include "engines/stark/services/resourceprovider.h" +#include "engines/stark/services/global.h" #include "engines/stark/stark.h" #include "engines/stark/xrcreader.h" diff --git a/engines/stark/services/global.h b/engines/stark/services/global.h new file mode 100644 index 00000000000..4650644df3b --- /dev/null +++ b/engines/stark/services/global.h @@ -0,0 +1,105 @@ +/* ResidualVM - A 3D game interpreter + * + * ResidualVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the AUTHORS + * 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 STARK_SERVICES_GLOBAL_H +#define STARK_SERVICES_GLOBAL_H + +namespace Stark { + +class Camera; +class Floor; +class Level; +class Location; +class Root; + +/** + * Current level / location holder object + */ +class Current { +public: + Current() : + _level(nullptr), + _location(nullptr), + _floor(nullptr), + _camera(nullptr) { + } + + Level *getLevel() const { return _level; } + Location *getLocation() const { return _location; } + Floor *getFloor() const { return _floor; } + Camera *getCamera() const { return _camera; } + + void setLevel(Level *level) { _level = level; } + void setLocation(Location *location) { _location = location; } + void setFloor(Floor *floor) { _floor = floor; } + void setCamera(Camera *camera) { _camera = camera; } + +private: + Level *_level; + Location *_location; + /* Item *_interactive; */ + Floor *_floor; + Camera *_camera; +}; + +/** + * Global resources holder object + */ +class Global { +public: + Global() : + _millisecondsPerGameloop(0), + _root(nullptr), + _level(nullptr), + _current(nullptr), + _debug(false), + _fastForward(false) { + } + + Root *getRoot() const { return _root; } + Level *getLevel() const { return _level; } + Current *getCurrent() const { return _current; } + bool isDebug() const { return _debug; } + bool isFastForward() const { return _fastForward; } + uint getMillisecondsPerGameloop() const { return _millisecondsPerGameloop; } + + void setRoot(Root *root) { _root = root; } + void setLevel(Level *level) { _level = level; } + void setCurrent(Current *current) { _current = current; } + void setDebug(bool debug) { _debug = debug; } + void setFastForward(bool fastForward) { _fastForward = fastForward; } + void setMillisecondsPerGameloop(uint millisecondsPerGameloop) { _millisecondsPerGameloop = millisecondsPerGameloop; } + +private: + uint _millisecondsPerGameloop; + Root *_root; + Level *_level; + /* Inventory *_inventory; */ + /* ItemVis3D *_april; */ + Current *_current; + bool _debug; + bool _fastForward; +}; + +} // End of namespace Stark + +#endif // STARK_SERVICES_GLOBAL_H diff --git a/engines/stark/services/resourceprovider.cpp b/engines/stark/services/resourceprovider.cpp index 40789e0694c..0ee64a86521 100644 --- a/engines/stark/services/resourceprovider.cpp +++ b/engines/stark/services/resourceprovider.cpp @@ -22,7 +22,6 @@ #include "engines/stark/services/resourceprovider.h" -#include "engines/stark/services/archiveloader.h" #include "engines/stark/resources/camera.h" #include "engines/stark/resources/floor.h" #include "engines/stark/resources/layer.h" @@ -30,6 +29,8 @@ #include "engines/stark/resources/location.h" #include "engines/stark/resources/root.h" #include "engines/stark/resources/script.h" +#include "engines/stark/services/archiveloader.h" +#include "engines/stark/services/global.h" #include "engines/stark/services/stateprovider.h" namespace Stark { diff --git a/engines/stark/services/resourceprovider.h b/engines/stark/services/resourceprovider.h index c2960a5879c..4257cc36305 100644 --- a/engines/stark/services/resourceprovider.h +++ b/engines/stark/services/resourceprovider.h @@ -27,85 +27,15 @@ namespace Stark { -class Camera; -class Floor; class Level; class Location; class Resource; -class Root; class ArchiveLoader; +class Current; +class Global; class StateProvider; -/** - * Current level / location holder object - */ -class Current { -public: - Current() : - _level(nullptr), - _location(nullptr), - _floor(nullptr), - _camera(nullptr) { - } - - Level *getLevel() const { return _level; } - Location *getLocation() const { return _location; } - Floor *getFloor() const { return _floor; } - Camera *getCamera() const { return _camera; } - - void setLevel(Level *level) { _level = level; } - void setLocation(Location *location) { _location = location; } - void setFloor(Floor *floor) { _floor = floor; } - void setCamera(Camera *camera) { _camera = camera; } - -private: - Level *_level; - Location *_location; - /* Item *_interactive; */ - Floor *_floor; - Camera *_camera; -}; - -/** - * Global resources holder object - */ -class Global { -public: - Global() : - _millisecondsPerGameloop(0), - _root(nullptr), - _level(nullptr), - _current(nullptr), - _debug(false), - _fastForward(false) { - } - - Root *getRoot() const { return _root; } - Level *getLevel() const { return _level; } - Current *getCurrent() const { return _current; } - bool isDebug() const { return _debug; } - bool isFastForward() const { return _fastForward; } - uint getMillisecondsPerGameloop() const { return _millisecondsPerGameloop; } - - void setRoot(Root *root) { _root = root; } - void setLevel(Level *level) { _level = level; } - void setCurrent(Current *current) { _current = current; } - void setDebug(bool debug) { _debug = debug; } - void setFastForward(bool fastForward) { _fastForward = fastForward; } - void setMillisecondsPerGameloop(uint millisecondsPerGameloop) { _millisecondsPerGameloop = millisecondsPerGameloop; } - -private: - uint _millisecondsPerGameloop; - Root *_root; - Level *_level; - /* Inventory *_inventory; */ - /* ItemVis3D *_april; */ - Current *_current; - bool _debug; - bool _fastForward; -}; - /** * Game Resource provider. * diff --git a/engines/stark/stark.cpp b/engines/stark/stark.cpp index e4ea8b0c7a5..cf03e44a6ab 100644 --- a/engines/stark/stark.cpp +++ b/engines/stark/stark.cpp @@ -28,6 +28,7 @@ #include "engines/stark/resources/location.h" #include "engines/stark/scene.h" #include "engines/stark/services/archiveloader.h" +#include "engines/stark/services/global.h" #include "engines/stark/services/resourceprovider.h" #include "engines/stark/services/stateprovider.h" #include "engines/stark/gfx/driver.h"