Seven digit scales

pull/21/head
Jason Hooks 13 years ago
parent 897a331244
commit c4c8288af8

@ -73,14 +73,16 @@ class DirArchive: public Ogre::FileSystemArchive
{ {
{ {
String passed = filename; String passed = filename;
if(filename.at(filename.length() - 1) == '*' || filename.at(filename.length() - 1) == '?' || filename.at(filename.length() - 1) == '<' if(filename.at(filename.length() - 2) == '>' || filename.at(filename.length() - 2) == ':')
passed = filename.substr(0, filename.length() - 6);
else if(filename.at(filename.length() - 2) == '"')
passed = filename.substr(0, filename.length() - 9);
else if(filename.at(filename.length() - 1) == '*' || filename.at(filename.length() - 1) == '?' || filename.at(filename.length() - 1) == '<'
|| filename.at(filename.length() - 1) == '"' || filename.at(filename.length() - 1) == '>' || filename.at(filename.length() - 1) == ':' || filename.at(filename.length() - 1) == '"' || filename.at(filename.length() - 1) == '>' || filename.at(filename.length() - 1) == ':'
|| filename.at(filename.length() - 1) == '|') || filename.at(filename.length() - 1) == '|')
{
passed = filename.substr(0, filename.length() - 2); passed = filename.substr(0, filename.length() - 2);
}
if(filename.at(filename.length() - 2) == '>' || filename.at(filename.length() - 2) == ':')
passed = filename.substr(0, filename.length() - 6);
copy = passed; copy = passed;
} }
@ -226,14 +228,16 @@ public:
BSAFile *narc = (BSAFile*)&arc; BSAFile *narc = (BSAFile*)&arc;
String passed = filename; String passed = filename;
if(filename.at(filename.length() - 1) == '*' || filename.at(filename.length() - 1) == '?' || filename.at(filename.length() - 1) == '<' if(filename.at(filename.length() - 2) == '>' || filename.at(filename.length() - 2) == ':')
passed = filename.substr(0, filename.length() - 6);
else if(filename.at(filename.length() - 2) == '"')
passed = filename.substr(0, filename.length() - 9);
else if(filename.at(filename.length() - 1) == '*' || filename.at(filename.length() - 1) == '?' || filename.at(filename.length() - 1) == '<'
|| filename.at(filename.length() - 1) == '"' || filename.at(filename.length() - 1) == '>' || filename.at(filename.length() - 1) == ':' || filename.at(filename.length() - 1) == '"' || filename.at(filename.length() - 1) == '>' || filename.at(filename.length() - 1) == ':'
|| filename.at(filename.length() - 1) == '|') || filename.at(filename.length() - 1) == '|')
{
passed = filename.substr(0, filename.length() - 2); passed = filename.substr(0, filename.length() - 2);
}
if(filename.at(filename.length() - 2) == '>' || filename.at(filename.length() - 2) == ':')
passed = filename.substr(0, filename.length() - 6);
// Open the file // Open the file
StreamPtr strm = narc->getFile(passed.c_str()); StreamPtr strm = narc->getFile(passed.c_str());
@ -248,14 +252,16 @@ bool exists(const String& filename) {
// Check if the file exists. // Check if the file exists.
bool cexists(const String& filename) const { bool cexists(const String& filename) const {
String passed = filename; String passed = filename;
if(filename.at(filename.length() - 1) == '*' || filename.at(filename.length() - 1) == '?' || filename.at(filename.length() - 1) == '<' if(filename.at(filename.length() - 2) == '>' || filename.at(filename.length() - 2) == ':')
passed = filename.substr(0, filename.length() - 6);
else if(filename.at(filename.length() - 2) == '"')
passed = filename.substr(0, filename.length() - 9);
else if(filename.at(filename.length() - 1) == '*' || filename.at(filename.length() - 1) == '?' || filename.at(filename.length() - 1) == '<'
|| filename.at(filename.length() - 1) == '"' || filename.at(filename.length() - 1) == '>' || filename.at(filename.length() - 1) == ':' || filename.at(filename.length() - 1) == '"' || filename.at(filename.length() - 1) == '>' || filename.at(filename.length() - 1) == ':'
|| filename.at(filename.length() - 1) == '|') || filename.at(filename.length() - 1) == '|')
{
passed = filename.substr(0, filename.length() - 2); passed = filename.substr(0, filename.length() - 2);
}
if(filename.at(filename.length() - 2) == '>' || filename.at(filename.length() - 2) == ':')
passed = filename.substr(0, filename.length() - 6);
return arc.exists(passed.c_str()); return arc.exists(passed.c_str());
} }

@ -324,10 +324,11 @@ namespace Physic
RigidBody* PhysicEngine::createRigidBody(std::string mesh,std::string name,float scale) RigidBody* PhysicEngine::createRigidBody(std::string mesh,std::string name,float scale)
{ {
char uniqueID[4]; char uniqueID[8];
sprintf( uniqueID, "%1.2f", scale ); sprintf( uniqueID, "%07.3f", scale );
std::string sid = uniqueID; std::string sid = uniqueID;
std::string outputstring = mesh + sid + ">|"; std::string outputstring = mesh + uniqueID + "\"|";
//std::cout << "The string" << outputstring << "\n";
//get the shape from the .nif //get the shape from the .nif
mShapeLoader->load(outputstring,"General"); mShapeLoader->load(outputstring,"General");

Loading…
Cancel
Save