summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Kiall Mac Innes <kiall@macinnes.ie>2019-05-14 21:55:59 +0100
committer R. Belmont <rb6502@users.noreply.github.com>2019-05-14 16:55:59 -0400
commit16bbe847ef289d09cc5d3908d75462131a2b6aa5 (patch)
treed1692a8c50358f8d0ff27158d8a985c3bb0dee72
parent0c86462c1f406f24a10fc8ab2cf6bead15b803b1 (diff)
Disable WII Lightgun hack by default (#5056)
-rw-r--r--makefile5
-rw-r--r--scripts/src/osd/sdl.lua13
-rw-r--r--scripts/src/osd/sdl_cfg.lua10
-rw-r--r--src/osd/sdl/window.cpp2
4 files changed, 29 insertions, 1 deletions
diff --git a/makefile b/makefile
index 537f22bbeb2..1d9de309e4b 100644
--- a/makefile
+++ b/makefile
@@ -36,6 +36,7 @@
# USE_QTDEBUG = 1
# NO_X11 = 1
# NO_USE_XINPUT = 1
+# NO_USE_XINPUT_WII_LIGHTGUN_HACK = 1
# FORCE_DRC_C_BACKEND = 1
# DEBUG = 1
@@ -745,6 +746,10 @@ ifdef NO_USE_XINPUT
PARAMS += --NO_USE_XINPUT='$(NO_USE_XINPUT)'
endif
+ifdef NO_USE_XINPUT_WII_LIGHTGUN_HACK
+PARAMS += --NO_USE_XINPUT_WII_LIGHTGUN_HACK='$(NO_USE_XINPUT_WII_LIGHTGUN_HACK)'
+endif
+
ifdef SDL_LIBVER
PARAMS += --SDL_LIBVER='$(SDL_LIBVER)'
endif
diff --git a/scripts/src/osd/sdl.lua b/scripts/src/osd/sdl.lua
index 0d5b72e21a6..9485fcc553c 100644
--- a/scripts/src/osd/sdl.lua
+++ b/scripts/src/osd/sdl.lua
@@ -178,6 +178,19 @@ if not _OPTIONS["NO_USE_XINPUT"] then
end
newoption {
+ trigger = "NO_USE_XINPUT_WII_LIGHTGUN_HACK",
+ description = "Disable use of Xinput Wii Lightgun Hack",
+ allowed = {
+ { "0", "Enable Xinput Wii Lightgun Hack" },
+ { "1", "Disable Xinput Wii Lightgun Hack" },
+ },
+}
+
+if not _OPTIONS["NO_USE_XINPUT_WII_LIGHTGUN_HACK"] then
+ _OPTIONS["NO_USE_XINPUT_WII_LIGHTGUN_HACK"] = "1"
+end
+
+newoption {
trigger = "SDL2_MULTIAPI",
description = "Use couriersud's multi-keyboard patch for SDL 2.1? (this API was removed prior to the 2.0 release)",
allowed = {
diff --git a/scripts/src/osd/sdl_cfg.lua b/scripts/src/osd/sdl_cfg.lua
index 944c1636dc3..ad3750184fd 100644
--- a/scripts/src/osd/sdl_cfg.lua
+++ b/scripts/src/osd/sdl_cfg.lua
@@ -52,6 +52,16 @@ else
}
end
+if _OPTIONS["NO_USE_XINPUT_WII_LIGHTGUN_HACK"]=="1" then
+ defines {
+ "USE_XINPUT_WII_LIGHTGUN_HACK=0",
+ }
+else
+ defines {
+ "USE_XINPUT_WII_LIGHTGUN_HACK=1",
+ }
+end
+
if _OPTIONS["NO_USE_MIDI"]~="1" and _OPTIONS["targetos"]=="linux" then
buildoptions {
backtick(pkgconfigcmd() .. " --cflags alsa"),
diff --git a/src/osd/sdl/window.cpp b/src/osd/sdl/window.cpp
index 030804f5db8..18899cf1b69 100644
--- a/src/osd/sdl/window.cpp
+++ b/src/osd/sdl/window.cpp
@@ -356,7 +356,7 @@ void sdl_window_info::modify_prescale(int dir)
void sdl_window_info::update_cursor_state()
{
-#if (USE_XINPUT)
+#if (USE_XINPUT && USE_XINPUT_WII_LIGHTGUN_HACK)
// Hack for wii-lightguns:
// they stop working with a grabbed mouse;
// even a ShowCursor(SDL_DISABLE) already does this.