Bläddra i källkod

Merge pull request #4195 from ruyo/fix-gltf2-sparse-indicesType

Fixed an incorrect indeiciesType in the glTF2 sparse accessor.
Kim Kulling 3 år sedan
förälder
incheckning
889e559696
1 ändrade filer med 3 tillägg och 2 borttagningar
  1. 3 2
      code/AssetLib/glTF2/glTF2Asset.inl

+ 3 - 2
code/AssetLib/glTF2/glTF2Asset.inl

@@ -863,6 +863,9 @@ inline void Accessor::Read(Value &obj, Asset &r) {
             //indices componentType
             sparse->indicesType = MemberOrDefault(*indicesValue, "componentType", ComponentType_BYTE);
             //sparse->indices->Read(*indicesValue, r);
+        } else {
+            // indicesType
+            sparse->indicesType = MemberOrDefault(*sparseValue, "componentType", ComponentType_UNSIGNED_SHORT);
         }
 
         // value
@@ -875,8 +878,6 @@ inline void Accessor::Read(Value &obj, Asset &r) {
             //sparse->values->Read(*valuesValue, r);
         }
 
-        // indicesType
-        sparse->indicesType = MemberOrDefault(*sparseValue, "componentType", ComponentType_UNSIGNED_SHORT);
 
         const unsigned int elementSize = GetElementSize();
         const size_t dataSize = count * elementSize;