Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 6, 2009, 1:59:00 AM (15 years ago)
Author:
landauf
Message:

Merged gui branch back to trunk.

I did 2 small changes in IngameManager.cc on line 777 and 888 (yes, really), because const_reverse_iterator strangely doesn't work on MinGW.

Location:
code/trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/orxonox/overlays/OrxonoxOverlay.cc

    r2662 r2896  
    3939#include <OgreOverlayManager.h>
    4040#include <OgrePanelOverlayElement.h>
     41#include <OgreRenderWindow.h>
     42
    4143#include "util/Convert.h"
    4244#include "util/Exception.h"
    4345#include "util/String.h"
    44 #include "core/Core.h"
     46#include "core/GameMode.h"
    4547#include "core/CoreIncludes.h"
    4648#include "core/XMLPort.h"
    4749#include "core/ConsoleCommand.h"
     50#include "GraphicsManager.h"
    4851
    4952namespace orxonox
     
    6467        this->group_ = 0;
    6568
    66         if (!Core::showsGraphics())
     69        if (!GameMode::showsGraphics())
    6770            ThrowException(NoGraphics, "Can't create OrxonoxOverlay, graphics engine not initialized");
    6871
     
    7780        this->overlay_->add2D(this->background_);
    7881
    79         // We'll have to set the aspect ratio to a default value first.
    80         // GSGraphics gets informed about our construction here and can update us in the next tick.
    81         this->windowAspectRatio_ = 1.0;
     82        // Get aspect ratio from the render window. Later on, we get informed automatically
     83        Ogre::RenderWindow* defaultWindow = GraphicsManager::getInstance().getRenderWindow();
     84        this->windowAspectRatio_ = (float)defaultWindow->getWidth() / defaultWindow->getHeight();
    8285        this->sizeCorrectionChanged();
    8386
     
    175178    /**
    176179    @brief
    177         Called by the GraphicsEngine whenever the window size changes.
     180        Called by the GraphicsManager whenever the window size changes.
    178181        Calculates the aspect ratio only.
    179182    */
    180     void OrxonoxOverlay::windowResized(int newWidth, int newHeight)
     183    void OrxonoxOverlay::windowResized(unsigned int newWidth, unsigned int newHeight)
    181184    {
    182185        this->windowAspectRatio_ = newWidth/(float)newHeight;
  • code/trunk/src/orxonox/overlays/OrxonoxOverlay.h

    r2890 r2896  
    200200
    201201    private:
    202         void windowResized(int newWidth, int newHeight);
     202        void windowResized(unsigned int newWidth, unsigned int newHeight);
    203203
    204204        static unsigned int hudOverlayCounter_s;   //!< Static counter for hud elements
  • code/trunk/src/orxonox/overlays/console/InGameConsole.cc

    r2087 r2896  
    4242#include "util/Convert.h"
    4343#include "util/Debug.h"
     44#include "core/Clock.h"
    4445#include "core/CoreIncludes.h"
    4546#include "core/ConfigValueIncludes.h"
     
    172173    {
    173174        // create the corresponding input state
    174         inputState_ = InputManager::getInstance().createInputState<SimpleInputState>("console", 40);
     175        inputState_ = InputManager::getInstance().createInputState<SimpleInputState>("console", false, false, InputStatePriority::Console);
    175176        inputState_->setKeyHandler(Shell::getInstance().getInputBuffer());
    176177        bHidesAllInputChanged();
     
    347348        @brief Used to control the actual scrolling and the cursor.
    348349    */
    349     void InGameConsole::tick(float dt)
     350    void InGameConsole::update(const Clock& time)
    350351    {
    351352        if (this->scroll_ != 0)
     
    358359                // enlarge oldTop a little bit so that this exponential function
    359360                // reaches 0 before infinite time has passed...
    360                 float deltaScroll = (oldTop - 0.01) * dt * this->scrollSpeed_;
     361                float deltaScroll = (oldTop - 0.01) * time.getDeltaTime() * this->scrollSpeed_;
    361362                if (oldTop - deltaScroll >= 0)
    362363                {
     
    373374                // scrolling up
    374375                // note: +0.01 for the same reason as when scrolling down
    375                 float deltaScroll = (1.2 * this->relativeHeight + 0.01 + oldTop) * dt * this->scrollSpeed_;
     376                float deltaScroll = (1.2 * this->relativeHeight + 0.01 + oldTop) * time.getDeltaTime() * this->scrollSpeed_;
    376377                if (oldTop - deltaScroll <= -1.2 * this->relativeHeight)
    377378                {
     
    388389        if (this->bActive_)
    389390        {
    390             this->cursor_ += dt;
     391            this->cursor_ += time.getDeltaTime();
    391392            if (this->cursor_ >= this->blinkTime)
    392393            {
     
    409410        @brief Resizes the console elements. Call if window size changes.
    410411    */
    411     void InGameConsole::windowResized(int newWidth, int newHeight)
     412    void InGameConsole::windowResized(unsigned int newWidth, unsigned int newHeight)
    412413    {
    413414        this->windowW_ = newWidth;
  • code/trunk/src/orxonox/overlays/console/InGameConsole.h

    r2087 r2896  
    5353        void setConfigValues();
    5454
    55         virtual void tick(float dt);
     55        void update(const Clock& time);
    5656
    5757        static InGameConsole& getInstance() { assert(singletonRef_s); return *singletonRef_s; }
     
    8181        void print(const std::string& text, int index, bool alwaysShift = false);
    8282
    83         void windowResized(int newWidth, int newHeight);
     83        void windowResized(unsigned int newWidth, unsigned int newHeight);
    8484
    8585        // config value related
  • code/trunk/src/orxonox/overlays/debug/DebugFPSText.cc

    r2662 r2896  
    3030#include "DebugFPSText.h"
    3131#include <OgreTextAreaOverlayElement.h>
     32#include "util/Convert.h"
    3233#include "core/CoreIncludes.h"
    33 #include "GraphicsEngine.h"
    34 #include "util/Convert.h"
     34#include "core/Game.h"
    3535
    3636namespace orxonox
     
    5151        SUPER(DebugFPSText, tick, dt);
    5252
    53         float fps = GraphicsEngine::getInstance().getAverageFramesPerSecond();
     53        float fps = Game::getInstance().getAvgFPS();
    5454        this->setCaption(convertToString(fps));
    5555    }
  • code/trunk/src/orxonox/overlays/debug/DebugRTRText.cc

    r2662 r2896  
    3232#include "core/CoreIncludes.h"
    3333#include "util/Convert.h"
    34 #include "GraphicsEngine.h"
     34#include "core/Game.h"
    3535
    3636namespace orxonox
     
    5151        SUPER(DebugRTRText, tick, dt);
    5252
    53         float rtr = GraphicsEngine::getInstance().getAverageTickTime();
     53        float rtr = Game::getInstance().getAvgTickTime();
    5454        this->setCaption(convertToString(rtr));
    5555    }
  • code/trunk/src/orxonox/overlays/hud/HUDRadar.cc

    r2662 r2896  
    9494    void HUDRadar::displayObject(RadarViewable* object, bool bIsMarked)
    9595    {
    96         if (object == (RadarViewable*)this->owner_)
     96        if (object == static_cast<RadarViewable*>(this->owner_))
    9797            return;
    9898
Note: See TracChangeset for help on using the changeset viewer.