| 215 | } |
| 216 | |
| 217 | void SceneRendering::RemoveActor(Actor* a, int32& key) |
| 218 | { |
| 219 | CHECK_SCENE_EDIT_ACCESS(); |
| 220 | const int32 category = a->_drawCategory; |
| 221 | ScopeWriteLock lock(Locker); |
| 222 | auto& list = Actors[category]; |
| 223 | if (list.Count() > key || key < 0) // Ignore invalid key softly (eg. list after batch clear during scene unload) |
| 224 | { |
| 225 | auto& e = list.Get()[key]; |
| 226 | if (e.Actor == a) |
| 227 | { |
| 228 | for (auto* listener : _listeners) |
| 229 | listener->OnSceneRenderingRemoveActor(a); |
| 230 | e.Actor = nullptr; |
| 231 | e.LayerMask = 0; |
| 232 | FreeActors[category].Add(key); |
| 233 | } |
| 234 | } |
| 235 | key = -1; |
| 236 | } |
| 237 | |
| 238 | #define FOR_EACH_BATCH_ACTOR const int64 count = _drawListSize; while (true) { const int64 index = Platform::InterlockedIncrement(&_drawListIndex); if (index >= count) break; auto e = _drawListData[index]; |
| 239 | #define CHECK_ACTOR ((view.RenderLayersMask.Mask & e.LayerMask) && (e.NoCulling || FrustumsListCull(e.Bounds, _drawFrustumsData))) |
no test coverage detected