mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-06 16:15:33 +00:00
trying strict
This commit is contained in:
parent
3a9007849d
commit
65cc0e8317
4 changed files with 27 additions and 57 deletions
|
@ -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<ESM::Creature,MWWorld::RefData>::List creatureData = (current->creatures).list;
|
||||
ESMS::CellRefList<ESM::Creature,MWWorld::RefData>::List::iterator creaturedataiter = creatureData.begin();
|
||||
|
||||
for(int i = 0; i < creatureData.size(); i++)
|
||||
{
|
||||
//std::cout << "Testing" << i < "\n";
|
||||
ESMS::LiveCellRef<ESM::Creature,MWWorld::RefData> 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);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -41,6 +41,8 @@ struct ciLessBoost : std::binary_function<std::string, std::string, bool>
|
|||
}
|
||||
};
|
||||
|
||||
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);
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue