fix indexOf checks by using lastIndexOf

This commit is contained in:
Stephen Birarda 2017-04-20 13:25:11 -07:00
parent 258533de7b
commit c43a4eec86
2 changed files with 2 additions and 2 deletions

View file

@ -48,7 +48,7 @@ FBXBaker::FBXBaker(const QUrl& fbxURL, const QString& baseOutputPath,
// grab the name of the FBX from the URL, this is used for folder output names
auto fileName = fbxURL.fileName();
_fbxName = fileName.left(fileName.indexOf('.', -1));
_fbxName = fileName.left(fileName.lastIndexOf('.'));
}
static const QString BAKED_OUTPUT_SUBFOLDER = "baked/";

View file

@ -31,7 +31,7 @@ TextureBaker::TextureBaker(const QUrl& textureURL, gpu::TextureType textureType,
{
// figure out the baked texture filename
auto originalFilename = textureURL.fileName();
_bakedTextureFileName = originalFilename.left(originalFilename.indexOf('.', -1)) + BAKED_TEXTURE_EXT;
_bakedTextureFileName = originalFilename.left(originalFilename.lastIndexOf('.')) + BAKED_TEXTURE_EXT;
}
void TextureBaker::bake() {