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

Function SetNodeLayoutDesc

engine/gui/src/gui.cpp:1266–1282  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1264 }
1265
1266 Result SetNodeLayoutDesc(const HScene scene, HNode node, const void *desc, uint16_t layout_index_start, uint16_t layout_index_end)
1267 {
1268 InternalNode* n = GetNode(scene, node);
1269 void **table = n->m_Node.m_NodeDescTable;
1270 if(table == 0)
1271 {
1272 if(scene->m_LayoutsNodeDescs.Full())
1273 return RESULT_OUT_OF_RESOURCES;
1274 size_t table_index = scene->m_LayoutsNodeDescs.Size();
1275 scene->m_LayoutsNodeDescs.SetSize(table_index + scene->m_Layouts.Size());
1276 n->m_Node.m_NodeDescTable = table = &scene->m_LayoutsNodeDescs[table_index];
1277 }
1278 assert(layout_index_end < scene->m_Layouts.Size());
1279 for(uint16_t i = layout_index_start; i <= layout_index_end; ++i)
1280 table[i] = (void*) desc;
1281 return RESULT_OK;
1282 }
1283
1284 Result SetLayout(const HScene scene, dmhash_t layout_id, SetNodeCallback set_node_callback)
1285 {

Callers 2

TEST_FFunction · 0.50
SetupGuiSceneFunction · 0.50

Calls 5

GetNodeFunction · 0.70
assertFunction · 0.50
FullMethod · 0.45
SizeMethod · 0.45
SetSizeMethod · 0.45

Tested by 1

TEST_FFunction · 0.40