Fixed mouse input not processed, fixed PC compilation
This commit is contained in:
@@ -14,7 +14,9 @@
|
|||||||
|
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
|
|
||||||
|
#ifdef __ANDROID__
|
||||||
#include <SDL_android.h>
|
#include <SDL_android.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "tutorial_gui.h"
|
#include "tutorial_gui.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
@@ -63,7 +65,13 @@ void OpenExternTutorialVideo(VideoLink_t *tutorial)
|
|||||||
if (!link) {
|
if (!link) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
#ifdef __ANDROID__
|
||||||
SDL_ANDROID_OpenExternalWebBrowser(link);
|
SDL_ANDROID_OpenExternalWebBrowser(link);
|
||||||
|
#else
|
||||||
|
char cmd[PATH_MAX] = "xdg-open ";
|
||||||
|
strcat(cmd, link);
|
||||||
|
system(cmd);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static const NWidgetPart _nested_tutorial_widgets[] = {
|
static const NWidgetPart _nested_tutorial_widgets[] = {
|
||||||
|
|||||||
@@ -563,13 +563,10 @@ int VideoDriver_SDL::PollEvent()
|
|||||||
|
|
||||||
switch (ev.type) {
|
switch (ev.type) {
|
||||||
case SDL_MOUSEMOTION:
|
case SDL_MOUSEMOTION:
|
||||||
#ifdef __ANDROID__
|
|
||||||
// No mouse warping on Android, mouse strictly follows finger
|
|
||||||
if (false) {
|
|
||||||
#else
|
|
||||||
if (_cursor.UpdateCursorPosition(ev.motion.x, ev.motion.y, true)) {
|
if (_cursor.UpdateCursorPosition(ev.motion.x, ev.motion.y, true)) {
|
||||||
#endif
|
#ifndef __ANDROID__ // No mouse warping on Android, mouse strictly follows finger
|
||||||
SDL_CALL SDL_WarpMouse(_cursor.pos.x, _cursor.pos.y);
|
SDL_CALL SDL_WarpMouse(_cursor.pos.x, _cursor.pos.y);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
HandleMouseEvents();
|
HandleMouseEvents();
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user