ogre 1.8 fixes

actorid
scrawl 13 years ago committed by Marc Zinnschlag
parent 34d9ad0cbd
commit 8bbb02a1bd

@ -256,8 +256,12 @@ public:
return DataStreamPtr(new Mangle2OgreStream(strm));
}
bool exists(const String& filename) {
return cexists(filename);
}
// Check if the file exists.
bool exists(const String& filename) {
bool cexists(const String& filename) const {
String passed = filename;
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) == ':'
@ -308,6 +312,29 @@ return arc.exists(passed.c_str());
located in BSAs. So instead we channel it through exists() and
set up a single-element result list if the file is found.
*/
FileInfoListPtr findFileInfo(const String& pattern, bool recursive = true,
bool dirs = false) const
{
FileInfoListPtr ptr = FileInfoListPtr(new FileInfoList());
// Check if the file exists (only works for single files - wild
// cards and recursive search isn't implemented.)
if(cexists(pattern))
{
FileInfo fi;
fi.archive = this;
fi.filename = pattern;
// It apparently doesn't matter that we return bogus
// information
fi.path = "";
fi.compressedSize = fi.uncompressedSize = 0;
ptr->push_back(fi);
}
return ptr;
}
FileInfoListPtr findFileInfo(const String& pattern, bool recursive = true,
bool dirs = false)
{
@ -315,7 +342,7 @@ return arc.exists(passed.c_str());
// Check if the file exists (only works for single files - wild
// cards and recursive search isn't implemented.)
if(exists(pattern))
if(cexists(pattern))
{
FileInfo fi;
fi.archive = this;

@ -148,9 +148,9 @@ void BSAFile::readHeader()
}
/// Get the index of a given file name, or -1 if not found
int BSAFile::getIndex(const char *str)
int BSAFile::getIndex(const char *str) const
{
Lookup::iterator it;
Lookup::const_iterator it;
it = lookup.find(str);
if(it == lookup.end()) return -1;

@ -93,7 +93,7 @@ class BSAFile
void readHeader();
/// Get the index of a given file name, or -1 if not found
int getIndex(const char *str);
int getIndex(const char *str) const;
public:
@ -119,7 +119,7 @@ class BSAFile
*/
/// Check if a file exists
bool exists(const char *file) { return getIndex(file) != -1; }
bool exists(const char *file) const { return getIndex(file) != -1; }
/** Open a file contained in the archive. Throws an exception if the
file doesn't exist.

@ -63,17 +63,17 @@ size_t BulletShape::calculateSize() const
//=============================================================================================================
template<> BulletShapeManager *Ogre::Singleton<BulletShapeManager>::ms_Singleton = 0;
template<> BulletShapeManager *Ogre::Singleton<BulletShapeManager>::msSingleton = 0;
BulletShapeManager *BulletShapeManager::getSingletonPtr()
{
return ms_Singleton;
return msSingleton;
}
BulletShapeManager &BulletShapeManager::getSingleton()
{
assert(ms_Singleton);
return(*ms_Singleton);
assert(msSingleton);
return(*msSingleton);
}
BulletShapeManager::BulletShapeManager()

Loading…
Cancel
Save