From d1793bc4bd962c1b870028dff60ae9765696a829 Mon Sep 17 00:00:00 2001 From: Jason Hooks Date: Thu, 12 Jan 2012 20:09:55 -0500 Subject: [PATCH] Animation files in the correct directory --- apps/openmw/engine.cpp | 5 ++++- apps/openmw/mwrender/npcanimation.cpp | 1 + components/nifogre/ogre_nif_loader.cpp | 5 ++++- components/nifogre/ogre_nif_loader.hpp | 2 ++ 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/apps/openmw/engine.cpp b/apps/openmw/engine.cpp index c4623b375f..20f9dc0e74 100644 --- a/apps/openmw/engine.cpp +++ b/apps/openmw/engine.cpp @@ -102,8 +102,10 @@ void OMW::Engine::updateFocusReport (float duration) } void OMW::Engine::setAnimationVerbose(bool animverbose){ - if(animverbose) + if(animverbose){ NifOgre::NIFLoader::getSingletonPtr()->setOutputAnimFiles(true); + NifOgre::NIFLoader::getSingletonPtr()->setVerbosePath(mCfgMgr.getLogPath().string()); + } } bool OMW::Engine::frameRenderingQueued (const Ogre::FrameEvent& evt) @@ -338,6 +340,7 @@ void OMW::Engine::go() // Set up the GUI system mGuiManager = new OEngine::GUI::MyGUIManager(mOgre->getWindow(), mOgre->getScene(), false, mCfgMgr.getLogPath().string() + std::string("/")); + // Create window manager - this manages all the MW-specific GUI windows MWScript::registerExtensions (mExtensions); diff --git a/apps/openmw/mwrender/npcanimation.cpp b/apps/openmw/mwrender/npcanimation.cpp index f8755bc9ff..0ff679507c 100644 --- a/apps/openmw/mwrender/npcanimation.cpp +++ b/apps/openmw/mwrender/npcanimation.cpp @@ -284,6 +284,7 @@ void NpcAnimation::runAnimation(float timepassed){ }*/ + std::vector*>::iterator shapepartsiter = shapeparts.begin(); std::vector::iterator entitypartsiter = entityparts.begin(); while(shapepartsiter != shapeparts.end()) diff --git a/components/nifogre/ogre_nif_loader.cpp b/components/nifogre/ogre_nif_loader.cpp index b6f09eaff6..92a5713a3a 100644 --- a/components/nifogre/ogre_nif_loader.cpp +++ b/components/nifogre/ogre_nif_loader.cpp @@ -204,6 +204,9 @@ static CompareFunction getTestMode(int mode) void NIFLoader::setOutputAnimFiles(bool output){ mOutputAnimFiles = output; } +void NIFLoader::setVerbosePath(std::string path){ + verbosePath = path; +} void NIFLoader::createMaterial(const String &name, const Vector &ambient, const Vector &diffuse, @@ -1016,7 +1019,7 @@ void NIFLoader::handleNode(Nif::Node *node, int flags, std::cout << "Outputting " << cut << "\n"; - file.open(("Indices" + cut + ".txt").c_str()); + file.open((verbosePath + "/Indices" + cut + ".txt").c_str()); } for(std::vector::iterator textiter = extra->list.begin(); textiter != extra->list.end(); textiter++) diff --git a/components/nifogre/ogre_nif_loader.hpp b/components/nifogre/ogre_nif_loader.hpp index 2cacb6728d..fd16208227 100644 --- a/components/nifogre/ogre_nif_loader.hpp +++ b/components/nifogre/ogre_nif_loader.hpp @@ -118,6 +118,7 @@ class NIFLoader : Ogre::ManualResourceLoader Ogre::Quaternion convertRotation(const Nif::Matrix& rot); void setOutputAnimFiles(bool output); + void setVerbosePath(std::string path); private: NIFLoader() : mNormaliseNormals(false), resourceGroup("General"), resourceName(""), flip(false), @@ -163,6 +164,7 @@ class NIFLoader : Ogre::ManualResourceLoader // extension from .tga to .dds if the texture is missing. Mangle::VFS::OgreVFS *vfs; + std::string verbosePath; std::string resourceName; std::string resourceGroup; Ogre::Matrix4 mTransform;