move data declaration after test if elements are in current scope.

pull/1679/head
Kim Kulling 2018-01-04 13:09:43 +01:00
parent 9efa4282fe
commit f376a3e8cd
1 changed files with 2 additions and 3 deletions

View File

@ -454,13 +454,12 @@ void ResolveVertexDataArray(std::vector<T>& data_out, const Scope& source,
ParseVectorDataArray(tempData, GetRequiredElement(source, dataElementName));
data_out.resize(vertex_count);
std::vector<int> uvIndices;
if ( !HasElement( source, indexDataElementName ) ) {
return;
}
ParseVectorDataArray(uvIndices,GetRequiredElement(source,indexDataElementName));
std::vector<int> uvIndices;
ParseVectorDataArray(uvIndices,GetRequiredElement(source,indexDataElementName));
for (size_t i = 0, e = uvIndices.size(); i < e; ++i) {
const unsigned int istart = mapping_offsets[i], iend = istart + mapping_counts[i];