diff --git a/apps/openmw/main.cpp b/apps/openmw/main.cpp index 4d7e6595c..697b06e93 100644 --- a/apps/openmw/main.cpp +++ b/apps/openmw/main.cpp @@ -47,8 +47,14 @@ bool parseOptions (int argc, char**argv, OMW::Engine& engine) "set resources directory") ("start", bpo::value()->default_value ("Beshara"), "set initial cell") - ("master", bpo::value()->default_value ("Morrowind"), - "master file") + ("master", bpo::value >() + ->default_value (std::vector(), "") + ->multitoken(), + "master file(s)") + ("plugin", bpo::value >() + ->default_value (std::vector(), "") + ->multitoken(), + "plugin file(s)") ( "showfps", "show fps counter") ( "debug", "debug mode" ) ( "nosound", "disable all sound" ) @@ -83,26 +89,51 @@ bool parseOptions (int argc, char**argv, OMW::Engine& engine) return false; } + // directory settings engine.setDataDir (variables["data"].as()); engine.setResourceDir (variables["resources"].as()); - engine.setCell (variables["start"].as()); - engine.addMaster (variables["master"].as()); - if (variables.count ("showfps")) + // master and plugin + std::vector master = variables["master"].as >(); + if (master.empty()) + { + std::cout << "No master file given. Assuming Morrowind.esm" << std::endl; + master.push_back ("Morrowind"); + } + + if (master.size()>1) + { + std::cout + << "Ignoring all but the first master file (multiple master files not yet supported)." + << std::endl; + } + + engine.addMaster (master[0]); + + std::vector plugin = variables["plugin"].as >(); + + if (!plugin.empty()) + std::cout << "Ignoring plugin files (plugins not yet supported)." << std::endl; + + // startup-settings + engine.setCell (variables["start"].as()); + + if (variables.count ("new-game")) + engine.setNewGame(); + + // other settings + if (variables.count ("fps")) engine.showFPS(); if (variables.count ("debug")) engine.enableDebugMode(); - if (variables.count ("nosound")) + if (variables.count ("no-sound")) engine.disableSound(); if (variables.count ("script-verbose")) engine.enableVerboseScripts(); - if (variables.count ("new-game")) - engine.setNewGame(); - if (variables.count ("script-all")) engine.setCompileAll (true);