diff --git a/base/gameDetector.cpp b/base/gameDetector.cpp index e05b747624d..1b88b0a37dd 100644 --- a/base/gameDetector.cpp +++ b/base/gameDetector.cpp @@ -664,15 +664,15 @@ const ScummVM::String& GameDetector::getGameName() { return _gameText; } -int GameDetector::detectMain() { +bool GameDetector::detectMain() { if (_gameFileName.isEmpty()) { warning("No game was specified..."); - return (-1); + return false; } if (!detectGame()) { - warning("Game detection failed. Using default settings"); - _gameText = "Please choose a game"; + warning("%s is an invalid target. Use the -z parameter to list targets", _gameFileName.c_str()); + return false; } /* Use the adlib sound driver if auto mode is selected, @@ -713,7 +713,7 @@ int GameDetector::detectMain() { #endif } - return (0); + return true; } OSystem *GameDetector::createSystem() { diff --git a/base/gameDetector.h b/base/gameDetector.h index f5c2afe6bae..606f4d24a08 100644 --- a/base/gameDetector.h +++ b/base/gameDetector.h @@ -113,7 +113,7 @@ public: GameDetector(); void parseCommandLine(int argc, char **argv); - int detectMain(); + bool detectMain(); void setGame(const String &name); const String& getGameName(void); diff --git a/base/main.cpp b/base/main.cpp index 247fcb9f9d5..6df2ae44a1a 100644 --- a/base/main.cpp +++ b/base/main.cpp @@ -249,7 +249,7 @@ int main(int argc, char *argv[]) { launcherDialog(detector, system); // Verify the given game name - if (!detector.detectMain()) { + if (detector.detectMain()) { // Set the window caption to the game name prop.caption = g_config->get("description", detector._gameFileName); if (prop.caption == NULL) @@ -265,11 +265,7 @@ int main(int argc, char *argv[]) { // Create the game engine Engine *engine = detector.createEngine(system); - - // print a message if gameid is invalid - if (engine == NULL) - error("%s is an invalid target. Use the -z parameter to list targets", - detector._gameFileName.c_str()); + assert(engine); // Run the game engine engine->go(); diff --git a/base/plugins.cpp b/base/plugins.cpp index e963913a5a8..6b70b77393d 100644 --- a/base/plugins.cpp +++ b/base/plugins.cpp @@ -243,6 +243,18 @@ void PluginManager::loadPlugins() { #else // Load dynamic plugins // TODO... this is right now just a nasty hack. + // This should search one or multiple directories for all plugins it can + // find (to this end, we maybe should use a special prefix/suffix; e.g. + // instead of libscumm.so, use scumm.engine or scumm.plugin etc.). + // + // The list of directories to search could be e.g.: + // User specified (via config file), ".", "./plugins", "$(prefix)/lib". + // + // We also need to add code which ensures what we are looking at is + // a) a ScummVM engine and b) matches the version of the executable. + // Hence one more symbol should be exported by plugins which returns + // the "ABI" version the plugin was built for, and we can compare that + // to the ABI version of the executable. #ifndef DISABLE_SCUMM tryLoadPlugin(new DynamicPlugin("scumm/libscumm.so")); #endif