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

Function FinalScene

engine/gui/src/gui.cpp:2393–2425  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2391 }
2392
2393 Result FinalScene(HScene scene)
2394 {
2395 Result result = RunScript(scene, SCRIPT_FUNCTION_FINAL, LUA_NOREF, 0x0);
2396
2397 // Deferred deletion of nodes
2398 uint32_t n = scene->m_Nodes.Size();
2399 InternalNode* nodes = scene->m_Nodes.Begin();
2400 for (uint32_t i = 0; i < n; ++i)
2401 {
2402 InternalNode* node = &nodes[i];
2403
2404 if (node->m_Deleted)
2405 {
2406 HNode hnode = GetNodeHandle(node);
2407 DeleteNode(scene, hnode, true);
2408 node->m_Deleted = 0; // Make sure to clear deferred delete flag
2409 n = scene->m_Nodes.Size();
2410 }
2411 }
2412
2413 // Destroy all living particlefx instances
2414 uint32_t count = scene->m_AliveParticlefxs.Size();
2415 for (uint32_t i = 0; i < count; ++i)
2416 {
2417 ParticlefxComponent* c = &scene->m_AliveParticlefxs[i];
2418 dmParticle::DestroyInstance(scene->m_ParticlefxContext, c->m_Instance);
2419 }
2420 scene->m_AliveParticlefxs.SetSize(0);
2421
2422 DeleteDynamicTextures(scene);
2423 ClearLayouts(scene);
2424 return result;
2425 }
2426
2427 Result UpdateScene(HScene scene, float dt)
2428 {

Callers 3

TEST_FFunction · 0.50
CompGuiFinalFunction · 0.50
CompGuiOnReloadFunction · 0.50

Calls 9

DeleteDynamicTexturesFunction · 0.85
RunScriptFunction · 0.70
GetNodeHandleFunction · 0.70
DeleteNodeFunction · 0.70
ClearLayoutsFunction · 0.70
DestroyInstanceFunction · 0.50
SizeMethod · 0.45
BeginMethod · 0.45
SetSizeMethod · 0.45

Tested by 1

TEST_FFunction · 0.40