Support uint

This commit is contained in:
Syoyo Fujita 2020-03-25 17:48:37 +09:00
parent be9ff66eeb
commit fb99999c1a

View File

@ -397,6 +397,9 @@ static uint32_t UnpackIndex(const unsigned char *ptr, int type) {
// TODO(syoyo): Check overflow(2G+ index) // TODO(syoyo): Check overflow(2G+ index)
int32_t data = *reinterpret_cast<const int32_t *>(ptr); int32_t data = *reinterpret_cast<const int32_t *>(ptr);
return uint32_t(data); return uint32_t(data);
} else if (type == TINYGLTF_COMPONENT_TYPE_UNSIGNED_INT) {
uint32_t data = *reinterpret_cast<const uint32_t *>(ptr);
return uint32_t(data);
} else if (type == TINYGLTF_COMPONENT_TYPE_SHORT) { } else if (type == TINYGLTF_COMPONENT_TYPE_SHORT) {
uint32_t data = *reinterpret_cast<const uint32_t *>(ptr); uint32_t data = *reinterpret_cast<const uint32_t *>(ptr);
return data; return data;