diff --git a/apps/openmw/engine.cpp b/apps/openmw/engine.cpp index a899a5aea..a160e0993 100644 --- a/apps/openmw/engine.cpp +++ b/apps/openmw/engine.cpp @@ -93,51 +93,6 @@ bool OMW::Engine::frameRenderingQueued (const Ogre::FrameEvent& evt) std::string effect; MWWorld::Ptr::CellStore *current = mEnvironment.mWorld->getPlayer().getPlayer().getCell(); - /* - ESMS::CellRefList::List creatureData = (current->creatures).list; - ESMS::CellRefList::List::iterator creaturedataiter = creatureData.begin(); - - for(int i = 0; i < creatureData.size(); i++) - { - //std::cout << "Testing" << i < "\n"; - ESMS::LiveCellRef item = *creaturedataiter; - Ogre::Entity* creaturemodel = item.model; - - if(evt.timeSinceLastFrame == 0) - creaturemodel->getSkeleton()->setBindingPose(); - creaturemodel->getSkeleton()->setBlendMode(Ogre::SkeletonAnimationBlendMode::ANIMBLEND_AVERAGE); //ANIMBLEND_AVERAGE - Ogre::AnimationState *mAnimationState = creaturemodel->getAnimationState("WholeThing"); - mAnimationState->setWeight(.5); - mAnimationState->setLoop(true); - //npcmodel->getSkeleton()-> - - mAnimationState->setEnabled(true); - - - - - Ogre::AnimationState *mAnimationState2 = creaturemodel->getAnimationState("WholeThing2"); - mAnimationState2->setLoop(true); - mAnimationState2->setWeight(.5); - mAnimationState2->setEnabled(true); - - mAnimationState2->createBlendMask(creaturemodel->getSkeleton()->getNumBones(),1); - mAnimationState->createBlendMask(creaturemodel->getSkeleton()->getNumBones(),1); - for(int j = 2; j < creaturemodel->getSkeleton()->getNumBones(); j++) - { - mAnimationState->setBlendMaskEntry(j,1); - mAnimationState2->setBlendMaskEntry(j,1); - } - // set skeleton - std::cout << "TimePosition:" << mAnimationState->getTimePosition() << "\n"; - - mAnimationState->addTime(evt.timeSinceLastFrame); - mAnimationState2->addTime(evt.timeSinceLastFrame); - //npcmodel->_updateAnimation(); - //mAnimationState2->setEnabled(true); - creaturedataiter++; - }*/ - //If the region has changed @@ -299,9 +254,7 @@ void OMW::Engine::loadBSA() std::string m = mDataDir.string(); std::cout << "Data dir" << m << "\n"; - addDir(m); - //std::string s = "f\n"; - //std::cout <<"S: " << s.size() << "\n"; + addDir(m, mFSStrict); } diff --git a/apps/openmw/mwclass/npc.cpp b/apps/openmw/mwclass/npc.cpp index 5afc26480..88d3ee136 100644 --- a/apps/openmw/mwclass/npc.cpp +++ b/apps/openmw/mwclass/npc.cpp @@ -118,7 +118,7 @@ namespace MWClass Ogre::Vector3 pos2 = Ogre::Vector3( 0, .5, 75); if (groin){ - cellRender.insertMesh("Meshes\\2\\red_MJ_hat_org.nif"); //w/W_6th_Hammer.NIF + cellRender.insertMesh("meshes\\2\\red_MJ_hat_ORg.nif"); //w/W_6th_Hammer.NIF //bald_MJ_hat.NIF cellRender.insertMesh("meshes\\" + groin->model, pos2, axis, kOgrePi, npcName + "groin", addresses, numbers); addresses2[numbers] = npcName + "groin"; diff --git a/components/bsa/bsa_archive.cpp b/components/bsa/bsa_archive.cpp index 99848649a..8e3da70e0 100644 --- a/components/bsa/bsa_archive.cpp +++ b/components/bsa/bsa_archive.cpp @@ -41,6 +41,8 @@ struct ciLessBoost : std::binary_function } }; +static bool fsstrict = false; + /// An OGRE Archive wrapping a BSAFile archive class DirArchive: public Ogre::FileSystemArchive { @@ -70,8 +72,8 @@ class DirArchive: public Ogre::FileSystemArchive std::string s = name; cutoff = s.size() + 1; //std::cout << "Cut off:" << cutoff; - - populateMap(currentdir); + if(fsstrict == false) + populateMap(currentdir); } void populateMap(boost::filesystem::path d){ @@ -111,7 +113,7 @@ class DirArchive: public Ogre::FileSystemArchive } - bool isCaseSensitive() const { return false; } + bool isCaseSensitive() const { return fsstrict; } // The archive is loaded in the constructor, and never unloaded. void load() {} @@ -134,7 +136,13 @@ class DirArchive: public Ogre::FileSystemArchive copy.replace(i, 1, "/"); } } + if(fsstrict == true) + { + std::cout << "fsstrict " << copy << "\n"; + return FileSystemArchive::exists(copy); + } + std::cout << "afterstrict\n"; if(copy.at(0) == '\\' || copy.at(0) == '/') { @@ -144,8 +152,7 @@ class DirArchive: public Ogre::FileSystemArchive //std::cout << "After:" << copy.size(); } - - //boost::filesystem::path p = copy; + int last = copy.size() - 1; int i = last; @@ -196,7 +203,11 @@ class DirArchive: public Ogre::FileSystemArchive copy.replace(i, 1, "/"); } } - + if(fsstrict == true){ + std::cout << "fsstrict " << copy << "\n"; + return FileSystemArchive::open(copy, readonly); + } + std::cout << "afterstrict\n"; if(copy.at(0) == '\\' || copy.at(0) == '/') { @@ -205,6 +216,9 @@ class DirArchive: public Ogre::FileSystemArchive //std::cout << "The copy" << copy << "\n"; //std::cout << "After:" << copy.size(); } + + + //boost::filesystem::path p = copy; int last = copy.size() - 1; @@ -374,6 +388,7 @@ public: static bool init = false; static bool init2 = false; + static void insertBSAFactory() { if(!init) @@ -400,9 +415,11 @@ void addBSA(const std::string& name, const std::string& group) ResourceGroupManager::getSingleton(). addResourceLocation(name, "BSA", group); } -void addDir(const std::string& name, const std::string& group) +void addDir(const std::string& name, const bool& fs, const std::string& group) { + fsstrict = fs; insertDirFactory(); + ResourceGroupManager::getSingleton(). addResourceLocation(name, "Dir", group); } diff --git a/components/bsa/bsa_archive.hpp b/components/bsa/bsa_archive.hpp index a72f638e3..bf7e7ee51 100644 --- a/components/bsa/bsa_archive.hpp +++ b/components/bsa/bsa_archive.hpp @@ -32,6 +32,6 @@ /// Add the given BSA file as an input archive in the Ogre resource /// system. void addBSA(const std::string& file, const std::string& group="General"); -void addDir(const std::string& file, const std::string& group="General"); +void addDir(const std::string& file, const bool& fs, const std::string& group="General"); #endif