fix finding: possible override.
parent
e09428c95b
commit
425a784b23
|
@ -138,7 +138,11 @@ bool EmbedTexturesProcess::addTexture(aiScene* pScene, std::string path) const {
|
||||||
auto extension = path.substr(path.find_last_of('.') + 1u);
|
auto extension = path.substr(path.find_last_of('.') + 1u);
|
||||||
std::transform(extension.begin(), extension.end(), extension.begin(), ::tolower);
|
std::transform(extension.begin(), extension.end(), extension.begin(), ::tolower);
|
||||||
if (extension == "jpeg") extension = "jpg";
|
if (extension == "jpeg") extension = "jpg";
|
||||||
strcpy(pTexture->achFormatHint, extension.c_str());
|
size_t len = extension.size();
|
||||||
|
if (len > HINTMAXTEXTURELEN -1) {
|
||||||
|
len = HINTMAXTEXTURELEN - 1;
|
||||||
|
}
|
||||||
|
strncpy(pTexture->achFormatHint, extension.c_str(), len);
|
||||||
|
|
||||||
pScene->mTextures[textureId] = pTexture;
|
pScene->mTextures[textureId] = pTexture;
|
||||||
|
|
||||||
|
|
|
@ -117,6 +117,8 @@ struct aiTexel
|
||||||
|
|
||||||
#include "./Compiler/poppack1.h"
|
#include "./Compiler/poppack1.h"
|
||||||
|
|
||||||
|
#define HINTMAXTEXTURELEN 9
|
||||||
|
|
||||||
// --------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------
|
||||||
/** Helper structure to describe an embedded texture
|
/** Helper structure to describe an embedded texture
|
||||||
*
|
*
|
||||||
|
@ -166,7 +168,7 @@ struct aiTexture {
|
||||||
* E.g. 'dds\\0', 'pcx\\0', 'jpg\\0'. All characters are lower-case.
|
* E.g. 'dds\\0', 'pcx\\0', 'jpg\\0'. All characters are lower-case.
|
||||||
* The fourth character will always be '\\0'.
|
* The fourth character will always be '\\0'.
|
||||||
*/
|
*/
|
||||||
char achFormatHint[9];// 8 for string + 1 for terminator.
|
char achFormatHint[ HINTMAXTEXTURELEN ];// 8 for string + 1 for terminator.
|
||||||
|
|
||||||
/** Data of the texture.
|
/** Data of the texture.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue