summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-09-21 21:46:17 +0300
committerAndrei Karas <akaras@inbox.ru>2013-09-22 02:56:50 +0300
commit45fc7dfe871e25c913deb56063ca930dafe8b9ae (patch)
tree0ef15c4d3d36b02e41f8bfa765f5fadee779af24 /src/gui
parent6e6d42af899c7dcc05b20b07130d0b1a5932f9bf (diff)
downloadmanaverse-45fc7dfe871e25c913deb56063ca930dafe8b9ae.tar.gz
manaverse-45fc7dfe871e25c913deb56063ca930dafe8b9ae.tar.bz2
manaverse-45fc7dfe871e25c913deb56063ca930dafe8b9ae.tar.xz
manaverse-45fc7dfe871e25c913deb56063ca930dafe8b9ae.zip
fix compilation and partial running with SDL2 on Android.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/gui.cpp2
-rw-r--r--src/gui/sdlinput.cpp14
2 files changed, 16 insertions, 0 deletions
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp
index 2733f75fa..694010f8b 100644
--- a/src/gui/gui.cpp
+++ b/src/gui/gui.cpp
@@ -769,9 +769,11 @@ void Gui::handleMouseInput()
if (touchManager.processEvent(mouseInput))
{
#ifdef ANDROID
+#ifndef USE_SDL2
SDL_WarpMouse(mLastMouseX, mLastMouseY,
mLastMouseRealX, mLastMouseRealY);
#endif
+#endif
mMouseInactivityTimer = 0;
continue;
}
diff --git a/src/gui/sdlinput.cpp b/src/gui/sdlinput.cpp
index 59f9c8e19..a942d6909 100644
--- a/src/gui/sdlinput.cpp
+++ b/src/gui/sdlinput.cpp
@@ -185,17 +185,23 @@ void SDLInput::pushInput(const SDL_Event &event)
#endif
#ifdef ANDROID
+#ifndef USE_SDL2
case SDL_ACCELEROMETER:
break;
#endif
+#endif
case SDL_MOUSEBUTTONDOWN:
mMouseDown = true;
mouseInput.setX(event.button.x);
mouseInput.setY(event.button.y);
#ifdef ANDROID
+#ifdef USE_SDL2
+ mouseInput.setReal(event.button.x, event.button.y);
+#else
mouseInput.setReal(event.button.realx, event.button.realy);
#endif
+#endif
mouseInput.setButton(convertMouseButton(event.button.button));
#ifndef USE_SDL2
@@ -215,8 +221,12 @@ void SDLInput::pushInput(const SDL_Event &event)
mouseInput.setX(event.button.x);
mouseInput.setY(event.button.y);
#ifdef ANDROID
+#ifdef USE_SDL2
+ mouseInput.setReal(event.button.x, event.button.y);
+#else
mouseInput.setReal(event.button.realx, event.button.realy);
#endif
+#endif
mouseInput.setButton(convertMouseButton(event.button.button));
mouseInput.setType(gcn::MouseInput::RELEASED);
mouseInput.setTimeStamp(SDL_GetTicks());
@@ -227,8 +237,12 @@ void SDLInput::pushInput(const SDL_Event &event)
mouseInput.setX(event.motion.x);
mouseInput.setY(event.motion.y);
#ifdef ANDROID
+#ifdef USE_SDL2
+ mouseInput.setReal(event.motion.x, event.motion.y);
+#else
mouseInput.setReal(event.motion.realx, event.motion.realy);
#endif
+#endif
mouseInput.setButton(gcn::MouseInput::EMPTY);
mouseInput.setType(gcn::MouseInput::MOVED);
mouseInput.setTimeStamp(SDL_GetTicks());