mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-13 21:31:53 +00:00
STARK: Remove the StarkGameDescription service
It's not really needed anymore now there is a settings service
This commit is contained in:
parent
388eafac80
commit
a27834fa76
@ -26,8 +26,6 @@
|
||||
#include "common/singleton.h"
|
||||
#include "common/scummsys.h"
|
||||
|
||||
struct ADGameDescription;
|
||||
|
||||
namespace Common {
|
||||
class RandomSource;
|
||||
}
|
||||
@ -68,7 +66,6 @@ public:
|
||||
gameInterface = nullptr;
|
||||
userInterface = nullptr;
|
||||
fontProvider = nullptr;
|
||||
gameDescription = nullptr;
|
||||
settings = nullptr;
|
||||
}
|
||||
|
||||
@ -84,7 +81,6 @@ public:
|
||||
GameInterface *gameInterface;
|
||||
UserInterface *userInterface;
|
||||
FontProvider *fontProvider;
|
||||
const ADGameDescription *gameDescription;
|
||||
Settings *settings;
|
||||
};
|
||||
|
||||
@ -101,7 +97,6 @@ public:
|
||||
#define StarkGameInterface StarkServices::instance().gameInterface
|
||||
#define StarkUserInterface StarkServices::instance().userInterface
|
||||
#define StarkFontProvider StarkServices::instance().fontProvider
|
||||
#define StarkGameDescription StarkServices::instance().gameDescription
|
||||
#define StarkSettings StarkServices::instance().settings
|
||||
|
||||
} // End of namespace Stark
|
||||
|
@ -29,10 +29,13 @@
|
||||
|
||||
#include "audio/mixer.h"
|
||||
|
||||
#include "engines/advancedDetector.h"
|
||||
|
||||
namespace Stark {
|
||||
|
||||
Settings::Settings(Audio::Mixer *mixer) :
|
||||
_mixer(mixer) {
|
||||
Settings::Settings(Audio::Mixer *mixer, const ADGameDescription *gd) :
|
||||
_mixer(mixer),
|
||||
_isDemo(gd->flags & ADGF_DEMO) {
|
||||
// Initialize keys
|
||||
_boolKey[kHighModel] = "enable_high_resolution_models";
|
||||
_boolKey[kSubtitle] = "subtitles";
|
||||
|
@ -26,7 +26,8 @@
|
||||
#include "common/config-manager.h"
|
||||
|
||||
#include "engines/stark/services/services.h"
|
||||
#include "engines/advancedDetector.h"
|
||||
|
||||
struct ADGameDescription;
|
||||
|
||||
namespace Audio {
|
||||
class Mixer;
|
||||
@ -56,13 +57,18 @@ public:
|
||||
kSfx
|
||||
};
|
||||
|
||||
static bool isDemo() {
|
||||
return StarkGameDescription->flags & ADGF_DEMO;
|
||||
}
|
||||
|
||||
explicit Settings(Audio::Mixer *mixer);
|
||||
Settings(Audio::Mixer *mixer, const ADGameDescription *gd);
|
||||
~Settings() {}
|
||||
|
||||
/**
|
||||
* Is this a demo version of the game?
|
||||
*
|
||||
* This is true either for 4-CD or 2-CD style demos
|
||||
*/
|
||||
bool isDemo() const {
|
||||
return _isDemo;
|
||||
}
|
||||
|
||||
/** Get the settings value */
|
||||
bool getBoolSetting(BoolSettingIndex index) { return ConfMan.getBool(_boolKey[index]); }
|
||||
int getIntSetting(IntSettingIndex index) { return ConfMan.getInt(_intKey[index]); }
|
||||
@ -81,6 +87,7 @@ public:
|
||||
private:
|
||||
Audio::Mixer *_mixer;
|
||||
bool _hasLowRes;
|
||||
const bool _isDemo;
|
||||
|
||||
const char *_boolKey[6];
|
||||
const char *_intKey[3];
|
||||
|
@ -121,7 +121,7 @@ Common::Error StarkEngine::run() {
|
||||
_diary = new Diary();
|
||||
_gameInterface = new GameInterface();
|
||||
_userInterface = new UserInterface(_gfx);
|
||||
_settings = new Settings(_mixer);
|
||||
_settings = new Settings(_mixer, _gameDescription);
|
||||
|
||||
// Setup the public services
|
||||
StarkServices &services = StarkServices::instance();
|
||||
@ -137,7 +137,6 @@ Common::Error StarkEngine::run() {
|
||||
services.gameInterface = _gameInterface;
|
||||
services.userInterface = _userInterface;
|
||||
services.fontProvider = _fontProvider;
|
||||
services.gameDescription = _gameDescription;
|
||||
services.settings = _settings;
|
||||
|
||||
// Load global resources
|
||||
|
@ -23,9 +23,10 @@
|
||||
#ifndef STARK_H
|
||||
#define STARK_H
|
||||
|
||||
#include "engines/advancedDetector.h"
|
||||
#include "engines/engine.h"
|
||||
|
||||
struct ADGameDescription;
|
||||
|
||||
namespace Common {
|
||||
class RandomSource;
|
||||
}
|
||||
@ -54,21 +55,21 @@ class Settings;
|
||||
class StarkEngine : public Engine {
|
||||
public:
|
||||
StarkEngine(OSystem *syst, const ADGameDescription *gameDesc);
|
||||
virtual ~StarkEngine();
|
||||
~StarkEngine() override;
|
||||
|
||||
/** Build a save file name for the specified target and slot */
|
||||
static Common::String formatSaveName(const char *target, int slot);
|
||||
|
||||
protected:
|
||||
// Engine APIs
|
||||
virtual Common::Error run() override;
|
||||
virtual GUI::Debugger *getDebugger() override { return (GUI::Debugger *)_console; }
|
||||
Common::Error run() override;
|
||||
GUI::Debugger *getDebugger() override { return (GUI::Debugger *)_console; }
|
||||
bool hasFeature(EngineFeature f) const override;
|
||||
bool canLoadGameStateCurrently() override;
|
||||
bool canSaveGameStateCurrently() override;
|
||||
Common::Error loadGameState(int slot) override;
|
||||
Common::Error saveGameState(int slot, const Common::String &desc) override;
|
||||
virtual void pauseEngineIntern(bool pause) override;
|
||||
void pauseEngineIntern(bool pause) override;
|
||||
|
||||
private:
|
||||
void mainLoop();
|
||||
|
@ -27,11 +27,13 @@
|
||||
#include "engines/stark/services/settings.h"
|
||||
|
||||
#include "common/config-manager.h"
|
||||
|
||||
#include "common/translation.h"
|
||||
|
||||
#include "gui/saveload.h"
|
||||
#include "gui/message.h"
|
||||
|
||||
#include "engines/engine.h"
|
||||
|
||||
namespace Stark {
|
||||
|
||||
MainMenuScreen::MainMenuScreen(Gfx::Driver *gfx, Cursor *cursor) :
|
||||
|
Loading…
Reference in New Issue
Block a user