| 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 |
no test coverage detected