Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 22, 2008, 9:16:35 PM (16 years ago)
Author:
rgrieder
Message:

some de-bugging
added enum for joy stick buttons
some more little fixes

Location:
code/branches/gui/src/orxonox
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • code/branches/gui/src/orxonox/GraphicsEngine.cc

    r1640 r1641  
    2222 *   Author:
    2323 *      Reto Grieder
     24 *      Benjamin Knecht <beni_at_orxonox.net>, (C) 2007
    2425 *   Co-authors:
    25  *      Benjamin Knecht <beni_at_orxonox.net>, (C) 2007, Felix Schulthess
     26 *      Felix Schulthess
    2627 *
    2728 */
     
    8990        RegisterObject(GraphicsEngine);
    9091
     92        assert(singletonRef_s == 0);
    9193        singletonRef_s = this;
    9294
     
    305307        //Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5);
    306308
    307         // create a full screen viewport in which to render the scene and the loading screen
    308         // The GUI uses its own one to be able to render on top of everything.
    309         // That explains why the Z order here is only 1 and not 0 (top most)
    310         this->viewport_ = this->renderWindow_->addViewport(0, 1);
     309        // create a full screen viewport
     310        this->viewport_ = this->renderWindow_->addViewport(0, 0);
    311311
    312312        return true;
  • code/branches/gui/src/orxonox/GraphicsEngine.h

    r1640 r1641  
    2222 *   Author:
    2323 *      Reto Grieder
     24 *      Benjamin Knecht <beni_at_orxonox.net>, (C) 2007
    2425 *   Co-authors:
    25  *      Benjamin Knecht <beni_at_orxonox.net>, (C) 2007, Felix Schulthess
     26 *      Felix Schulthess
    2627 *
    2728 */
     
    8889
    8990        static GraphicsEngine& getSingleton();
    90         static GraphicsEngine* getSingletonPtr() { return &getSingleton(); }
     91        static GraphicsEngine* getSingletonPtr() { return singletonRef_s; }
    9192
    9293    private:
  • code/branches/gui/src/orxonox/Orxonox.cc

    r1640 r1641  
    300300  }
    301301
    302   void Orxonox::loadGame(const std::string& name)
     302  /*static*/ void Orxonox::loadGame(const std::string& name)
    303303  {
    304304      const GameMode& mode = Settings::getGameMode(name);
  • code/branches/gui/src/orxonox/gui/GUIManager.h

    r1640 r1641  
    103103
    104104        void tickInput(float dt) { }
     105        void tickKey(float dt) { }
     106        void tickMouse(float dt) { }
    105107
    106108        void loadScenes();
  • code/branches/gui/src/orxonox/gui/OgreCEGUIRenderer.cpp

    r1638 r1641  
    191191    // GUI (uses its own viewport to be able render on top of all viewports).
    192192    // But since we don't use overlays in the GUI, it doesn't matter.
    193     //if (d_render_sys->_getViewport()->getOverlaysEnabled() && !d_quadlist.empty())
    194     if (!d_quadlist.empty())
     193    // ORXONOX REVERT: Changes are not in place anymore, but might be in the future!
     194    if (d_render_sys->_getViewport()->getOverlaysEnabled() && !d_quadlist.empty())
     195    //if (!d_quadlist.empty())
    195196    {
    196197        /// Quad list needs to be sorted and thus the vertex buffer rebuilt. If not, we can
     
    493494    // GUI (uses its own viewport to be able render on top of all viewports).
    494495    // But since we don't use overlays in the GUI, it doesn't matter.
    495     //if (d_render_sys->_getViewport()->getOverlaysEnabled())
    496     if (true)
     496    // ORXONOX REVERT: Changes are not in place anymore, but might be in the future!
     497    if (d_render_sys->_getViewport()->getOverlaysEnabled())
     498    //if (true)
    497499    {
    498500        z = -1 + z;
  • code/branches/gui/src/orxonox/overlays/console/InGameConsole.cc

    r1638 r1641  
    4646#include "core/ConsoleCommand.h"
    4747#include "core/input/InputManager.h"
     48#include "core/input/SimpleInputState.h"
     49#include "core/input/InputBuffer.h"
    4850#include "GraphicsEngine.h"
    4951
     
    6668        , consoleOverlayBorder_(0)
    6769        , consoleOverlayTextAreas_(0)
    68         , emptySceneManager_(0)
    69         , emptyCamera_(0)
    70         , viewport_(0)
    7170    {
    7271        RegisterObject(InGameConsole);
     
    118117    void InGameConsole::initialise()
    119118    {
     119        // create the corresponding input state
     120        InputManager::createSimpleInputState("console", 40)->setKeyHandler(Shell::getInstance().getInputBuffer());
     121
    120122        // create overlay and elements
    121123        Ogre::OverlayManager* ovMan = Ogre::OverlayManager::getSingletonPtr();
     
    195197        Shell::getInstance().addOutputLevel(true);
    196198
    197         // create a sceneManager in order to render in our own viewport
    198         this->emptySceneManager_ = Ogre::Root::getSingleton()
    199             .createSceneManager(Ogre::ST_GENERIC, "Console/EmptySceneManager");
    200         this->emptyCamera_ = this->emptySceneManager_->createCamera("Console/EmptyCamera");
    201         this->viewport_ = GraphicsEngine::getSingleton().getRenderWindow()->addViewport(emptyCamera_, 10);
    202         this->viewport_->setOverlaysEnabled(true);
    203         this->viewport_->setClearEveryFrame(false);
    204 
    205199        COUT(4) << "Info: InGameConsole initialized" << std::endl;
    206200    }
     
    211205    void InGameConsole::destroy()
    212206    {
     207        this->deactivate();
     208
     209        // destroy the input state previously created
     210        SimpleInputState * inputState = dynamic_cast<SimpleInputState*>(InputManager::getState("console"));
     211        if (inputState)
     212            InputManager::destroyState("console");
     213
    213214        Ogre::OverlayManager* ovMan = Ogre::OverlayManager::getSingletonPtr();
    214215        if (ovMan)
     
    467468                if (output.size() > this->maxCharsPerLine_)
    468469                {
    469                     if (Shell::getInstance().getInputBuffer().getCursorPosition() < this->inputWindowStart_)
    470                         this->inputWindowStart_ = Shell::getInstance().getInputBuffer().getCursorPosition();
    471                     else if (Shell::getInstance().getInputBuffer().getCursorPosition() >= (this->inputWindowStart_ + this->maxCharsPerLine_ - 1))
    472                         this->inputWindowStart_ = Shell::getInstance().getInputBuffer().getCursorPosition() - this->maxCharsPerLine_ + 1;
     470                    if (Shell::getInstance().getInputBuffer()->getCursorPosition() < this->inputWindowStart_)
     471                        this->inputWindowStart_ = Shell::getInstance().getInputBuffer()->getCursorPosition();
     472                    else if (Shell::getInstance().getInputBuffer()->getCursorPosition() >= (this->inputWindowStart_ + this->maxCharsPerLine_ - 1))
     473                        this->inputWindowStart_ = Shell::getInstance().getInputBuffer()->getCursorPosition() - this->maxCharsPerLine_ + 1;
    473474
    474475                    output = output.substr(this->inputWindowStart_, this->maxCharsPerLine_);
  • code/branches/gui/src/orxonox/overlays/console/InGameConsole.h

    r1638 r1641  
    100100        Ogre::TextAreaOverlayElement** consoleOverlayTextAreas_;
    101101
    102         Ogre::SceneManager* emptySceneManager_;     //!< dummy SceneManager to render overlays in empty windows
    103         Ogre::Camera*       emptyCamera_;           //!< dummy camera to render overlays in empty windows
    104         Ogre::Viewport*     viewport_;
    105 
    106102        // config values
    107103        float relativeWidth;
Note: See TracChangeset for help on using the changeset viewer.