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/overlays/console
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • 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.