Changeset 5925 for code/branches
- Timestamp:
- Oct 9, 2009, 6:46:54 PM (15 years ago)
- Location:
- code/branches/core5/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core5/src/libraries/core/GUIManager.h
r5924 r5925 102 102 CEGUI::Logger* ceguiLogger_; //!< CEGUI's logger to be able to log CEGUI errors in our log 103 103 std::map<std::string, PlayerInfo*> players_; //!< Stores the player (owner) for each gui 104 Ogre::Camera* camera_; //!< Camera used to render the scene with the 104 Ogre::Camera* camera_; //!< Camera used to render the scene with the GUI 105 105 106 106 static GUIManager* singletonPtr_s; //!< Singleton reference to GUIManager -
code/branches/core5/src/libraries/core/GraphicsManager.cc
r5924 r5925 361 361 362 362 // Render frame 363 if( this->viewport_->getCamera() ) 364 ogreRoot_->_updateAllRenderTargets(); 363 ogreRoot_->_updateAllRenderTargets(); 365 364 366 365 uint64_t timeAfterTick = time.getRealMicroseconds(); -
code/branches/core5/src/modules/objects/Planet.cc
r5924 r5925 47 47 * @brief Constructor 48 48 */ 49 Planet::Planet(BaseObject* creator) : MovableEntity(creator)49 Planet::Planet(BaseObject* creator) : MovableEntity(creator) 50 50 { 51 51 RegisterObject(Planet); … … 64 64 void Planet::tick(float dt) 65 65 { 66 if (!this->isVisible())66 if (!this->isVisible()) 67 67 return; 68 68 … … 70 70 { 71 71 Camera* activeCamera = CameraManager::getInstance().getActiveCamera(); 72 if (activeCamera)72 if (activeCamera) 73 73 { 74 74 float distance = this->getPosition().distance( activeCamera->getWorldPosition() ); -
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.