Explorar el Código

Reenable the function for RPI since new video driver support mouse.

Yao Wei Tjong 姚伟忠 hace 12 años
padre
commit
7a82151933
Se han modificado 1 ficheros con 9 adiciones y 12 borrados
  1. 9 12
      Source/Engine/Input/Input.cpp

+ 9 - 12
Source/Engine/Input/Input.cpp

@@ -180,8 +180,6 @@ void Input::Update()
 
 
 void Input::SetMouseVisible(bool enable)
 void Input::SetMouseVisible(bool enable)
 {
 {
-    // Urho3D implementation of SDL Raspberry Pi "video driver" does not have OS mouse support, so no-op
-    #ifndef RASPI
     if (enable != mouseVisible_)
     if (enable != mouseVisible_)
     {
     {
         mouseVisible_ = enable;
         mouseVisible_ = enable;
@@ -207,7 +205,6 @@ void Input::SetMouseVisible(bool enable)
         eventData[P_VISIBLE] = mouseVisible_;
         eventData[P_VISIBLE] = mouseVisible_;
         SendEvent(E_MOUSEVISIBLECHANGED, eventData);
         SendEvent(E_MOUSEVISIBLECHANGED, eventData);
     }
     }
-    #endif
 }
 }
 
 
 void Input::SetToggleFullscreen(bool enable)
 void Input::SetToggleFullscreen(bool enable)
@@ -238,7 +235,7 @@ bool Input::OpenJoystick(unsigned index)
         // Map SDL joystick index to internal index (which starts at 0)
         // Map SDL joystick index to internal index (which starts at 0)
         int sdl_joy_instance_id = SDL_JoystickInstanceID(joystick);
         int sdl_joy_instance_id = SDL_JoystickInstanceID(joystick);
         joystickIDMap_[sdl_joy_instance_id] = index;
         joystickIDMap_[sdl_joy_instance_id] = index;
-        
+
         JoystickState& state = joysticks_[index];
         JoystickState& state = joysticks_[index];
         state.joystick_ = joystick;
         state.joystick_ = joystick;
         state.buttons_.Resize(SDL_JoystickNumButtons(joystick));
         state.buttons_.Resize(SDL_JoystickNumButtons(joystick));
@@ -745,11 +742,11 @@ void Input::HandleSDLEvent(void* sdlEvent)
 
 
             unsigned button = evt.jbutton.button;
             unsigned button = evt.jbutton.button;
             unsigned joystickIndex = joystickIDMap_[evt.jbutton.which];
             unsigned joystickIndex = joystickIDMap_[evt.jbutton.which];
-            
+
             VariantMap eventData;
             VariantMap eventData;
             eventData[P_JOYSTICK] = joystickIndex;
             eventData[P_JOYSTICK] = joystickIndex;
             eventData[P_BUTTON] = button;
             eventData[P_BUTTON] = button;
-            
+
             if (joystickIndex < joysticks_.Size() && button < joysticks_[joystickIndex].buttons_.Size()) {
             if (joystickIndex < joysticks_.Size() && button < joysticks_[joystickIndex].buttons_.Size()) {
                 joysticks_[joystickIndex].buttons_[button] = true;
                 joysticks_[joystickIndex].buttons_[button] = true;
                 joysticks_[joystickIndex].buttonPress_[button] = true;
                 joysticks_[joystickIndex].buttonPress_[button] = true;
@@ -764,7 +761,7 @@ void Input::HandleSDLEvent(void* sdlEvent)
 
 
             unsigned button = evt.jbutton.button;
             unsigned button = evt.jbutton.button;
             unsigned joystickIndex = joystickIDMap_[evt.jbutton.which];
             unsigned joystickIndex = joystickIDMap_[evt.jbutton.which];
-            
+
             VariantMap eventData;
             VariantMap eventData;
             eventData[P_JOYSTICK] = joystickIndex;
             eventData[P_JOYSTICK] = joystickIndex;
             eventData[P_BUTTON] = button;
             eventData[P_BUTTON] = button;
@@ -779,7 +776,7 @@ void Input::HandleSDLEvent(void* sdlEvent)
     case SDL_JOYAXISMOTION:
     case SDL_JOYAXISMOTION:
         {
         {
             using namespace JoystickAxisMove;
             using namespace JoystickAxisMove;
-            
+
             unsigned joystickIndex = joystickIDMap_[evt.jaxis.which];
             unsigned joystickIndex = joystickIDMap_[evt.jaxis.which];
 
 
             VariantMap eventData;
             VariantMap eventData;
@@ -799,7 +796,7 @@ void Input::HandleSDLEvent(void* sdlEvent)
     case SDL_JOYHATMOTION:
     case SDL_JOYHATMOTION:
         {
         {
             using namespace JoystickHatMove;
             using namespace JoystickHatMove;
-            
+
             unsigned joystickIndex = joystickIDMap_[evt.jaxis.which];
             unsigned joystickIndex = joystickIDMap_[evt.jaxis.which];
 
 
             VariantMap eventData;
             VariantMap eventData;
@@ -853,15 +850,15 @@ void Input::HandleSDLEvent(void* sdlEvent)
     case SDL_DROPFILE:
     case SDL_DROPFILE:
         {
         {
             using namespace DropFile;
             using namespace DropFile;
-            
+
             VariantMap eventData;
             VariantMap eventData;
             eventData[P_FILENAME] = GetInternalPath(String(evt.drop.file));
             eventData[P_FILENAME] = GetInternalPath(String(evt.drop.file));
             SDL_free(evt.drop.file);
             SDL_free(evt.drop.file);
-            
+
             SendEvent(E_DROPFILE, eventData);
             SendEvent(E_DROPFILE, eventData);
         }
         }
         break;
         break;
-        
+
     case SDL_QUIT:
     case SDL_QUIT:
         SendEvent(E_EXITREQUESTED);
         SendEvent(E_EXITREQUESTED);
         break;
         break;