STARK: Move the service provider to a separate file
This commit is contained in:
parent
7f8f3789e5
commit
c93098e7af
18 changed files with 107 additions and 43 deletions
|
@ -30,12 +30,13 @@
|
|||
#include "engines/stark/services/archiveloader.h"
|
||||
#include "engines/stark/services/global.h"
|
||||
#include "engines/stark/services/resourceprovider.h"
|
||||
#include "engines/stark/services/services.h"
|
||||
|
||||
#include "common/file.h"
|
||||
|
||||
namespace Stark {
|
||||
|
||||
Console::Console(StarkEngine *vm) : GUI::Debugger(), _vm(vm) {
|
||||
Console::Console() : GUI::Debugger() {
|
||||
registerCmd("dumpArchive", WRAP_METHOD(Console, Cmd_DumpArchive));
|
||||
registerCmd("dumpGlobal", WRAP_METHOD(Console, Cmd_DumpGlobal));
|
||||
registerCmd("dumpLevel", WRAP_METHOD(Console, Cmd_DumpLevel));
|
||||
|
|
|
@ -27,20 +27,16 @@
|
|||
|
||||
#include "gui/debugger.h"
|
||||
|
||||
#include "engines/stark/stark.h"
|
||||
|
||||
namespace Stark {
|
||||
|
||||
class Resource;
|
||||
|
||||
class Console : public GUI::Debugger {
|
||||
public:
|
||||
Console(StarkEngine *vm);
|
||||
Console();
|
||||
virtual ~Console();
|
||||
|
||||
private:
|
||||
StarkEngine *_vm;
|
||||
|
||||
bool Cmd_DumpArchive(int argc, const char **argv);
|
||||
bool Cmd_DumpGlobal(int argc, const char **argv);
|
||||
bool Cmd_DumpLevel(int argc, const char **argv);
|
||||
|
|
|
@ -37,6 +37,7 @@ MODULE_OBJS := \
|
|||
scene.o \
|
||||
services/archiveloader.o \
|
||||
services/resourceprovider.o \
|
||||
services/services.o \
|
||||
services/stateprovider.o \
|
||||
skeleton.o \
|
||||
skeleton_anim.o \
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
#include "engines/stark/resources/location.h"
|
||||
#include "engines/stark/services/global.h"
|
||||
#include "engines/stark/services/resourceprovider.h"
|
||||
#include "engines/stark/stark.h"
|
||||
#include "engines/stark/services/services.h"
|
||||
|
||||
namespace Stark {
|
||||
|
||||
|
|
|
@ -30,8 +30,8 @@
|
|||
#include "engines/stark/resources/textureset.h"
|
||||
#include "engines/stark/services/archiveloader.h"
|
||||
#include "engines/stark/services/global.h"
|
||||
#include "engines/stark/services/services.h"
|
||||
#include "engines/stark/skeleton_anim.h"
|
||||
#include "engines/stark/stark.h"
|
||||
#include "engines/stark/visual/actor.h"
|
||||
#include "engines/stark/visual/smacker.h"
|
||||
#include "engines/stark/xrcreader.h"
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
#include "engines/stark/resources/anim.h"
|
||||
#include "engines/stark/services/global.h"
|
||||
#include "engines/stark/stark.h"
|
||||
#include "engines/stark/services/services.h"
|
||||
#include "engines/stark/xrcreader.h"
|
||||
|
||||
namespace Stark {
|
||||
|
|
|
@ -21,9 +21,9 @@
|
|||
*/
|
||||
|
||||
#include "engines/stark/actor.h"
|
||||
#include "engines/stark/services/archiveloader.h"
|
||||
#include "engines/stark/resources/bonesmesh.h"
|
||||
#include "engines/stark/stark.h"
|
||||
#include "engines/stark/services/archiveloader.h"
|
||||
#include "engines/stark/services/services.h"
|
||||
#include "engines/stark/xrcreader.h"
|
||||
|
||||
namespace Stark {
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
#include "engines/stark/debug.h"
|
||||
#include "engines/stark/scene.h"
|
||||
#include "engines/stark/stark.h"
|
||||
#include "engines/stark/services/services.h"
|
||||
#include "engines/stark/xrcreader.h"
|
||||
|
||||
namespace Stark {
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
#include "common/debug.h"
|
||||
|
||||
#include "engines/stark/services/archiveloader.h"
|
||||
#include "engines/stark/stark.h"
|
||||
#include "engines/stark/services/services.h"
|
||||
#include "engines/stark/visual/image.h"
|
||||
#include "engines/stark/xrcreader.h"
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
#include "engines/stark/resources/command.h"
|
||||
#include "engines/stark/resources/item.h"
|
||||
#include "engines/stark/services/global.h"
|
||||
#include "engines/stark/stark.h"
|
||||
#include "engines/stark/services/services.h"
|
||||
#include "engines/stark/xrcreader.h"
|
||||
|
||||
namespace Stark {
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
#include "engines/stark/services/archiveloader.h"
|
||||
#include "engines/stark/resources/textureset.h"
|
||||
#include "engines/stark/stark.h"
|
||||
#include "engines/stark/services/services.h"
|
||||
#include "engines/stark/texture.h"
|
||||
#include "engines/stark/xrcreader.h"
|
||||
|
||||
|
|
31
engines/stark/services/services.cpp
Normal file
31
engines/stark/services/services.cpp
Normal file
|
@ -0,0 +1,31 @@
|
|||
/* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "engines/stark/services/services.h"
|
||||
|
||||
namespace Common {
|
||||
DECLARE_SINGLETON(Stark::StarkServices);
|
||||
}
|
||||
|
||||
namespace Stark {
|
||||
|
||||
} // End of namespace Stark
|
61
engines/stark/services/services.h
Normal file
61
engines/stark/services/services.h
Normal file
|
@ -0,0 +1,61 @@
|
|||
/* 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_SERVICES_H
|
||||
#define STARK_SERVICES_SERVICES_H
|
||||
|
||||
#include "common/singleton.h"
|
||||
|
||||
namespace Common {
|
||||
class RandomSource;
|
||||
}
|
||||
|
||||
namespace Stark {
|
||||
|
||||
class Scene;
|
||||
class Global;
|
||||
class ArchiveLoader;
|
||||
class ResourceProvider;
|
||||
|
||||
/**
|
||||
* Public services available as a singleton
|
||||
*/
|
||||
class StarkServices : public Common::Singleton<StarkServices> {
|
||||
public:
|
||||
StarkServices() {
|
||||
global = nullptr;
|
||||
archiveLoader = nullptr;
|
||||
resourceProvider = nullptr;
|
||||
randomSource = nullptr;
|
||||
scene = nullptr;
|
||||
}
|
||||
|
||||
Global *global;
|
||||
ArchiveLoader *archiveLoader;
|
||||
ResourceProvider *resourceProvider;
|
||||
Common::RandomSource *randomSource;
|
||||
Scene *scene;
|
||||
};
|
||||
|
||||
} // End of namespace Stark
|
||||
|
||||
#endif // STARK_SERVICES_SERVICES_H
|
|
@ -26,7 +26,6 @@
|
|||
#include "engines/stark/scene.h"
|
||||
#include "engines/stark/services/archiveloader.h"
|
||||
#include "engines/stark/skeleton_anim.h"
|
||||
#include "engines/stark/stark.h"
|
||||
|
||||
#include "common/stream.h"
|
||||
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
|
||||
#include "engines/stark/services/archiveloader.h"
|
||||
#include "engines/stark/skeleton.h"
|
||||
#include "engines/stark/stark.h"
|
||||
|
||||
namespace Stark {
|
||||
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
#include "engines/stark/services/archiveloader.h"
|
||||
#include "engines/stark/services/global.h"
|
||||
#include "engines/stark/services/resourceprovider.h"
|
||||
#include "engines/stark/services/services.h"
|
||||
#include "engines/stark/services/stateprovider.h"
|
||||
#include "engines/stark/gfx/driver.h"
|
||||
#include "engines/stark/gfx/renderentry.h"
|
||||
|
@ -41,10 +42,6 @@
|
|||
#include "common/system.h"
|
||||
#include "audio/mixer.h"
|
||||
|
||||
namespace Common {
|
||||
DECLARE_SINGLETON(Stark::StarkServices);
|
||||
}
|
||||
|
||||
namespace Stark {
|
||||
|
||||
StarkEngine::StarkEngine(OSystem *syst, const ADGameDescription *gameDesc) :
|
||||
|
@ -84,7 +81,7 @@ StarkEngine::~StarkEngine() {
|
|||
}
|
||||
|
||||
Common::Error StarkEngine::run() {
|
||||
_console = new Console(this);
|
||||
_console = new Console();
|
||||
_gfx = GfxDriver::create();
|
||||
|
||||
// Get the screen prepared
|
||||
|
|
|
@ -51,26 +51,6 @@ class ArchiveLoader;
|
|||
class StateProvider;
|
||||
class ResourceProvider;
|
||||
|
||||
/**
|
||||
* Public services available as a singleton
|
||||
*/
|
||||
class StarkServices : public Common::Singleton<StarkServices> {
|
||||
public:
|
||||
StarkServices() {
|
||||
global = nullptr;
|
||||
archiveLoader = nullptr;
|
||||
resourceProvider = nullptr;
|
||||
randomSource = nullptr;
|
||||
scene = nullptr;
|
||||
}
|
||||
|
||||
Global *global;
|
||||
ArchiveLoader *archiveLoader;
|
||||
ResourceProvider *resourceProvider;
|
||||
Common::RandomSource *randomSource;
|
||||
Scene *scene;
|
||||
};
|
||||
|
||||
class StarkEngine : public Engine {
|
||||
public:
|
||||
StarkEngine(OSystem *syst, const ADGameDescription *gameDesc);
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
*/
|
||||
|
||||
#include "engines/stark/texture.h"
|
||||
#include "engines/stark/stark.h"
|
||||
|
||||
#include "common/stream.h"
|
||||
#include "common/str.h"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue