Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3143


Ignore:
Timestamp:
Jun 10, 2009, 10:54:43 PM (15 years ago)
Author:
rgrieder
Message:

Dependency reductions in the GUIManager.

Location:
code/branches/pch/src/orxonox/gui
Files:
2 edited

Legend:

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

    r3110 r3143  
    2424 *      Benjamin Knecht
    2525 *   Co-authors:
    26  *
     26 *      ...
    2727 *
    2828 */
    2929
    3030/**
    31     @file
    32     @brief
    33         Implementation of the GUIManager class.
     31@file
     32@brief
     33    Implementation of the GUIManager class.
    3434*/
    3535
    3636#include "GUIManager.h"
    3737
    38 #include <boost/filesystem/path.hpp>
    39 #include <OgreRenderWindow.h>
    40 #include <CEGUI.h>
     38extern "C" {
     39#include <lua.h>
     40}
    4141#include <CEGUIDefaultLogger.h>
     42#include <CEGUIExceptions.h>
     43#include <CEGUIInputEvent.h>
     44#include <CEGUIResourceProvider.h>
     45#include <CEGUISystem.h>
    4246#include <ogreceguirenderer/OgreCEGUIRenderer.h>
     47
    4348#include "SpecialConfig.h" // Configures the macro below
    4449#ifdef CEGUILUA_USE_INTERNAL_LIBRARY
     
    4954
    5055#include "util/Exception.h"
    51 #include "core/ConsoleCommand.h"
    5256#include "core/Core.h"
    5357#include "core/Clock.h"
     
    5660#include "core/Loader.h"
    5761
    58 extern "C" {
    59 #include <lua.h>
    60 }
    61 
    6262namespace orxonox
    6363{
     64    static CEGUI::MouseButton convertButton(MouseButtonCode::ByEnum button);
    6465    GUIManager* GUIManager::singletonRef_s = 0;
    6566
     
    139140
    140141                // Create our own logger to specify the filepath
    141                 boost::filesystem::path ceguiLogFilepath(Core::getLogPath() / "cegui.log");
    142142                this->ceguiLogger_ = new DefaultLogger();
    143                 this->ceguiLogger_->setLogFilename(ceguiLogFilepath.string());
     143                this->ceguiLogger_->setLogFilename(Core::getLogPathString() + "cegui.log");
    144144                // set the log level according to ours (translate by subtracting 1)
    145145                this->ceguiLogger_->setLoggingLevel(
     
    340340    }
    341341
     342    void GUIManager::keyPressed(const KeyEvent& evt)
     343    {
     344        guiSystem_->injectKeyDown(evt.key); guiSystem_->injectChar(evt.text);
     345    }
     346    void GUIManager::keyReleased(const KeyEvent& evt)
     347    {
     348        guiSystem_->injectKeyUp(evt.key);
     349    }
     350
    342351    /**
    343352    @brief
     
    382391            COUT(1) << ex.getMessage() << std::endl;
    383392        }
     393    }
     394
     395    void GUIManager::mouseMoved(IntVector2 abs, IntVector2 rel, IntVector2 clippingSize)
     396    {
     397        guiSystem_->injectMouseMove(rel.x, rel.y);
     398    }
     399    void GUIManager::mouseScrolled(int abs, int rel)
     400    {
     401        guiSystem_->injectMouseWheelChange(rel);
    384402    }
    385403
     
    394412        Simple convertion from mouse event code in Orxonox to the one used in CEGUI.
    395413     */
    396     inline CEGUI::MouseButton GUIManager::convertButton(MouseButtonCode::ByEnum button)
     414    static inline CEGUI::MouseButton convertButton(MouseButtonCode::ByEnum button)
    397415    {
    398416        switch (button)
  • code/branches/pch/src/orxonox/gui/GUIManager.h

    r3008 r3143  
    2222 *   Author:
    2323 *      Reto Grieder
     24 *      Benjamin Knecht
    2425 *   Co-authors:
    25  *      Benjamin Knecht
     26 *      ...
    2627 *
    2728 */
    2829
    2930/**
    30     @file
    31     @brief Declaration of the GUIManager class.
     31@file
     32@brief
     33    Declaration of the GUIManager class.
    3234*/
    3335
     
    3638
    3739#include "OrxonoxPrereqs.h"
     40
     41#include <map>
     42#include <string>
    3843#include <OgrePrerequisites.h>
    3944#include <CEGUIForwardRefs.h>
    40 #include <CEGUIInputEvent.h>
    41 #include <CEGUISystem.h>
     45
    4246#include "core/input/InputInterfaces.h"
    43 #include <map>
    44 #include "overlays/GUIOverlay.h"
    4547
    4648// Forward declaration
     
    105107
    106108        // keyHandler functions
    107         void keyPressed (const KeyEvent& evt)
    108             { guiSystem_->injectKeyDown(evt.key); guiSystem_->injectChar(evt.text); }
    109         void keyReleased(const KeyEvent& evt)
    110             { guiSystem_->injectKeyUp(evt.key); }
     109        void keyPressed (const KeyEvent& evt);
     110        void keyReleased(const KeyEvent& evt);
    111111        void keyHeld    (const KeyEvent& evt) { }
    112112
     
    115115        void mouseButtonReleased(MouseButtonCode::ByEnum id);
    116116        void mouseButtonHeld    (MouseButtonCode::ByEnum id) { }
    117         void mouseMoved         (IntVector2 abs, IntVector2 rel, IntVector2 clippingSize)
    118             { guiSystem_->injectMouseMove(rel.x, rel.y); }
    119         void mouseScrolled      (int abs, int rel)
    120             { guiSystem_->injectMouseWheelChange(rel);}
     117        void mouseMoved         (IntVector2 abs, IntVector2 rel, IntVector2 clippingSize);
     118        void mouseScrolled      (int abs, int rel);
    121119
    122120        void updateInput(float dt)  { }
    123121        void updateKey  (float dt)  { }
    124122        void updateMouse(float dt)  { }
    125 
    126         static CEGUI::MouseButton convertButton(MouseButtonCode::ByEnum button);
    127123
    128124        Ogre::RenderWindow*         renderWindow_;      //!< Ogre's render window to give CEGUI access to it
Note: See TracChangeset for help on using the changeset viewer.