mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-17 07:07:10 +00:00
BASE: PLUGINS: Implement a getEngineId for PluginObjects, return nullptr by default.
- See comments.
This commit is contained in:
parent
a73858a3df
commit
f2dd03e7d8
@ -49,6 +49,14 @@ const char *Plugin::getName() const {
|
||||
return _pluginObject->getName();
|
||||
}
|
||||
|
||||
const char *Plugin::getEngineId() const {
|
||||
if (_type == PLUGIN_TYPE_METAENGINE) {
|
||||
return _pluginObject->getEngineId();
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
class StaticPlugin : public Plugin {
|
||||
public:
|
||||
StaticPlugin(PluginObject *pluginobject, PluginType type) {
|
||||
|
@ -152,6 +152,18 @@ public:
|
||||
|
||||
/** Returns the name of the plugin. */
|
||||
virtual const char *getName() const = 0;
|
||||
|
||||
/**
|
||||
* Returns the engine id of the plugin, if implemented.
|
||||
* This mostly has the use with MetaEngines, but if another
|
||||
* type of plugins request this, we return a nullptr.
|
||||
* This is used because MetaEngines are now available in the
|
||||
* executable, and querying this we can match a MetaEngine
|
||||
* with it's related engine.
|
||||
*/
|
||||
virtual const char *getEngineId() const {
|
||||
return nullptr;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
@ -182,6 +194,7 @@ public:
|
||||
**/
|
||||
PluginType getType() const;
|
||||
const char *getName() const;
|
||||
const char *getEngineId() const;
|
||||
|
||||
template <class T>
|
||||
T &get() const {
|
||||
|
Loading…
Reference in New Issue
Block a user