From fd5e9cf27176c3b7a120b46cfd9d63424e9476ef Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Tue, 19 Mar 2019 09:11:14 +0400 Subject: [PATCH 1/4] Catch possible boost::bad_any_cast exception --- apps/niftest/niftest.cpp | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/apps/niftest/niftest.cpp b/apps/niftest/niftest.cpp index e3f2b89f8..f848ae330 100644 --- a/apps/niftest/niftest.cpp +++ b/apps/niftest/niftest.cpp @@ -102,6 +102,17 @@ bool parseOptions (int argc, char** argv, std::vector& files) bpo::parsed_options valid_opts = bpo::command_line_parser(argc, argv). options(desc).positional(p).run(); bpo::store(valid_opts, variables); + bpo::notify(variables); + if (variables.count ("help")) + { + std::cout << desc << std::endl; + return false; + } + if (variables.count("input-file")) + { + files = variables["input-file"].as< std::vector >(); + return true; + } } catch(std::exception &e) { @@ -110,18 +121,6 @@ bool parseOptions (int argc, char** argv, std::vector& files) return false; } - bpo::notify(variables); - if (variables.count ("help")) - { - std::cout << desc << std::endl; - return false; - } - if (variables.count("input-file")) - { - files = variables["input-file"].as< std::vector >(); - return true; - } - std::cout << "No input files or directories specified!" << std::endl; std::cout << desc << std::endl; return false; From 7995a9267291a785f024a10f43710f5e625fb09e Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Tue, 19 Mar 2019 09:12:31 +0400 Subject: [PATCH 2/4] Initialize missing variables --- apps/openmw/engine.cpp | 1 + components/nifosg/controller.cpp | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/openmw/engine.cpp b/apps/openmw/engine.cpp index fb7be22b2..181ebd822 100644 --- a/apps/openmw/engine.cpp +++ b/apps/openmw/engine.cpp @@ -226,6 +226,7 @@ OMW::Engine::Engine(Files::ConfigurationManager& configurationManager) , mActivationDistanceOverride(-1) , mGrab(true) , mExportFonts(false) + , mRandomSeed(0) , mScriptContext (0) , mFSStrict (false) , mScriptBlacklistUse (true) diff --git a/components/nifosg/controller.cpp b/components/nifosg/controller.cpp index 934b3b914..4029e9b15 100644 --- a/components/nifosg/controller.cpp +++ b/components/nifosg/controller.cpp @@ -311,10 +311,11 @@ void VisController::operator() (osg::Node* node, osg::NodeVisitor* nv) RollController::RollController(const Nif::NiFloatData *data) : mData(data->mKeyList, 1.f) + , mStartingTime(0) { } -RollController::RollController() +RollController::RollController() : mStartingTime(0) { } From b2fca46206765553d719702fdddafde0a9333e48 Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Tue, 19 Mar 2019 09:14:07 +0400 Subject: [PATCH 3/4] Fix a couple of minor issues in shadows --- components/sceneutil/mwshadowtechnique.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/components/sceneutil/mwshadowtechnique.cpp b/components/sceneutil/mwshadowtechnique.cpp index b9d8e4bd3..92bf44ec1 100644 --- a/components/sceneutil/mwshadowtechnique.cpp +++ b/components/sceneutil/mwshadowtechnique.cpp @@ -777,6 +777,7 @@ MWShadowTechnique::MWShadowTechnique(const MWShadowTechnique& vdsm, const osg::C ShadowTechnique(vdsm,copyop) { _shadowRecievingPlaceholderStateSet = new osg::StateSet; + _enableShadows = vdsm._enableShadows; } MWShadowTechnique::~MWShadowTechnique() @@ -2011,18 +2012,20 @@ struct ConvexHull Vertices unwantedEdgeEnds = findInternalEdges(vertex, connectedVertices); for (auto edgeEnd : unwantedEdgeEnds) { - for (auto itr = _edges.begin(); itr != _edges.end(); ++itr) + for (auto itr = _edges.begin(); itr != _edges.end();) { if (*itr == Edge(vertex, edgeEnd)) { - _edges.erase(itr); + itr = _edges.erase(itr); break; } else if (*itr == Edge(edgeEnd, vertex)) { - _edges.erase(itr); + itr = _edges.erase(itr); break; } + else + ++itr; } } } From 7501f18d212f7cbd9dc1e7bd4b348290b0f2a651 Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Tue, 19 Mar 2019 09:16:03 +0400 Subject: [PATCH 4/4] Avoid the 'structurally dead code' warning --- apps/openmw/mwinput/inputmanagerimp.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/apps/openmw/mwinput/inputmanagerimp.cpp b/apps/openmw/mwinput/inputmanagerimp.cpp index 6f615564c..b7014c99d 100644 --- a/apps/openmw/mwinput/inputmanagerimp.cpp +++ b/apps/openmw/mwinput/inputmanagerimp.cpp @@ -196,8 +196,6 @@ namespace MWInput void InputManager::handleGuiArrowKey(int action) { - // Temporary shut-down of this function until deemed necessary. - return; if (SDL_IsTextInputActive()) return; @@ -402,7 +400,8 @@ namespace MWInput case A_MoveRight: case A_MoveForward: case A_MoveBackward: - handleGuiArrowKey(action); + // Temporary shut-down of this function until deemed necessary. + //handleGuiArrowKey(action); break; case A_Journal: toggleJournal ();