Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5925 for code/branches/core5


Ignore:
Timestamp:
Oct 9, 2009, 6:46:54 PM (15 years ago)
Author:
rgrieder
Message:

Reapplied some of the changes that got reverted in the last commit (including two fixes).

Location:
code/branches/core5/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core5/src/libraries/core/GUIManager.h

    r5924 r5925  
    102102        CEGUI::Logger*                       ceguiLogger_;      //!< CEGUI's logger to be able to log CEGUI errors in our log
    103103        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
    105105
    106106        static GUIManager*                   singletonPtr_s;    //!< Singleton reference to GUIManager
  • code/branches/core5/src/libraries/core/GraphicsManager.cc

    r5924 r5925  
    361361
    362362        // Render frame
    363         if( this->viewport_->getCamera() )
    364             ogreRoot_->_updateAllRenderTargets();
     363        ogreRoot_->_updateAllRenderTargets();
    365364
    366365        uint64_t timeAfterTick = time.getRealMicroseconds();
  • code/branches/core5/src/modules/objects/Planet.cc

    r5924 r5925  
    4747     * @brief Constructor
    4848     */
    49     Planet::Planet(BaseObject* creator): MovableEntity(creator)
     49    Planet::Planet(BaseObject* creator) : MovableEntity(creator)
    5050    {
    5151        RegisterObject(Planet);
     
    6464    void Planet::tick(float dt)
    6565    {
    66         if(!this->isVisible())
     66        if (!this->isVisible())
    6767            return;
    6868
     
    7070        {
    7171            Camera* activeCamera = CameraManager::getInstance().getActiveCamera();
    72             if(activeCamera)
     72            if (activeCamera)
    7373            {
    7474                float distance = this->getPosition().distance( activeCamera->getWorldPosition() );
  • code/branches/core5/src/orxonox/CameraManager.cc

    r5924 r5925  
    5151        : viewport_(GraphicsManager::getInstance().getViewport())
    5252    {
     53        assert(GameMode::showsGraphics());
    5354    }
    5455
     
    6061    Camera* CameraManager::getActiveCamera() const
    6162    {
    62         if (this->cameraList_.size() > 0)
     63        if (!this->cameraList_.empty())
    6364            return this->cameraList_.front();
    6465        else
     
    6869    void CameraManager::requestFocus(Camera* camera)
    6970    {
    70         if (!GameMode::showsGraphics())
    71             assert(0);
    72 
    7371        // notify old camera (if it exists)
    74         if (this->cameraList_.size() > 0)
     72        if (!this->cameraList_.empty())
    7573            this->cameraList_.front()->removeFocus();
    7674
     
    7876
    7977        // 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();)
    8179            if ((*it) == camera)
    82                 return;
    83 
     80                this->cameraList_.erase(it++);
     81            else
     82                ++it;
    8483        // add to list
    8584        this->cameraList_.push_front(camera);
     
    8887    void CameraManager::releaseFocus(Camera* camera)
    8988    {
    90         if (!GameMode::showsGraphics())
    91             assert(0);
    92 
    9389        // notify the cam of releasing the focus
    9490        if (!this->cameraList_.empty() && this->cameraList_.front() == camera)
     
    9894
    9995            // set new focus if possible
    100             if (this->cameraList_.size() > 0)
     96            if (!this->cameraList_.empty())
    10197                this->cameraList_.front()->setFocus();
    10298        }
  • code/branches/core5/src/orxonox/graphics/Camera.cc

    r5924 r5925  
    3838#include "core/CoreIncludes.h"
    3939#include "core/ConfigValueIncludes.h"
     40#include "core/GameMode.h"
    4041#include "core/GUIManager.h"
    4142#include "Scene.h"
     
    5051        RegisterObject(Camera);
    5152
     53        if (!GameMode::showsGraphics())
     54            ThrowException(AbortLoading, "Can't create Camera, no graphics.");
    5255        if (!this->getScene())
    5356            ThrowException(AbortLoading, "Can't create Camera, no scene.");
     
    7679        if (this->isInitialized())
    7780        {
    78             if( GUIManager::getInstance().getCamera() == this->camera_ )
    79                 GUIManager::getInstance().setCamera( NULL );
     81            if (GUIManager::getInstance().getCamera() == this->camera_)
     82                GUIManager::getInstance().setCamera(NULL);
    8083            this->releaseFocus();
    8184
Note: See TracChangeset for help on using the changeset viewer.