Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 15, 2011, 9:47:11 PM (13 years ago)
Author:
landauf
Message:

merged usability branch back to trunk

incomplete summary of the changes in this branch:

  • enhanced keyboard navigation in GUIs
  • implemented new graphics menu and changeable window size at runtime
  • added developer mode
  • HUD shows if game is paused, game pauses if ingame menu is opened
  • removed a few obsolete commands and hid some that are more for internal use
  • numpad works in console and gui
  • faster loading of level info
  • enhanced usage of compositors (Shader class)
  • improved camera handling, configurable FOV and aspect ratio
Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/orxonox/CameraManager.cc

    r7879 r8079  
    2929#include "CameraManager.h"
    3030
     31#include <cassert>
     32
    3133#include <OgreSceneManager.h>
    3234#include <OgreViewport.h>
    3335#include <OgreCompositorManager.h>
    3436
    35 #include "util/StringUtils.h"
    3637#include "util/ScopedSingletonManager.h"
    3738#include "core/GameMode.h"
    3839#include "core/GraphicsManager.h"
    39 #include "core/GUIManager.h"
    4040#include "core/ObjectList.h"
    4141#include "tools/Shader.h"
    4242#include "graphics/Camera.h"
    43 #include "Scene.h"
    4443
    4544namespace orxonox
     
    4847
    4948    CameraManager::CameraManager()
    50         : viewport_(GraphicsManager::getInstance().getViewport())
    5149    {
    5250        assert(GameMode::showsGraphics());
     
    5553    CameraManager::~CameraManager()
    5654    {
    57         GUIManager::getInstance().setCamera(0);
    5855    }
    5956
     
    9592            if (!this->cameraList_.empty())
    9693                this->cameraList_.front()->setFocus();
     94            else
     95                this->useCamera(NULL);
    9796        }
    9897        else
     
    102101    void CameraManager::useCamera(Ogre::Camera* camera)
    103102    {
    104         // This workaround is needed to avoid weird behaviour with active compositors while
    105         // switching the camera (like freezing the image)
    106         //
    107         // Last known Ogre version needing this workaround:
    108         // 1.4.8
    109         // 1.7.2
    110 
    111         // deactivate all compositors
    112         {
    113             Ogre::ResourceManager::ResourceMapIterator iterator = Ogre::CompositorManager::getSingleton().getResourceIterator();
    114             while (iterator.hasMoreElements())
    115                 Ogre::CompositorManager::getSingleton().setCompositorEnabled(this->viewport_, iterator.getNext()->getName(), false);
    116         }
    117 
    118         this->viewport_->setCamera(camera);
    119         GUIManager::getInstance().setCamera(camera);
    120 
    121         // reactivate all visible compositors
    122         {
    123             for (ObjectList<Shader>::iterator it = ObjectList<Shader>::begin(); it != ObjectList<Shader>::end(); ++it)
    124                 it->updateVisibility();
    125         }
     103        GraphicsManager::getInstance().setCamera(camera);
    126104    }
    127105}
Note: See TracChangeset for help on using the changeset viewer.