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

Method Set

engine/gui/src/test/test_gui_shared.h:100–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98 }
99
100 void Set(dmhash_t path_hash, uint32_t width, uint32_t height, dmImage::Type type, const void* buffer)
101 {
102 for (int i = 0; i < m_Textures.Size(); ++i)
103 {
104 if (m_Textures[i]->m_PathHash == path_hash)
105 {
106 uint32_t buffer_size = width * height * dmImage::BytesPerPixel(type);
107 if (m_Textures[i]->m_Buffer)
108 {
109 free(m_Textures[i]->m_Buffer);
110 m_Textures[i]->m_Buffer = (uint8_t*) malloc(buffer_size);
111 }
112 m_Textures[i]->m_Width = width;
113 m_Textures[i]->m_Height = height;
114 m_Textures[i]->m_Type = type;
115 memcpy(m_Textures[i]->m_Buffer, buffer, buffer_size);
116 }
117 }
118 }
119
120 TestDynamicTexture* Get(dmhash_t path_hash)
121 {

Callers 8

DynamicSetTextureDataFunction · 0.45
DynamicSetTextureDataFunction · 0.45
SetMaterialAttributeFunction · 0.45
CompMeshCreateFunction · 0.45
CompModelCreateFunction · 0.45
CheckShapeDefFunction · 0.45
ComputeShapeCastHitFunction · 0.45
World_CastShapeFunction · 0.45

Calls 4

BytesPerPixelFunction · 0.85
freeFunction · 0.85
mallocFunction · 0.85
SizeMethod · 0.45

Tested by

no test coverage detected