forked from teamnwah/openmw-tes3coop
extended --start switch for exterior cell support
This commit is contained in:
parent
c16f79afc6
commit
8659ce3a82
2 changed files with 22 additions and 11 deletions
|
@ -264,9 +264,20 @@ void OMW::Engine::go()
|
|||
|
||||
// load cell
|
||||
ESM::Position pos;
|
||||
pos.pos[0] = pos.pos[1] = pos.pos[2] = 0;
|
||||
pos.rot[0] = pos.rot[1] = pos.rot[2] = 0;
|
||||
mEnvironment.mWorld->changeCell (mCellName, pos);
|
||||
pos.pos[2] = 0;
|
||||
|
||||
if (const ESM::Cell *exterior = mEnvironment.mWorld->getExterior (mCellName))
|
||||
{
|
||||
mEnvironment.mWorld->indexToPosition (exterior->data.gridX, exterior->data.gridY,
|
||||
pos.pos[0], pos.pos[1], true);
|
||||
mEnvironment.mWorld->changeToExteriorCell (pos);
|
||||
}
|
||||
else
|
||||
{
|
||||
pos.pos[0] = pos.pos[1] = 0;
|
||||
mEnvironment.mWorld->changeCell (mCellName, pos);
|
||||
}
|
||||
|
||||
// Sets up the input system
|
||||
MWInput::MWInputManager input(mOgre, mEnvironment.mWorld->getPlayerPos(),
|
||||
|
|
|
@ -17,7 +17,7 @@ using namespace std;
|
|||
bool parseOptions (int argc, char**argv, OMW::Engine& engine)
|
||||
{
|
||||
// Create a local alias for brevity
|
||||
namespace bpo = boost::program_options;
|
||||
namespace bpo = boost::program_options;
|
||||
|
||||
bpo::options_description desc (
|
||||
"Syntax: openmw <options>\nAllowed options");
|
||||
|
@ -27,7 +27,7 @@ bool parseOptions (int argc, char**argv, OMW::Engine& engine)
|
|||
("data", bpo::value<std::string>()->default_value ("data"),
|
||||
"set data directory")
|
||||
("start", bpo::value<std::string>()->default_value ("Beshara"),
|
||||
"set initial cell (only interior cells supported at the moment")
|
||||
"set initial cell")
|
||||
("master", bpo::value<std::string>()->default_value ("Morrowind"),
|
||||
"master file")
|
||||
( "debug", "debug mode" )
|
||||
|
@ -35,15 +35,15 @@ bool parseOptions (int argc, char**argv, OMW::Engine& engine)
|
|||
( "script-verbose", "verbose script output" )
|
||||
( "new-game", "activate char gen/new game mechanics" )
|
||||
;
|
||||
|
||||
|
||||
bpo::variables_map variables;
|
||||
|
||||
|
||||
#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
|
||||
std::string configFilePath(macBundlePath() + "/Contents/MacOS/openmw.cfg");
|
||||
std::ifstream configFile (configFilePath.c_str());
|
||||
#else
|
||||
std::ifstream configFile ("openmw.cfg");
|
||||
#endif
|
||||
#endif
|
||||
|
||||
bpo::parsed_options valid_opts = bpo::command_line_parser(argc, argv).options(desc).allow_unregistered().run();
|
||||
|
||||
|
@ -62,13 +62,13 @@ bool parseOptions (int argc, char**argv, OMW::Engine& engine)
|
|||
engine.setDataDir (variables["data"].as<std::string>());
|
||||
engine.setCell (variables["start"].as<std::string>());
|
||||
engine.addMaster (variables["master"].as<std::string>());
|
||||
|
||||
|
||||
if (variables.count ("debug"))
|
||||
engine.enableDebugMode();
|
||||
|
||||
if (variables.count ("nosound"))
|
||||
engine.disableSound();
|
||||
|
||||
|
||||
if (variables.count ("script-verbose"))
|
||||
engine.enableVerboseScripts();
|
||||
|
||||
|
@ -83,7 +83,7 @@ int main(int argc, char**argv)
|
|||
try
|
||||
{
|
||||
OMW::Engine engine;
|
||||
|
||||
|
||||
if (parseOptions (argc, argv, engine))
|
||||
{
|
||||
engine.go();
|
||||
|
@ -94,6 +94,6 @@ int main(int argc, char**argv)
|
|||
cout << "\nERROR: " << e.what() << endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue