aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
Diffstat (limited to 'gui')
-rw-r--r--gui/EventRecorder.cpp17
-rw-r--r--gui/about.cpp8
-rw-r--r--gui/editgamedialog.cpp4
-rw-r--r--gui/launcher.cpp7
-rw-r--r--gui/options.cpp38
-rw-r--r--gui/recorderdialog.cpp3
-rw-r--r--gui/saveload.cpp10
-rw-r--r--gui/saveload.h2
8 files changed, 44 insertions, 45 deletions
diff --git a/gui/EventRecorder.cpp b/gui/EventRecorder.cpp
index f1b486d394..39811513e3 100644
--- a/gui/EventRecorder.cpp
+++ b/gui/EventRecorder.cpp
@@ -598,8 +598,7 @@ void EventRecorder::setFileHeader() {
return;
}
TimeDate t;
- const EnginePlugin *plugin = 0;
- GameDescriptor desc = EngineMan.findGame(ConfMan.getActiveDomainName(), &plugin);
+ GameDescriptor desc = EngineMan.findGame(ConfMan.getActiveDomainName());
g_system->getTimeAndDate(t);
if (_author.empty()) {
setAuthor("Unknown Author");
@@ -619,19 +618,19 @@ SDL_Surface *EventRecorder::getSurface(int width, int height) {
bool EventRecorder::switchMode() {
const Common::String gameId = ConfMan.get("gameid");
- const EnginePlugin *plugin = 0;
+ const Plugin *plugin = nullptr;
EngineMan.findGame(gameId, &plugin);
- bool metaInfoSupport = (*plugin)->hasFeature(MetaEngine::kSavesSupportMetaInfo);
+ bool metaInfoSupport = plugin->get<MetaEngine>().hasFeature(MetaEngine::kSavesSupportMetaInfo);
bool featuresSupport = metaInfoSupport &&
g_engine->canSaveGameStateCurrently() &&
- (*plugin)->hasFeature(MetaEngine::kSupportsListSaves) &&
- (*plugin)->hasFeature(MetaEngine::kSupportsDeleteSave);
+ plugin->get<MetaEngine>().hasFeature(MetaEngine::kSupportsListSaves) &&
+ plugin->get<MetaEngine>().hasFeature(MetaEngine::kSupportsDeleteSave);
if (!featuresSupport) {
return false;
}
int emptySlot = 1;
- SaveStateList saveList = (*plugin)->listSaves(gameId.c_str());
+ SaveStateList saveList = plugin->get<MetaEngine>().listSaves(gameId.c_str());
for (SaveStateList::const_iterator x = saveList.begin(); x != saveList.end(); ++x) {
int saveSlot = x->getSaveSlot();
if (saveSlot == 0) {
@@ -667,9 +666,9 @@ bool EventRecorder::checkForContinueGame() {
void EventRecorder::deleteTemporarySave() {
if (_temporarySlot == -1) return;
const Common::String gameId = ConfMan.get("gameid");
- const EnginePlugin *plugin = 0;
+ const Plugin *plugin = 0;
EngineMan.findGame(gameId, &plugin);
- (*plugin)->removeSaveState(gameId.c_str(), _temporarySlot);
+ plugin->get<MetaEngine>().removeSaveState(gameId.c_str(), _temporarySlot);
_temporarySlot = -1;
}
diff --git a/gui/about.cpp b/gui/about.cpp
index bde5db310a..25912557f9 100644
--- a/gui/about.cpp
+++ b/gui/about.cpp
@@ -110,16 +110,16 @@ AboutDialog::AboutDialog()
engines += _("Available engines:");
addLine(engines.c_str());
- const EnginePlugin::List &plugins = EngineMan.getPlugins();
- EnginePlugin::List::const_iterator iter = plugins.begin();
+ const PluginList &plugins = EngineMan.getPlugins();
+ PluginList::const_iterator iter = plugins.begin();
for (; iter != plugins.end(); ++iter) {
Common::String str;
str = "C0";
- str += (**iter).getName();
+ str += (*iter)->getName();
addLine(str.c_str());
str = "C2";
- str += (**iter)->getOriginalCopyright();
+ str += (*iter)->get<MetaEngine>().getOriginalCopyright();
addLine(str.c_str());
//addLine("");
diff --git a/gui/editgamedialog.cpp b/gui/editgamedialog.cpp
index 94c74b40c0..348ba5cb91 100644
--- a/gui/editgamedialog.cpp
+++ b/gui/editgamedialog.cpp
@@ -97,7 +97,7 @@ protected:
EditGameDialog::EditGameDialog(const String &domain, const String &desc)
: OptionsDialog(domain, "GameOptions") {
// Retrieve all game specific options.
- const EnginePlugin *plugin = 0;
+ const Plugin *plugin = nullptr;
// To allow for game domains without a gameid.
// TODO: Is it intentional that this is still supported?
String gameId(ConfMan.get("gameid", domain));
@@ -107,7 +107,7 @@ EditGameDialog::EditGameDialog(const String &domain, const String &desc)
// implementation.
EngineMan.findGame(gameId, &plugin);
if (plugin) {
- _engineOptions = (*plugin)->getExtraGuiOptions(domain);
+ _engineOptions = plugin->get<MetaEngine>().getExtraGuiOptions(domain);
} else {
warning("Plugin for target \"%s\" not found! Game specific settings might be missing", domain.c_str());
}
diff --git a/gui/launcher.cpp b/gui/launcher.cpp
index 3ed1236a91..fd75674300 100644
--- a/gui/launcher.cpp
+++ b/gui/launcher.cpp
@@ -504,7 +504,7 @@ void LauncherDialog::loadGame(int item) {
if (gameId.empty())
gameId = _domains[item];
- const EnginePlugin *plugin = 0;
+ const Plugin *plugin = nullptr;
EngineMan.findGame(gameId, &plugin);
@@ -512,8 +512,9 @@ void LauncherDialog::loadGame(int item) {
target.toLowercase();
if (plugin) {
- if ((*plugin)->hasFeature(MetaEngine::kSupportsListSaves) &&
- (*plugin)->hasFeature(MetaEngine::kSupportsLoadingDuringStartup)) {
+ const MetaEngine &metaEngine = plugin->get<MetaEngine>();
+ if (metaEngine.hasFeature(MetaEngine::kSupportsListSaves) &&
+ metaEngine.hasFeature(MetaEngine::kSupportsLoadingDuringStartup)) {
int slot = _loadDialog->runModalWithPluginAndTarget(plugin, target);
if (slot >= 0) {
ConfMan.setActiveDomain(_domains[item]);
diff --git a/gui/options.cpp b/gui/options.cpp
index 82eb252cf1..f1ca21a90d 100644
--- a/gui/options.cpp
+++ b/gui/options.cpp
@@ -1040,9 +1040,9 @@ void OptionsDialog::addAudioControls(GuiObject *boss, const Common::String &pref
const Common::String allFlags = MidiDriver::musicType2GUIO((uint32)-1);
bool hasMidiDefined = (strpbrk(_guioptions.c_str(), allFlags.c_str()) != NULL);
- const MusicPlugin::List p = MusicMan.getPlugins();
- for (MusicPlugin::List::const_iterator m = p.begin(); m != p.end(); ++m) {
- MusicDevices i = (**m)->getDevices();
+ const PluginList p = MusicMan.getPlugins();
+ for (PluginList::const_iterator m = p.begin(); m != p.end(); ++m) {
+ MusicDevices i = (*m)->get<MusicPluginObject>().getDevices();
for (MusicDevices::iterator d = i.begin(); d != i.end(); ++d) {
Common::String deviceGuiOption = MidiDriver::musicType2GUIO(d->getMusicType());
@@ -1078,19 +1078,19 @@ void OptionsDialog::addMIDIControls(GuiObject *boss, const Common::String &prefi
_gmDevicePopUp = new PopUpWidget(boss, prefix + "auPrefGmPopup");
// Populate
- const MusicPlugin::List p = MusicMan.getPlugins();
+ const PluginList p = MusicMan.getPlugins();
// Make sure the null device is the first one in the list to avoid undesired
// auto detection for users who don't have a saved setting yet.
- for (MusicPlugin::List::const_iterator m = p.begin(); m != p.end(); ++m) {
- MusicDevices i = (**m)->getDevices();
+ for (PluginList::const_iterator m = p.begin(); m != p.end(); ++m) {
+ MusicDevices i = (*m)->get<MusicPluginObject>().getDevices();
for (MusicDevices::iterator d = i.begin(); d != i.end(); ++d) {
if (d->getMusicDriverId() == "null")
_gmDevicePopUp->appendEntry(_("Don't use General MIDI music"), d->getHandle());
}
}
// Now we add the other devices.
- for (MusicPlugin::List::const_iterator m = p.begin(); m != p.end(); ++m) {
- MusicDevices i = (**m)->getDevices();
+ for (PluginList::const_iterator m = p.begin(); m != p.end(); ++m) {
+ MusicDevices i = (*m)->get<MusicPluginObject>().getDevices();
for (MusicDevices::iterator d = i.begin(); d != i.end(); ++d) {
if (d->getMusicType() >= MT_GM) {
if (d->getMusicType() != MT_MT32)
@@ -1141,19 +1141,19 @@ void OptionsDialog::addMT32Controls(GuiObject *boss, const Common::String &prefi
// GS Extensions setting
_enableGSCheckbox = new CheckboxWidget(boss, prefix + "mcGSCheckbox", _("Roland GS Device (enable MT-32 mappings)"), _("Check if you want to enable patch mappings to emulate an MT-32 on a Roland GS device"));
- const MusicPlugin::List p = MusicMan.getPlugins();
+ const PluginList p = MusicMan.getPlugins();
// Make sure the null device is the first one in the list to avoid undesired
// auto detection for users who don't have a saved setting yet.
- for (MusicPlugin::List::const_iterator m = p.begin(); m != p.end(); ++m) {
- MusicDevices i = (**m)->getDevices();
+ for (PluginList::const_iterator m = p.begin(); m != p.end(); ++m) {
+ MusicDevices i = (*m)->get<MusicPluginObject>().getDevices();
for (MusicDevices::iterator d = i.begin(); d != i.end(); ++d) {
if (d->getMusicDriverId() == "null")
_mt32DevicePopUp->appendEntry(_("Don't use Roland MT-32 music"), d->getHandle());
}
}
// Now we add the other devices.
- for (MusicPlugin::List::const_iterator m = p.begin(); m != p.end(); ++m) {
- MusicDevices i = (**m)->getDevices();
+ for (PluginList::const_iterator m = p.begin(); m != p.end(); ++m) {
+ MusicDevices i = (*m)->get<MusicPluginObject>().getDevices();
for (MusicDevices::iterator d = i.begin(); d != i.end(); ++d) {
if (d->getMusicType() >= MT_GM)
_mt32DevicePopUp->appendEntry(d->getCompleteName(), d->getHandle());
@@ -1265,10 +1265,10 @@ bool OptionsDialog::loadMusicDeviceSetting(PopUpWidget *popup, Common::String se
if (_domain != Common::ConfigManager::kApplicationDomain || ConfMan.hasKey(setting, _domain) || preferredType) {
const Common::String drv = ConfMan.get(setting, (_domain != Common::ConfigManager::kApplicationDomain && !ConfMan.hasKey(setting, _domain)) ? Common::ConfigManager::kApplicationDomain : _domain);
- const MusicPlugin::List p = MusicMan.getPlugins();
+ const PluginList p = MusicMan.getPlugins();
- for (MusicPlugin::List::const_iterator m = p.begin(); m != p.end(); ++m) {
- MusicDevices i = (**m)->getDevices();
+ for (PluginList::const_iterator m = p.begin(); m != p.end(); ++m) {
+ MusicDevices i = (*m)->get<MusicPluginObject>().getDevices();
for (MusicDevices::iterator d = i.begin(); d != i.end(); ++d) {
if (setting.empty() ? (preferredType == d->getMusicType()) : (drv == d->getCompleteId())) {
popup->setSelectedTag(d->getHandle());
@@ -1285,10 +1285,10 @@ void OptionsDialog::saveMusicDeviceSetting(PopUpWidget *popup, Common::String se
if (!popup || !_enableAudioSettings)
return;
- const MusicPlugin::List p = MusicMan.getPlugins();
+ const PluginList p = MusicMan.getPlugins();
bool found = false;
- for (MusicPlugin::List::const_iterator m = p.begin(); m != p.end() && !found; ++m) {
- MusicDevices i = (**m)->getDevices();
+ for (PluginList::const_iterator m = p.begin(); m != p.end() && !found; ++m) {
+ MusicDevices i = (*m)->get<MusicPluginObject>().getDevices();
for (MusicDevices::iterator d = i.begin(); d != i.end(); ++d) {
if (d->getHandle() == popup->getSelectedTag()) {
ConfMan.set(setting, d->getCompleteId(), _domain);
diff --git a/gui/recorderdialog.cpp b/gui/recorderdialog.cpp
index c08b3e149a..7e8e12bcf8 100644
--- a/gui/recorderdialog.cpp
+++ b/gui/recorderdialog.cpp
@@ -167,8 +167,7 @@ void RecorderDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat
case kRecordCmd: {
TimeDate t;
Common::String gameId = ConfMan.get("gameid", _target);
- const EnginePlugin *plugin = 0;
- GameDescriptor desc = EngineMan.findGame(gameId, &plugin);
+ GameDescriptor desc = EngineMan.findGame(gameId);
g_system->getTimeAndDate(t);
EditRecordDialog editDlg(_("Unknown Author"), Common::String::format("%.2d.%.2d.%.4d ", t.tm_mday, t.tm_mon, 1900 + t.tm_year) + desc.description(), "");
if (editDlg.runModal() != kOKCmd) {
diff --git a/gui/saveload.cpp b/gui/saveload.cpp
index ba17dacc48..a893f3c0db 100644
--- a/gui/saveload.cpp
+++ b/gui/saveload.cpp
@@ -76,14 +76,14 @@ Common::String SaveLoadChooser::createDefaultSaveDescription(const int slot) con
int SaveLoadChooser::runModalWithCurrentTarget() {
const Common::String gameId = ConfMan.get("gameid");
- const EnginePlugin *plugin = 0;
+ const Plugin *plugin = 0;
EngineMan.findGame(gameId, &plugin);
return runModalWithPluginAndTarget(plugin, ConfMan.getActiveDomainName());
}
-int SaveLoadChooser::runModalWithPluginAndTarget(const EnginePlugin *plugin, const String &target) {
- selectChooser(**plugin);
+int SaveLoadChooser::runModalWithPluginAndTarget(const Plugin *plugin, const String &target) {
+ selectChooser(plugin->get<MetaEngine>());
if (!_impl)
return -1;
@@ -98,10 +98,10 @@ int SaveLoadChooser::runModalWithPluginAndTarget(const EnginePlugin *plugin, con
int ret;
do {
- ret = _impl->run(target, &(**plugin));
+ ret = _impl->run(target, &plugin->get<MetaEngine>());
#ifndef DISABLE_SAVELOADCHOOSER_GRID
if (ret == kSwitchSaveLoadDialog) {
- selectChooser(**plugin);
+ selectChooser(plugin->get<MetaEngine>());
}
#endif // !DISABLE_SAVELOADCHOOSER_GRID
} while (ret < -1);
diff --git a/gui/saveload.h b/gui/saveload.h
index 01a78c4924..be0bc4206f 100644
--- a/gui/saveload.h
+++ b/gui/saveload.h
@@ -51,7 +51,7 @@ public:
* @return The selcted save slot. -1 in case none is selected.
*/
int runModalWithCurrentTarget();
- int runModalWithPluginAndTarget(const EnginePlugin *plugin, const String &target);
+ int runModalWithPluginAndTarget(const Plugin *plugin, const String &target);
const Common::String &getResultString() const;