Backslash working in linux

actorid
Jason Hooks 14 years ago
parent b92955763a
commit 2aaa0f4578

@ -300,6 +300,8 @@ 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";
}

@ -118,7 +118,7 @@ namespace MWClass
Ogre::Vector3 pos2 = Ogre::Vector3( 0, .5, 75);
if (groin){
//cellRender.insertMesh("Meshes/bald_MJ_hat.NIF"); //w/W_6th_Hammer.NIF
cellRender.insertMesh("Meshes\\bald_MJ_hat.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";

@ -49,9 +49,33 @@ class DirArchive: public Ogre::FileSystemArchive
void load() {}
void unload() {}
bool exists(const String& filename) {
std::string copy = filename;
if(OGRE_PLATFORM != OGRE_PLATFORM_WIN32)
{
for (int i = 0; i < filename.size(); i++)
{
if(copy.at(i) == '\\' ){
copy.replace(i, 1, "/");
}
}
}
return FileSystemArchive::exists(copy);
}
DataStreamPtr open(const String& filename, bool readonly = true) const
{
std::string copy = filename;
if(OGRE_PLATFORM != OGRE_PLATFORM_WIN32){
//std::cout << "In Open\n";
for (int i = 0; i < filename.size(); i++)
{
if(copy.at(i) == '\\' ){
copy.replace(i, 1, "/");
}
}
}
return FileSystemArchive::open(copy, readonly);
}

Loading…
Cancel
Save