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

Function LoadTextures

engine/modelc/src/modelimporter_gltf.cpp:660–678  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

658}
659
660static void LoadTextures(Scene* scene, cgltf_data* gltf_data, dmHashTable64<void*>* cache)
661{
662 InitSize(scene->m_Textures, gltf_data->textures_count, gltf_data->textures_count);
663
664 for (uint32_t i = 0; i < gltf_data->textures_count; ++i)
665 {
666 cgltf_texture* gltf_texture = &gltf_data->textures[i];
667
668 Texture* texture = &scene->m_Textures[i];
669 memset(texture, 0, sizeof(*texture));
670 texture->m_Index = i;
671 texture->m_Name = DuplicateObjectName(gltf_texture);
672 texture->m_Sampler = GetFromCache<Sampler>(cache, gltf_texture->sampler);
673 texture->m_Image = GetFromCache<Image>(cache, gltf_texture->image);
674 texture->m_BasisuImage = GetFromCache<Image>(cache, gltf_texture->basisu_image);
675
676 AddToCache(cache, gltf_texture, texture);
677 }
678}
679
680static void IdentityTransform(TextureTransform* out)
681{

Callers 1

LoadSceneFunction · 0.70

Calls 3

InitSizeFunction · 0.85
DuplicateObjectNameFunction · 0.85
AddToCacheFunction · 0.70

Tested by

no test coverage detected