mirror of
https://github.com/OpenMW/openmw.git
synced 2025-04-01 13:36:40 +00:00
ogre 1.8 fixes
This commit is contained in:
parent
f2a7acb102
commit
99b2b6b648
5 changed files with 40 additions and 10 deletions
|
@ -63,6 +63,9 @@ namespace Ogre
|
||||||
public:
|
public:
|
||||||
SM2Profile(TerrainMaterialGenerator* parent, const String& name, const String& desc);
|
SM2Profile(TerrainMaterialGenerator* parent, const String& name, const String& desc);
|
||||||
~SM2Profile();
|
~SM2Profile();
|
||||||
|
|
||||||
|
bool isVertexCompressionSupported() const {return false;}
|
||||||
|
|
||||||
MaterialPtr generate(const Terrain* terrain);
|
MaterialPtr generate(const Terrain* terrain);
|
||||||
MaterialPtr generateForCompositeMap(const Terrain* terrain);
|
MaterialPtr generateForCompositeMap(const Terrain* terrain);
|
||||||
uint8 getMaxLayers(const Terrain* terrain) const;
|
uint8 getMaxLayers(const Terrain* terrain) const;
|
||||||
|
|
|
@ -256,8 +256,12 @@ public:
|
||||||
return DataStreamPtr(new Mangle2OgreStream(strm));
|
return DataStreamPtr(new Mangle2OgreStream(strm));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool exists(const String& filename) {
|
||||||
|
return cexists(filename);
|
||||||
|
}
|
||||||
|
|
||||||
// Check if the file exists.
|
// Check if the file exists.
|
||||||
bool exists(const String& filename) {
|
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() - 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) == ':'
|
||||||
|
@ -308,6 +312,29 @@ return arc.exists(passed.c_str());
|
||||||
located in BSAs. So instead we channel it through exists() and
|
located in BSAs. So instead we channel it through exists() and
|
||||||
set up a single-element result list if the file is found.
|
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,
|
FileInfoListPtr findFileInfo(const String& pattern, bool recursive = true,
|
||||||
bool dirs = false)
|
bool dirs = false)
|
||||||
{
|
{
|
||||||
|
@ -315,7 +342,7 @@ return arc.exists(passed.c_str());
|
||||||
|
|
||||||
// Check if the file exists (only works for single files - wild
|
// Check if the file exists (only works for single files - wild
|
||||||
// cards and recursive search isn't implemented.)
|
// cards and recursive search isn't implemented.)
|
||||||
if(exists(pattern))
|
if(cexists(pattern))
|
||||||
{
|
{
|
||||||
FileInfo fi;
|
FileInfo fi;
|
||||||
fi.archive = this;
|
fi.archive = this;
|
||||||
|
|
|
@ -148,9 +148,9 @@ void BSAFile::readHeader()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get the index of a given file name, or -1 if not found
|
/// 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);
|
it = lookup.find(str);
|
||||||
|
|
||||||
if(it == lookup.end()) return -1;
|
if(it == lookup.end()) return -1;
|
||||||
|
|
|
@ -93,7 +93,7 @@ class BSAFile
|
||||||
void readHeader();
|
void readHeader();
|
||||||
|
|
||||||
/// Get the index of a given file name, or -1 if not found
|
/// 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:
|
public:
|
||||||
|
|
||||||
|
@ -119,7 +119,7 @@ class BSAFile
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/// Check if a file exists
|
/// 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
|
/** Open a file contained in the archive. Throws an exception if the
|
||||||
file doesn't exist.
|
file doesn't exist.
|
||||||
|
|
|
@ -62,17 +62,17 @@ size_t BulletShape::calculateSize() const
|
||||||
|
|
||||||
|
|
||||||
//=============================================================================================================
|
//=============================================================================================================
|
||||||
template<> BulletShapeManager *Ogre::Singleton<BulletShapeManager>::ms_Singleton = 0;
|
template<> BulletShapeManager *Ogre::Singleton<BulletShapeManager>::msSingleton = 0;
|
||||||
|
|
||||||
BulletShapeManager *BulletShapeManager::getSingletonPtr()
|
BulletShapeManager *BulletShapeManager::getSingletonPtr()
|
||||||
{
|
{
|
||||||
return ms_Singleton;
|
return msSingleton;
|
||||||
}
|
}
|
||||||
|
|
||||||
BulletShapeManager &BulletShapeManager::getSingleton()
|
BulletShapeManager &BulletShapeManager::getSingleton()
|
||||||
{
|
{
|
||||||
assert(ms_Singleton);
|
assert(msSingleton);
|
||||||
return(*ms_Singleton);
|
return(*msSingleton);
|
||||||
}
|
}
|
||||||
|
|
||||||
BulletShapeManager::BulletShapeManager()
|
BulletShapeManager::BulletShapeManager()
|
||||||
|
|
Loading…
Reference in a new issue