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

Function InsertInstanceInLevelIndex

engine/gameobject/src/gameobject/gameobject.cpp:768–782  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

766 }
767
768 static void InsertInstanceInLevelIndex(Collection* collection, HInstance instance)
769 {
770 /*
771 * Insert instance in m_LevelIndices at level set in instance->m_Depth
772 */
773 dmArray<uint16_t>& level = collection->m_LevelIndices[instance->m_Depth];
774 if (level.Full())
775 ExpandLevel(level, collection->m_MaxInstances);
776 assert(!level.Full());
777
778 uint16_t level_index = (uint16_t)level.Size();
779 level.SetSize(level_index + 1);
780 level[level_index] = instance->m_Index;
781 instance->m_LevelIndex = level_index;
782 }
783
784 static HInstance AllocInstance(Prototype* proto, const char* prototype_name) {
785 // Count number of component userdata fields required

Callers 4

NewInstanceFunction · 0.85
MoveUpFunction · 0.85
MoveDownFunction · 0.85
SetParentFunction · 0.85

Calls 5

ExpandLevelFunction · 0.85
assertFunction · 0.50
FullMethod · 0.45
SizeMethod · 0.45
SetSizeMethod · 0.45

Tested by

no test coverage detected