From 0a1dda22b2fa08b0d8712f60fd11f5090f2955f1 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sat, 4 Jun 2016 17:53:51 +0200 Subject: [PATCH] ColladaParser: add warning when empty semantic will be parsed. --- code/ColladaParser.cpp | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/code/ColladaParser.cpp b/code/ColladaParser.cpp index 680390a89..527e2ed5f 100644 --- a/code/ColladaParser.cpp +++ b/code/ColladaParser.cpp @@ -3117,24 +3117,29 @@ aiMatrix4x4 ColladaParser::CalculateResultTransform( const std::vectorwarn( format() << "Vertex input type is empty." ); + return IT_Invalid; + } + + if( semantic == "POSITION") return IT_Position; - else if( pSemantic == "TEXCOORD") + else if( semantic == "TEXCOORD") return IT_Texcoord; - else if( pSemantic == "NORMAL") + else if( semantic == "NORMAL") return IT_Normal; - else if( pSemantic == "COLOR") + else if( semantic == "COLOR") return IT_Color; - else if( pSemantic == "VERTEX") + else if( semantic == "VERTEX") return IT_Vertex; - else if( pSemantic == "BINORMAL" || pSemantic == "TEXBINORMAL") + else if( semantic == "BINORMAL" || semantic == "TEXBINORMAL") return IT_Bitangent; - else if( pSemantic == "TANGENT" || pSemantic == "TEXTANGENT") + else if( semantic == "TANGENT" || semantic == "TEXTANGENT") return IT_Tangent; - DefaultLogger::get()->warn( format() << "Unknown vertex input type \"" << pSemantic << "\". Ignoring." ); + DefaultLogger::get()->warn( format() << "Unknown vertex input type \"" << semantic << "\". Ignoring." ); return IT_Invalid; }