STARK: Split Global and Current to a separate file
This commit is contained in:
parent
d9b440e74b
commit
7f8f3789e5
9 changed files with 116 additions and 77 deletions
|
@ -28,6 +28,7 @@
|
||||||
#include "engines/stark/resources/location.h"
|
#include "engines/stark/resources/location.h"
|
||||||
#include "engines/stark/resources/root.h"
|
#include "engines/stark/resources/root.h"
|
||||||
#include "engines/stark/services/archiveloader.h"
|
#include "engines/stark/services/archiveloader.h"
|
||||||
|
#include "engines/stark/services/global.h"
|
||||||
#include "engines/stark/services/resourceprovider.h"
|
#include "engines/stark/services/resourceprovider.h"
|
||||||
|
|
||||||
#include "common/file.h"
|
#include "common/file.h"
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
#include "engines/stark/debug.h"
|
#include "engines/stark/debug.h"
|
||||||
#include "engines/stark/resources/level.h"
|
#include "engines/stark/resources/level.h"
|
||||||
#include "engines/stark/resources/location.h"
|
#include "engines/stark/resources/location.h"
|
||||||
|
#include "engines/stark/services/global.h"
|
||||||
#include "engines/stark/services/resourceprovider.h"
|
#include "engines/stark/services/resourceprovider.h"
|
||||||
#include "engines/stark/stark.h"
|
#include "engines/stark/stark.h"
|
||||||
|
|
||||||
|
|
|
@ -22,14 +22,14 @@
|
||||||
|
|
||||||
#include "common/debug.h"
|
#include "common/debug.h"
|
||||||
|
|
||||||
#include "engines/stark/services/archiveloader.h"
|
|
||||||
#include "engines/stark/resources/anim.h"
|
#include "engines/stark/resources/anim.h"
|
||||||
#include "engines/stark/resources/bonesmesh.h"
|
#include "engines/stark/resources/bonesmesh.h"
|
||||||
#include "engines/stark/resources/direction.h"
|
#include "engines/stark/resources/direction.h"
|
||||||
#include "engines/stark/resources/image.h"
|
#include "engines/stark/resources/image.h"
|
||||||
#include "engines/stark/resources/item.h"
|
#include "engines/stark/resources/item.h"
|
||||||
#include "engines/stark/resources/textureset.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/skeleton_anim.h"
|
||||||
#include "engines/stark/stark.h"
|
#include "engines/stark/stark.h"
|
||||||
#include "engines/stark/visual/actor.h"
|
#include "engines/stark/visual/actor.h"
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
#include "common/random.h"
|
#include "common/random.h"
|
||||||
|
|
||||||
#include "engines/stark/resources/anim.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/stark.h"
|
||||||
#include "engines/stark/xrcreader.h"
|
#include "engines/stark/xrcreader.h"
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
#include "engines/stark/resources/command.h"
|
#include "engines/stark/resources/command.h"
|
||||||
#include "engines/stark/resources/item.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/stark.h"
|
||||||
#include "engines/stark/xrcreader.h"
|
#include "engines/stark/xrcreader.h"
|
||||||
|
|
||||||
|
|
105
engines/stark/services/global.h
Normal file
105
engines/stark/services/global.h
Normal file
|
@ -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
|
|
@ -22,7 +22,6 @@
|
||||||
|
|
||||||
#include "engines/stark/services/resourceprovider.h"
|
#include "engines/stark/services/resourceprovider.h"
|
||||||
|
|
||||||
#include "engines/stark/services/archiveloader.h"
|
|
||||||
#include "engines/stark/resources/camera.h"
|
#include "engines/stark/resources/camera.h"
|
||||||
#include "engines/stark/resources/floor.h"
|
#include "engines/stark/resources/floor.h"
|
||||||
#include "engines/stark/resources/layer.h"
|
#include "engines/stark/resources/layer.h"
|
||||||
|
@ -30,6 +29,8 @@
|
||||||
#include "engines/stark/resources/location.h"
|
#include "engines/stark/resources/location.h"
|
||||||
#include "engines/stark/resources/root.h"
|
#include "engines/stark/resources/root.h"
|
||||||
#include "engines/stark/resources/script.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"
|
#include "engines/stark/services/stateprovider.h"
|
||||||
|
|
||||||
namespace Stark {
|
namespace Stark {
|
||||||
|
|
|
@ -27,85 +27,15 @@
|
||||||
|
|
||||||
namespace Stark {
|
namespace Stark {
|
||||||
|
|
||||||
class Camera;
|
|
||||||
class Floor;
|
|
||||||
class Level;
|
class Level;
|
||||||
class Location;
|
class Location;
|
||||||
class Resource;
|
class Resource;
|
||||||
class Root;
|
|
||||||
|
|
||||||
class ArchiveLoader;
|
class ArchiveLoader;
|
||||||
|
class Current;
|
||||||
|
class Global;
|
||||||
class StateProvider;
|
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.
|
* Game Resource provider.
|
||||||
*
|
*
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
#include "engines/stark/resources/location.h"
|
#include "engines/stark/resources/location.h"
|
||||||
#include "engines/stark/scene.h"
|
#include "engines/stark/scene.h"
|
||||||
#include "engines/stark/services/archiveloader.h"
|
#include "engines/stark/services/archiveloader.h"
|
||||||
|
#include "engines/stark/services/global.h"
|
||||||
#include "engines/stark/services/resourceprovider.h"
|
#include "engines/stark/services/resourceprovider.h"
|
||||||
#include "engines/stark/services/stateprovider.h"
|
#include "engines/stark/services/stateprovider.h"
|
||||||
#include "engines/stark/gfx/driver.h"
|
#include "engines/stark/gfx/driver.h"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue