mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-16 22:58:09 +00:00
BASE: MAIN: Change how running games works.
- In runGame(), in main.cpp, we get a plugin of type MetaEngine. - This MetaEngine cannot createInstances, but it just a helper class. - Connect a MetaEngine class with it's factory class - MetaEngineConnect. - Then, simply call the method.
This commit is contained in:
parent
e69d9c98a4
commit
575e77522a
@ -187,7 +187,15 @@ static Common::Error runGame(const Plugin *plugin, OSystem &system, const Common
|
||||
// need to set this up before instance creation.
|
||||
metaEngine.registerDefaultSettings(target);
|
||||
|
||||
err = metaEngine.createInstance(&system, &engine);
|
||||
// Right now we have a MetaEngine plugin. We must find the matching engine plugin to
|
||||
// call createInstance and other connecting functions.
|
||||
Plugin *enginePluginToLaunchGame = PluginMan.giveEngineFromMetaEngine(plugin);
|
||||
|
||||
if (enginePluginToLaunchGame) {
|
||||
err = enginePluginToLaunchGame->get<MetaEngineConnect>().createInstance(&system, &engine);
|
||||
} else {
|
||||
err = Common::Error(Common::kEnginePluginNotFound);
|
||||
}
|
||||
}
|
||||
|
||||
// Check for errors
|
||||
|
Loading…
Reference in New Issue
Block a user