| 255 | } |
| 256 | |
| 257 | bool SceneManager::removeObject(BumpObject *newObject) |
| 258 | { |
| 259 | assert(GetCurrentThreadId() == _threadId); |
| 260 | int indx = -1; |
| 261 | |
| 262 | for (uint i = 0; i < _bumpObjects.size(); i++) |
| 263 | { |
| 264 | // We found our objects, return the index |
| 265 | if (_bumpObjects[i] == newObject) |
| 266 | indx = i; |
| 267 | if (_bumpObjects[i]->isBumpObjectType(BumpActor) && newObject == ((Actor *)_bumpObjects[i])->getObjectToMimic()) |
| 268 | ((Actor *)_bumpObjects[i])->setObjectToMimic(NULL); |
| 269 | } |
| 270 | |
| 271 | if (indx > -1) |
| 272 | { |
| 273 | // Remove the object from our system |
| 274 | _bumpObjects.erase(_bumpObjects.begin() + uint(indx)); |
| 275 | |
| 276 | // If we're in infinite desktop mode, update the list of all actors |
| 277 | |
| 278 | if (GLOBAL(isInInfiniteDesktopMode)) |
| 279 | { |
| 280 | cam->unwatchActor(newObject); |
| 281 | } |
| 282 | |
| 283 | // clear the camera slideshow mode if the item being removed is currently being watched |
| 284 | if (cam->isWatchedActorHighlighted(newObject)) |
| 285 | Key_DisableSlideShow(); |
| 286 | |
| 287 | return true; |
| 288 | } |
| 289 | |
| 290 | return false; |
| 291 | } |
| 292 | |
| 293 | int SceneManager::isRegistered(BumpObject *object) |
| 294 | { |
no test coverage detected