| 104 | } |
| 105 | |
| 106 | static void remove(CullingSet &set, CullableType::Enum type, u32 object_id) |
| 107 | { |
| 108 | u32 ind = find_object(set, type, object_id); |
| 109 | if (ind == UINT32_MAX) |
| 110 | return; |
| 111 | |
| 112 | u32 last = array::size(set.id) - 1; |
| 113 | |
| 114 | set.id[ind] = set.id[last]; |
| 115 | set.type[ind] = set.type[last]; |
| 116 | set.visible[ind] = set.visible[last]; |
| 117 | set.sphere_w[ind] = set.sphere_w[last]; |
| 118 | |
| 119 | array::pop_back(set.id); |
| 120 | array::pop_back(set.type); |
| 121 | array::pop_back(set.visible); |
| 122 | array::pop_back(set.sphere_w); |
| 123 | } |
| 124 | |
| 125 | // Fix culling set indices when an instance at index inst is destroyed and the last instance is |
| 126 | // moved into its slot. |