Changeset 5925 for code/branches/core5/src/orxonox/CameraManager.cc
- Timestamp:
- Oct 9, 2009, 6:46:54 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core5/src/orxonox/CameraManager.cc
r5924 r5925 51 51 : viewport_(GraphicsManager::getInstance().getViewport()) 52 52 { 53 assert(GameMode::showsGraphics()); 53 54 } 54 55 … … 60 61 Camera* CameraManager::getActiveCamera() const 61 62 { 62 if ( this->cameraList_.size() > 0)63 if (!this->cameraList_.empty()) 63 64 return this->cameraList_.front(); 64 65 else … … 68 69 void CameraManager::requestFocus(Camera* camera) 69 70 { 70 if (!GameMode::showsGraphics())71 assert(0);72 73 71 // notify old camera (if it exists) 74 if ( this->cameraList_.size() > 0)72 if (!this->cameraList_.empty()) 75 73 this->cameraList_.front()->removeFocus(); 76 74 … … 78 76 79 77 // make sure we don't add it twice 80 for (std::list<Camera*>::iterator it = this->cameraList_.begin(); it != this->cameraList_.end(); ++it)78 for (std::list<Camera*>::iterator it = this->cameraList_.begin(); it != this->cameraList_.end();) 81 79 if ((*it) == camera) 82 return; 83 80 this->cameraList_.erase(it++); 81 else 82 ++it; 84 83 // add to list 85 84 this->cameraList_.push_front(camera); … … 88 87 void CameraManager::releaseFocus(Camera* camera) 89 88 { 90 if (!GameMode::showsGraphics())91 assert(0);92 93 89 // notify the cam of releasing the focus 94 90 if (!this->cameraList_.empty() && this->cameraList_.front() == camera) … … 98 94 99 95 // set new focus if possible 100 if ( this->cameraList_.size() > 0)96 if (!this->cameraList_.empty()) 101 97 this->cameraList_.front()->setFocus(); 102 98 }
Note: See TracChangeset
for help on using the changeset viewer.