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:
2 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;
Note: See TracChangeset for help on using the changeset viewer.