diff --git a/code/glTF2/glTF2Asset.h b/code/glTF2/glTF2Asset.h index c27522df3..d5c50424e 100644 --- a/code/glTF2/glTF2Asset.h +++ b/code/glTF2/glTF2Asset.h @@ -375,8 +375,8 @@ struct Accessor : public Object { inline uint8_t *GetPointer(); - template - bool ExtractData(T *&outData); + template + void ExtractData(T *&outData); void WriteData(size_t count, const void *src_buffer, size_t src_stride); diff --git a/code/glTF2/glTF2Asset.inl b/code/glTF2/glTF2Asset.inl index a41e62e5c..bbe4aa25e 100644 --- a/code/glTF2/glTF2Asset.inl +++ b/code/glTF2/glTF2Asset.inl @@ -613,10 +613,13 @@ inline void CopyData(size_t count, } } // namespace -template -bool Accessor::ExtractData(T *&outData) { - uint8_t *data = GetPointer(); - if (!data) return false; +template +void Accessor::ExtractData(T *&outData) +{ + uint8_t* data = GetPointer(); + if (!data) { + throw DeadlyImportError("GLTF: data is NULL"); + } const size_t elemSize = GetElementSize(); const size_t totalSize = elemSize * count; @@ -636,8 +639,6 @@ bool Accessor::ExtractData(T *&outData) { memcpy(outData + i, data + i * stride, elemSize); } } - - return true; } inline void Accessor::WriteData(size_t _count, const void *src_buffer, size_t src_stride) {