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

Function GetFirstChildNode

engine/gui/src/gui.cpp:2530–2558  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2528 }
2529
2530 HNode GetFirstChildNode(HScene scene, HNode node)
2531 {
2532 assert(scene != 0);
2533 if (!node)
2534 {
2535 uint32_t node_count = scene->m_Nodes.Size();
2536 InternalNode* nodes = scene->m_Nodes.Begin();
2537 for (uint32_t i = 0; i < node_count; ++i)
2538 {
2539 InternalNode* node = &nodes[i];
2540 if (!node->m_Deleted && node->m_Index != INVALID_INDEX && node->m_ParentIndex == INVALID_INDEX)
2541 {
2542 return GetNodeHandle(node);
2543 }
2544 }
2545 return INVALID_HANDLE;
2546 }
2547
2548 InternalNode* n = GetNode(scene, node);
2549 uint16_t child_index = n->m_ChildHead;
2550 while (child_index != INVALID_INDEX)
2551 {
2552 InternalNode* child = &scene->m_Nodes[child_index & 0xffff];
2553 child_index = child->m_NextIndex;
2554 if (!child->m_Deleted && child->m_Index != INVALID_INDEX)
2555 return GetNodeHandle(child);
2556 }
2557 return INVALID_HANDLE;
2558 }
2559
2560 HNode GetNextNode(HScene scene, HNode node)
2561 {

Callers 1

CompGuiIterChildrenFunction · 0.50

Calls 5

GetNodeHandleFunction · 0.70
GetNodeFunction · 0.70
assertFunction · 0.50
SizeMethod · 0.45
BeginMethod · 0.45

Tested by

no test coverage detected