Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 30, 2011, 2:38:34 AM (13 years ago)
Author:
rgrieder
Message:

Replaced TriBool with a modified version of boost::tribool. The main reason was that 'True' and 'False' had to be replaced because of macro collisions.
So why not use the real true and false with a third state? That's what boost tribool did, so I changed that implementation to fit our needs and change its behavior.
It's also safer to use because it avoids unwanted implicit conversions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/unity_build/src/libraries/core/GUIManager.cc

    r8669 r8678  
    419419    }
    420420
    421     const std::string& GUIManager::createInputState(const std::string& name, TriBool::Value showCursor, TriBool::Value useKeyboard, bool bBlockJoyStick)
     421    const std::string& GUIManager::createInputState(const std::string& name, tribool showCursor, tribool useKeyboard, bool bBlockJoyStick)
    422422    {
    423423        InputState* state = InputManager::getInstance().createInputState(name);
     
    435435#ifdef ORXONOX_PLATFORM_APPLE
    436436        // There is no non exclusive mode on OS X yet
    437         state->setMouseExclusive(TriBool::True);
    438 #else
    439         if (showCursor == TriBool::Dontcare)
    440             state->setMouseExclusive(TriBool::Dontcare);
    441         else if (GraphicsManager::getInstance().isFullScreen() || showCursor == TriBool::False)
    442             state->setMouseExclusive(TriBool::True);
     437        state->setMouseExclusive(true);
     438#else
     439        if (showCursor == dontcare)
     440            state->setMouseExclusive(dontcare);
     441        else if (GraphicsManager::getInstance().isFullScreen() || showCursor == false)
     442            state->setMouseExclusive(true);
    443443        else
    444             state->setMouseExclusive(TriBool::False);
    445 #endif
    446 
    447         if (showCursor == TriBool::True)
     444            state->setMouseExclusive(false);
     445#endif
     446
     447        if (showCursor == true)
    448448            state->setMouseHandler(this);
    449         else if (showCursor == TriBool::False)
     449        else if (showCursor == false)
    450450            state->setMouseHandler(&InputHandler::EMPTY);
    451451
    452         if (useKeyboard == TriBool::True)
     452        if (useKeyboard == true)
    453453            state->setKeyHandler(this);
    454         else if (useKeyboard == TriBool::False)
     454        else if (useKeyboard == false)
    455455            state->setKeyHandler(&InputHandler::EMPTY);
    456456
Note: See TracChangeset for help on using the changeset viewer.