Merge branch 'master' into 1.5

This commit is contained in:
Wojtek Figat
2022-10-29 20:45:51 +02:00
24 changed files with 259 additions and 67 deletions

View File

@@ -1552,21 +1552,21 @@ bool ModelTool::ImportModel(const String& path, ModelData& meshData, Options& op
int32 ModelTool::DetectLodIndex(const String& nodeName)
{
const int32 index = nodeName.FindLast(TEXT("LOD"));
int32 index = nodeName.FindLast(TEXT("LOD"), StringSearchCase::IgnoreCase);
if (index != -1)
{
// Some models use LOD_0 to identify LOD levels
if (nodeName.Length() > index + 4 && nodeName[index + 3] == '_')
index++;
int32 num;
if (!StringUtils::Parse(nodeName.Get() + index + 3, &num))
{
if (num >= 0 && num < MODEL_MAX_LODS)
{
return num;
}
LOG(Warning, "Invalid mesh level of detail index at node \'{0}\'. Maximum supported amount of LODs is {1}.", nodeName, MODEL_MAX_LODS);
}
}
return 0;
}