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

Function PickNode

engine/gui/src/test/test_gui.cpp:3703–3715  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3701}
3702
3703static dmGui::HNode PickNode(dmGui::HScene scene, uint32_t* seed)
3704{
3705 const uint32_t max_it = 10;
3706 for (uint32_t i = 0; i < max_it; ++i)
3707 {
3708 uint32_t index = dmMath::Rand(seed) % scene->m_Nodes.Size();
3709 if (scene->m_Nodes[index].m_Index != dmGui::INVALID_INDEX)
3710 {
3711 return dmGui::GetNodeHandle(&scene->m_Nodes[index]);
3712 }
3713 }
3714 return dmGui::INVALID_HANDLE;
3715}
3716
3717// Verify that the render count holds under random inserts, deletes and moves
3718TEST_F(dmGuiTest, MoveNodesLoad)

Callers 1

TEST_FFunction · 0.70

Calls 3

RandFunction · 0.85
GetNodeHandleFunction · 0.50
SizeMethod · 0.45

Tested by

no test coverage detected