Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5910 for code/branches


Ignore:
Timestamp:
Oct 8, 2009, 9:47:28 PM (15 years ago)
Author:
rgrieder
Message:
  • Fixed force feedback output pollution problem in OIS.
  • Fixed InputManager too many times reloading problem.
Location:
code/branches/core5/src
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core5/src/external/ois/changes_orxonox.diff

    r5738 r5910  
    2323 
    2424
     25--- win32/Win32ForceFeedback.cpp
     26+++ win32/Win32ForceFeedback.cpp
     27@@ -25,7 +25,7 @@
     28 #include <Math.h>
     29 
     30 // 0 = No trace; 1 = Important traces; 2 = Debug traces
     31-#define OIS_WIN32_JOYFF_DEBUG 1
     32+#define OIS_WIN32_JOYFF_DEBUG 0
     33 
     34 #if (defined (_DEBUG) || defined(OIS_WIN32_JOYFF_DEBUG))
     35   #include <iostream>
  • code/branches/core5/src/external/ois/win32/Win32ForceFeedback.cpp

    r5738 r5910  
    2626
    2727// 0 = No trace; 1 = Important traces; 2 = Debug traces
    28 #define OIS_WIN32_JOYFF_DEBUG 1
     28#define OIS_WIN32_JOYFF_DEBUG 0
    2929
    3030#if (defined (_DEBUG) || defined(OIS_WIN32_JOYFF_DEBUG))
  • code/branches/core5/src/libraries/core/input/InputManager.cc

    r5869 r5910  
    8787        , oisInputManager_(0)
    8888        , devices_(2)
    89         , bExclusiveMouse_(false)
     89        , mouseMode_(MouseMode::Nonexclusive)
    9090        , emptyState_(0)
    9191        , calibratorCallbackHandler_(0)
     
    9797        this->setConfigValues();
    9898
     99        if (GraphicsManager::getInstance().isFullScreen())
     100            mouseMode_ = MouseMode::Exclusive;
    99101        this->loadDevices();
    100102
     
    153155        paramList.insert(std::make_pair("w32_keyboard", "DISCL_FOREGROUND"));
    154156        paramList.insert(std::make_pair("w32_mouse", "DISCL_FOREGROUND"));
    155         if (bExclusiveMouse_ || GraphicsManager::getInstance().isFullScreen())
     157        if (mouseMode_ == MouseMode::Exclusive || GraphicsManager::getInstance().isFullScreen())
    156158        {
    157159            // Disable Windows key plus special keys (like play, stop, next, etc.)
     
    502504
    503505        // Check whether we have to change the mouse mode
     506        MouseMode::Value requestedMode = MouseMode::Dontcare;
    504507        std::vector<InputState*>& mouseStates = devices_[InputDeviceEnumerator::Mouse]->getStateListRef();
    505         if (mouseStates.empty() && bExclusiveMouse_ ||
    506             !mouseStates.empty() && mouseStates.front()->getIsExclusiveMouse() != bExclusiveMouse_)
    507         {
    508             bExclusiveMouse_ = !bExclusiveMouse_;
     508        if (mouseStates.empty())
     509            requestedMode = MouseMode::Nonexclusive;
     510        else
     511            requestedMode = mouseStates.front()->getMouseMode();
     512        if (requestedMode != MouseMode::Dontcare && mouseMode_ != requestedMode)
     513        {
     514            mouseMode_ = requestedMode;
    509515            if (!GraphicsManager::getInstance().isFullScreen())
    510516                this->reloadInternal();
  • code/branches/core5/src/libraries/core/input/InputManager.h

    r5869 r5910  
    191191        OIS::InputManager*                  oisInputManager_;      //!< OIS input manager
    192192        std::vector<InputDevice*>           devices_;              //!< List of all input devices (keyboard, mouse, joy sticks)
    193         bool                                bExclusiveMouse_;      //!< Currently applied mouse mode
     193        MouseMode::Value                    mouseMode_;            //!< Currently applied mouse mode
    194194
    195195        // some internally handled states and handlers
  • code/branches/core5/src/libraries/core/input/InputState.cc

    r5738 r5910  
    3737        , bAlwaysGetsInput_(bAlwaysGetsInput)
    3838        , bTransparent_(bTransparent)
    39         , bExclusiveMouse_(true)
     39        , mouseMode_(MouseMode::Dontcare)
    4040        , bExpired_(true)
    4141        , handlers_(2)
  • code/branches/core5/src/libraries/core/input/InputState.h

    r5738 r5910  
    5555        static const int Detector     = HighPriority + 2;
    5656    };
     57
     58    namespace MouseMode
     59    {
     60        enum Value
     61        {
     62            Exclusive,
     63            Nonexclusive,
     64            Dontcare
     65        };
     66    }
    5767
    5868    /**
     
    120130        void setHandler        (InputHandler* handler);
    121131
    122         void setIsExclusiveMouse(bool value) { bExclusiveMouse_ = value; this->bExpired_ = true; }
    123         bool getIsExclusiveMouse() const { return bExclusiveMouse_; }
     132        void setMouseMode(MouseMode::Value value) { mouseMode_ = value; this->bExpired_ = true; }
     133        MouseMode::Value getMouseMode() const { return mouseMode_; }
    124134
    125135        //! Returns the name of the state (which is unique!)
     
    174184        const bool                  bAlwaysGetsInput_;      //!< See class declaration for explanation
    175185        const bool                  bTransparent_;          //!< See class declaration for explanation
    176         bool                        bExclusiveMouse_;       //!< See class declaration for explanation
     186        MouseMode::Value            mouseMode_;             //!< See class declaration for explanation
    177187        int                         priority_;              //!< Current priority (might change)
    178188        bool                        bExpired_;              //!< See hasExpired()
  • code/branches/core5/src/orxonox/gamestates/GSLevel.cc

    r5876 r5910  
    6868        {
    6969            gameInputState_ = InputManager::getInstance().createInputState("game");
     70            gameInputState_->setMouseMode(MouseMode::Exclusive);
    7071            gameInputState_->setHandler(KeyBinderManager::getInstance().getDefaultAsHandler());
    7172            KeyBinderManager::getInstance().setToDefault();
    7273
    7374            guiMouseOnlyInputState_ = InputManager::getInstance().createInputState("guiMouseOnly");
     75            guiMouseOnlyInputState_->setMouseMode(MouseMode::Exclusive);
    7476            guiMouseOnlyInputState_->setMouseHandler(GUIManager::getInstancePtr());
    7577
  • code/branches/core5/src/orxonox/gamestates/GSMainMenu.cc

    r5899 r5910  
    5050    {
    5151        inputState_ = InputManager::getInstance().createInputState("mainMenu");
     52        inputState_->setMouseMode(MouseMode::Nonexclusive);
    5253        inputState_->setHandler(GUIManager::getInstancePtr());
    5354        inputState_->setKeyHandler(KeyBinderManager::getInstance().getDefaultAsHandler());
    5455        inputState_->setJoyStickHandler(&InputHandler::EMPTY);
    55         inputState_->setIsExclusiveMouse(false);
    5656
    5757        // create an empty Scene
Note: See TracChangeset for help on using the changeset viewer.