From 16bbe847ef289d09cc5d3908d75462131a2b6aa5 Mon Sep 17 00:00:00 2001 From: Kiall Mac Innes Date: Tue, 14 May 2019 21:55:59 +0100 Subject: Disable WII Lightgun hack by default (#5056) --- makefile | 5 +++++ scripts/src/osd/sdl.lua | 13 +++++++++++++ scripts/src/osd/sdl_cfg.lua | 10 ++++++++++ src/osd/sdl/window.cpp | 2 +- 4 files changed, 29 insertions(+), 1 deletion(-) 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 @@ -177,6 +177,19 @@ if not _OPTIONS["NO_USE_XINPUT"] then end 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)", 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. -- cgit v1.2.3