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

Function AddToNodeList

engine/gui/src/gui.cpp:2800–2842  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2798 }
2799
2800 static void AddToNodeList(HScene scene, InternalNode* n, InternalNode* parent_n, InternalNode* prev_n)
2801 {
2802 uint16_t* head = &scene->m_RenderHead, * tail = &scene->m_RenderTail;
2803 uint16_t parent_index = INVALID_INDEX;
2804 if (parent_n != 0x0)
2805 {
2806 parent_index = parent_n->m_Index;
2807 head = &parent_n->m_ChildHead;
2808 tail = &parent_n->m_ChildTail;
2809 }
2810 n->m_ParentIndex = parent_index;
2811 if (prev_n != 0x0)
2812 {
2813 if (*tail == prev_n->m_Index)
2814 {
2815 *tail = n->m_Index;
2816 n->m_NextIndex = INVALID_INDEX;
2817 }
2818 else if (prev_n->m_NextIndex != INVALID_INDEX)
2819 {
2820 InternalNode* next_n = &scene->m_Nodes[prev_n->m_NextIndex];
2821 next_n->m_PrevIndex = n->m_Index;
2822 n->m_NextIndex = prev_n->m_NextIndex;
2823 }
2824 prev_n->m_NextIndex = n->m_Index;
2825 n->m_PrevIndex = prev_n->m_Index;
2826 }
2827 else
2828 {
2829 n->m_PrevIndex = INVALID_INDEX;
2830 n->m_NextIndex = *head;
2831 if (*head != INVALID_INDEX)
2832 {
2833 InternalNode* next_n = &scene->m_Nodes[*head];
2834 next_n->m_PrevIndex = n->m_Index;
2835 }
2836 *head = n->m_Index;
2837 if (*tail == INVALID_INDEX)
2838 {
2839 *tail = n->m_Index;
2840 }
2841 }
2842 }
2843
2844 static void RemoveFromNodeList(HScene scene, InternalNode* n)
2845 {

Callers 3

MoveNodeBelowFunction · 0.85
MoveNodeAboveFunction · 0.85
SetNodeParentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected