mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-09-27 23:21:20 -04:00
Avoid underflows if the texture name doesn't include a '.'
This commit is contained in:
parent
3f19b13695
commit
1d4d67f811
@ -537,14 +537,11 @@ static Ogre::String getMaterial(const NiTriShape *shape, const Ogre::String &nam
|
|||||||
* textures from tga to dds for increased load speed, but all
|
* textures from tga to dds for increased load speed, but all
|
||||||
* texture file name references were kept as .tga.
|
* texture file name references were kept as .tga.
|
||||||
*/
|
*/
|
||||||
|
static const char path[] = "textures\\";
|
||||||
static const char * path = "textures\\";
|
|
||||||
|
|
||||||
texName = path + st->filename;
|
texName = path + st->filename;
|
||||||
|
|
||||||
Ogre::String::size_type pos = texName.rfind('.');
|
Ogre::String::size_type pos = texName.rfind('.');
|
||||||
|
if(pos != Ogre::String::npos && texName.compare(pos, texName.length() - pos, ".dds") != 0)
|
||||||
if (texName.compare (pos, texName.size () - pos, ".dds") != 0)
|
|
||||||
{
|
{
|
||||||
// since we know all (GOTY edition or less) textures end
|
// since we know all (GOTY edition or less) textures end
|
||||||
// in .dds, we change the extension
|
// in .dds, we change the extension
|
||||||
|
Loading…
x
Reference in New Issue
Block a user