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

Function UpdateTexture

engine/gui/src/gui.cpp:726–744  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

724 }
725
726 static void UpdateTexture(HScene scene, dmhash_t texture_name_hash, HTextureSource texture_source, NodeTextureType texture_type)
727 {
728 uint32_t n = scene->m_Nodes.Size();
729 InternalNode* nodes = scene->m_Nodes.Begin();
730 for (uint32_t i = 0; i < n; ++i)
731 {
732 if (nodes[i].m_Node.m_TextureHash == texture_name_hash)
733 {
734 nodes[i].m_Node.m_Texture = texture_source;
735 nodes[i].m_Node.m_TextureType = texture_type;
736
737 if (texture_type == NODE_TEXTURE_TYPE_TEXTURE_SET)
738 {
739 UpdateTextureSetAnimData(scene, &nodes[i]);
740 CalculateNodeSize(&nodes[i]);
741 }
742 }
743 }
744 }
745
746 static Result AddTexture(HScene scene, dmHashTable64<TextureInfo>& info_array, dmhash_t texture_name_hash, HTextureSource texture_source, NodeTextureType texture_type, uint32_t original_width, uint32_t original_height, uint32_t image_type)
747 {

Callers 2

AddTextureFunction · 0.85
DeleteDynamicTextureFunction · 0.85

Calls 4

UpdateTextureSetAnimDataFunction · 0.85
CalculateNodeSizeFunction · 0.85
SizeMethod · 0.45
BeginMethod · 0.45

Tested by

no test coverage detected