Changeset 5925 for code/branches/core5/src/orxonox
- Timestamp:
- Oct 9, 2009, 6:46:54 PM (15 years ago)
- Location:
- code/branches/core5/src/orxonox
- Files:
-
- 2 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 } -
code/branches/core5/src/orxonox/graphics/Camera.cc
r5924 r5925 38 38 #include "core/CoreIncludes.h" 39 39 #include "core/ConfigValueIncludes.h" 40 #include "core/GameMode.h" 40 41 #include "core/GUIManager.h" 41 42 #include "Scene.h" … … 50 51 RegisterObject(Camera); 51 52 53 if (!GameMode::showsGraphics()) 54 ThrowException(AbortLoading, "Can't create Camera, no graphics."); 52 55 if (!this->getScene()) 53 56 ThrowException(AbortLoading, "Can't create Camera, no scene."); … … 76 79 if (this->isInitialized()) 77 80 { 78 if ( GUIManager::getInstance().getCamera() == this->camera_)79 GUIManager::getInstance().setCamera( NULL);81 if (GUIManager::getInstance().getCamera() == this->camera_) 82 GUIManager::getInstance().setCamera(NULL); 80 83 this->releaseFocus(); 81 84
Note: See TracChangeset
for help on using the changeset viewer.