MCPcopy Create free account
hub / github.com/defold/defold / ReadSparseIndex

Function ReadSparseIndex

engine/modelc/src/modelimporter_gltf.cpp:364–388  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

362}
363
364static bool ReadSparseIndex(const uint8_t* data, cgltf_component_type component_type, cgltf_size* out)
365{
366 switch (component_type)
367 {
368 case cgltf_component_type_r_8u:
369 *out = *data;
370 return true;
371 case cgltf_component_type_r_16u:
372 {
373 uint16_t value;
374 memcpy(&value, data, sizeof(value));
375 *out = value;
376 return true;
377 }
378 case cgltf_component_type_r_32u:
379 {
380 uint32_t value;
381 memcpy(&value, data, sizeof(value));
382 *out = value;
383 return true;
384 }
385 default:
386 return false;
387 }
388}
389
390static bool ValidateSparseAccessorsForUnpack(Scene* scene, cgltf_data* data)
391{

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected