ENGINES: Rename getMetaEngine helpers

- getME -> getMetaEngineStatic (static parts)
- getMEC -> getMetaEngine (dynamic parts)
This commit is contained in:
aryanrawlani28 2020-10-02 13:10:18 +05:30 committed by Eugene Sandulenko
parent d26bbe521c
commit 992abce74a
8 changed files with 14 additions and 14 deletions

View File

@ -331,7 +331,7 @@ Common::Error CineEngine::saveGameState(int slot, const Common::String &desc, bo
}
Common::String CineEngine::getSaveStateName(int slot) const {
return getMetaEngineConnect().getSavegameFile(slot, _targetName.c_str());
return getMetaEngine().getSavegameFile(slot, _targetName.c_str());
}
bool CineEngine::canLoadGameStateCurrently() {

View File

@ -273,7 +273,7 @@ ConfigDialog::ConfigDialog() :
assert(g_engine);
const Common::String &gameDomain = ConfMan.getActiveDomainName();
const MetaEngine &metaEngineConnect = g_engine->getMetaEngineConnect();
const MetaEngine &metaEngine = g_engine->getMetaEngine();
// GUI: Add tab widget
GUI::TabWidget *tab = new GUI::TabWidget(this, "GlobalConfig.TabWidget");
@ -285,7 +285,7 @@ ConfigDialog::ConfigDialog() :
int tabId = tab->addTab(_("Game"), "GlobalConfig_Engine");
if (g_engine->hasFeature(Engine::kSupportsChangingOptionsDuringRuntime)) {
_engineOptions = metaEngineConnect.buildEngineOptionsWidgetDynamic(tab, "GlobalConfig_Engine.Container", gameDomain);
_engineOptions = metaEngine.buildEngineOptionsWidgetDynamic(tab, "GlobalConfig_Engine.Container", gameDomain);
}
if (_engineOptions) {
@ -321,7 +321,7 @@ ConfigDialog::ConfigDialog() :
// The Keymap tab
//
Common::KeymapArray keymaps = metaEngineConnect.initKeymaps(gameDomain.c_str());
Common::KeymapArray keymaps = metaEngine.initKeymaps(gameDomain.c_str());
if (!keymaps.empty()) {
tab->addTab(_("Keymaps"), "GlobalConfig_KeyMapper");
addKeyMapperControls(tab, "GlobalConfig_KeyMapper.", keymaps, gameDomain);
@ -330,7 +330,7 @@ ConfigDialog::ConfigDialog() :
//
// The Achievements tab
//
Common::AchievementsInfo achievementsInfo = metaEngineConnect.getAchievementsInfo(gameDomain);
Common::AchievementsInfo achievementsInfo = metaEngine.getAchievementsInfo(gameDomain);
if (achievementsInfo.descriptions.size() > 0) {
tab->addTab(_("Achievements"), "GlobalConfig_Achievements");
addAchievementsControls(tab, "GlobalConfig_Achievements.", achievementsInfo);

View File

@ -531,7 +531,7 @@ void Engine::saveAutosaveIfEnabled() {
if (saveFlag) {
// First check for an existing savegame in the slot, and if present, if it's an autosave
SaveStateDescriptor desc = getMetaEngineConnect().querySaveMetaInfos(
SaveStateDescriptor desc = getMetaEngine().querySaveMetaInfos(
_targetName.c_str(), getAutosaveSlot());
saveFlag = desc.getSaveSlot() == -1 || desc.isAutosave();
}
@ -865,13 +865,13 @@ EnginePlugin *Engine::getMetaEnginePlugin() const {
*/
MetaEngineStatic &Engine::getMetaEngine() {
MetaEngineStatic &Engine::getMetaEngineStatic() {
const Plugin *plugin = EngineMan.findPlugin(ConfMan.get("engineid"));
assert(plugin);
return plugin->get<MetaEngineStatic>();
}
MetaEngine &Engine::getMetaEngineConnect() {
MetaEngine &Engine::getMetaEngine() {
const Plugin *metaEnginePlugin = EngineMan.findPlugin(ConfMan.get("engineid"));
assert(metaEnginePlugin);

View File

@ -379,8 +379,8 @@ public:
*/
static bool shouldQuit();
static MetaEngineStatic &getMetaEngine();
static MetaEngine &getMetaEngineConnect();
static MetaEngineStatic &getMetaEngineStatic();
static MetaEngine &getMetaEngine();
/**
* Pause the engine. This should stop any audio playback

View File

@ -145,7 +145,7 @@ Common::String GlkMetaEngine::findFileByGameId(const Common::String &gameId) con
folder.getChildren(fslist, Common::FSNode::kListFilesOnly);
// Get the matching MetaEngine for this Engine.
const MetaEngineStatic &metaEngine = g_engine->getMetaEngine();
const MetaEngineStatic &metaEngine = g_engine->getMetaEngineStatic();
// Iterate over the files
for (Common::FSList::iterator i = fslist.begin(); i != fslist.end(); ++i) {

View File

@ -1105,7 +1105,7 @@ bool Ultima8Engine::newGame(int saveSlot) {
// First validate we still have a save file for the slot
if (saveSlot != -1) {
SaveStateDescriptor desc = getMetaEngineConnect().querySaveMetaInfos(_targetName.c_str(), saveSlot);
SaveStateDescriptor desc = getMetaEngine().querySaveMetaInfos(_targetName.c_str(), saveSlot);
if (desc.getSaveSlot() != saveSlot)
saveSlot = -1;
}

View File

@ -50,7 +50,7 @@ SXWMEGalaxyAPI::SXWMEGalaxyAPI(BaseGame *inGame, ScStack *stack) : BaseScriptabl
//////////////////////////////////////////////////////////////////////////
void SXWMEGalaxyAPI::init() {
const MetaEngine &meta = ((WintermuteEngine *)g_engine)->getMetaEngineConnect();
const MetaEngine &meta = ((WintermuteEngine *)g_engine)->getMetaEngine();
const Common::String target = BaseEngine::instance().getGameTargetName();
_achievementsInfo = meta.getAchievementsInfo(target);

View File

@ -50,7 +50,7 @@ SXSteamAPI::SXSteamAPI(BaseGame *inGame, ScStack *stack) : BaseScriptable(inGame
//////////////////////////////////////////////////////////////////////////
void SXSteamAPI::init() {
const MetaEngine &meta = ((WintermuteEngine *)g_engine)->getMetaEngineConnect();
const MetaEngine &meta = ((WintermuteEngine *)g_engine)->getMetaEngine();
const Common::String target = BaseEngine::instance().getGameTargetName();
_achievementsInfo = meta.getAchievementsInfo(target);