Changeset 8678 for code/branches/unity_build
- Timestamp:
- May 30, 2011, 2:38:34 AM (14 years ago)
- Location:
- code/branches/unity_build/src
- Files:
-
- 1 added
- 1 deleted
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/unity_build/src/libraries/core/GUIManager.cc
r8669 r8678 419 419 } 420 420 421 const std::string& GUIManager::createInputState(const std::string& name, TriBool::Value showCursor, TriBool::ValueuseKeyboard, bool bBlockJoyStick)421 const std::string& GUIManager::createInputState(const std::string& name, tribool showCursor, tribool useKeyboard, bool bBlockJoyStick) 422 422 { 423 423 InputState* state = InputManager::getInstance().createInputState(name); … … 435 435 #ifdef ORXONOX_PLATFORM_APPLE 436 436 // 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); 443 443 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) 448 448 state->setMouseHandler(this); 449 else if (showCursor == TriBool::False)449 else if (showCursor == false) 450 450 state->setMouseHandler(&InputHandler::EMPTY); 451 451 452 if (useKeyboard == TriBool::True)452 if (useKeyboard == true) 453 453 state->setKeyHandler(this); 454 else if (useKeyboard == TriBool::False)454 else if (useKeyboard == false) 455 455 state->setKeyHandler(&InputHandler::EMPTY); 456 456 -
code/branches/unity_build/src/libraries/core/GUIManager.h
r8669 r8678 46 46 #include "util/DestructionHelper.h" 47 47 #include "util/OgreForwardRefs.h" 48 #include "util/ TriBool.h"48 #include "util/tribool.h" 49 49 #include "util/Singleton.h" 50 50 #include "input/InputHandler.h" 51 51 #include "OrxonoxClass.h" 52 52 #include "WindowEventListener.h" 53 54 // Tolua includes (have to be relative to the current directory)55 /*56 $cfile "../util/TriBool.h" // tolua_export57 */58 53 59 54 #if CEGUI_VERSION_MAJOR < 1 && CEGUI_VERSION_MINOR < 7 … … 64 59 { // tolua_export 65 60 class PlayerInfo; // Forward declaration 61 62 // Acquaint Tolua with tribool 63 class tribool; // tolua_export 66 64 67 65 /** … … 105 103 106 104 //! Creates a new InputState to be used with a GUI Sheet 107 const std::string& createInputState(const std::string& name, TriBool::Value showCursor = TriBool::True, TriBool::Value useKeyboard = TriBool::True, bool bBlockJoyStick = false); // tolua_export105 const std::string& createInputState(const std::string& name, tribool showCursor = true, tribool useKeyboard = true, bool bBlockJoyStick = false); // tolua_export 108 106 LuaState* getLuaState(void) 109 107 { return this->luaState_; } -
code/branches/unity_build/src/libraries/core/input/InputManager.cc
r8351 r8678 94 94 , oisInputManager_(0) 95 95 , devices_(2) 96 , exclusiveMouse_( TriBool::False)96 , exclusiveMouse_(false) 97 97 , emptyState_(0) 98 98 , calibratorCallbackHandler_(0) … … 108 108 109 109 if (GraphicsManager::getInstance().isFullScreen()) 110 exclusiveMouse_ = TriBool::True;110 exclusiveMouse_ = true; 111 111 this->loadDevices(); 112 112 … … 161 161 paramList.insert(StringPair("w32_keyboard", "DISCL_FOREGROUND")); 162 162 paramList.insert(StringPair("w32_mouse", "DISCL_FOREGROUND")); 163 if (exclusiveMouse_ == TriBool::True|| GraphicsManager::getInstance().isFullScreen())163 if (exclusiveMouse_ || GraphicsManager::getInstance().isFullScreen()) 164 164 { 165 165 // Disable Windows key plus special keys (like play, stop, next, etc.) … … 174 174 paramList.insert(StringPair("XAutoRepeatOn", "true")); 175 175 176 if (exclusiveMouse_ == TriBool::True|| GraphicsManager::getInstance().isFullScreen())176 if (exclusiveMouse_ || GraphicsManager::getInstance().isFullScreen()) 177 177 { 178 178 if (CommandLineParser::getValue("keyboard_no_grab").getBool()) … … 447 447 448 448 // Check whether we have to change the mouse mode 449 TriBool::Value requestedMode = TriBool::Dontcare;449 tribool requestedMode = dontcare; 450 450 std::vector<InputState*>& mouseStates = devices_[InputDeviceEnumerator::Mouse]->getStateListRef(); 451 451 if (mouseStates.empty()) 452 requestedMode = TriBool::False;452 requestedMode = false; 453 453 else 454 454 requestedMode = mouseStates.front()->getMouseExclusive(); 455 if (requestedMode != TriBool::Dontcare && exclusiveMouse_ != requestedMode) 456 { 457 exclusiveMouse_ = requestedMode; 455 if (requestedMode != dontcare && exclusiveMouse_ != requestedMode) 456 { 457 assert(requestedMode != dontcare); 458 exclusiveMouse_ = (requestedMode == true); 458 459 if (!GraphicsManager::getInstance().isFullScreen()) 459 460 this->reloadInternal(); … … 644 645 } 645 646 646 bool InputManager::setMouseExclusive(const std::string& name, TriBool::Valuevalue)647 bool InputManager::setMouseExclusive(const std::string& name, tribool value) 647 648 { 648 649 if (name == "empty") -
code/branches/unity_build/src/libraries/core/input/InputManager.h
r8672 r8678 38 38 39 39 #include "util/Singleton.h" 40 #include "util/ TriBool.h"40 #include "util/tribool.h" 41 41 #include "core/WindowEventListener.h" 42 42 … … 168 168 True if the call was successful, fals if the name was not found 169 169 */ 170 bool setMouseExclusive(const std::string& name, TriBool::Valuevalue); // tolua_export170 bool setMouseExclusive(const std::string& name, tribool value); // tolua_export 171 171 172 172 //------------------------------- … … 214 214 OIS::InputManager* oisInputManager_; //!< OIS input manager 215 215 std::vector<InputDevice*> devices_; //!< List of all input devices (keyboard, mouse, joy sticks) 216 TriBool::ValueexclusiveMouse_; //!< Currently applied mouse mode216 bool exclusiveMouse_; //!< Currently applied mouse mode 217 217 218 218 // some internally handled states and handlers -
code/branches/unity_build/src/libraries/core/input/InputState.cc
r7284 r8678 37 37 , bAlwaysGetsInput_(bAlwaysGetsInput) 38 38 , bTransparent_(bTransparent) 39 , exclusiveMouse_( TriBool::Dontcare)39 , exclusiveMouse_(dontcare) 40 40 , bExpired_(true) 41 41 , handlers_(2) -
code/branches/unity_build/src/libraries/core/input/InputState.h
r8351 r8678 38 38 #include <boost/bind.hpp> 39 39 40 #include "util/ TriBool.h"40 #include "util/tribool.h" 41 41 #include "InputHandler.h" 42 42 #include "InputManager.h" … … 112 112 void setHandler (InputHandler* handler); 113 113 114 void setMouseExclusive( TriBool::Valuevalue) { exclusiveMouse_ = value; this->bExpired_ = true; }115 TriBool::ValuegetMouseExclusive() const { return exclusiveMouse_; }114 void setMouseExclusive(tribool value) { exclusiveMouse_ = value; this->bExpired_ = true; } 115 tribool getMouseExclusive() const { return exclusiveMouse_; } 116 116 117 117 //! Returns the name of the state (which is unique!) … … 166 166 const bool bAlwaysGetsInput_; //!< See class declaration for explanation 167 167 const bool bTransparent_; //!< See class declaration for explanation 168 TriBool::ValueexclusiveMouse_; //!< See class declaration for explanation168 tribool exclusiveMouse_; //!< See class declaration for explanation 169 169 int priority_; //!< Current priority (might change) 170 170 bool bExpired_; //!< See hasExpired() -
code/branches/unity_build/src/orxonox/gamestates/GSLevel.cc
r8079 r8678 77 77 { 78 78 gameInputState_ = InputManager::getInstance().createInputState("game"); 79 gameInputState_->setMouseExclusive( TriBool::True);79 gameInputState_->setMouseExclusive(true); 80 80 gameInputState_->setHandler(KeyBinderManager::getInstance().getDefaultAsHandler()); 81 81 KeyBinderManager::getInstance().setToDefault(); 82 82 83 83 guiMouseOnlyInputState_ = InputManager::getInstance().createInputState("guiMouseOnly"); 84 guiMouseOnlyInputState_->setMouseExclusive( TriBool::True);84 guiMouseOnlyInputState_->setMouseExclusive(true); 85 85 guiMouseOnlyInputState_->setMouseHandler(&GUIManager::getInstance()); 86 86
Note: See TracChangeset
for help on using the changeset viewer.