From 34692ab826abc8f8faa61bdb2280b742424528f1 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Sat, 7 Dec 2013 15:14:29 -0500 Subject: Remove unnecessary Src/ folders --- .../ControllerInterface/ControllerInterface.cpp | 316 +++++++++++++++++++++ 1 file changed, 316 insertions(+) create mode 100644 Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp (limited to 'Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp') diff --git a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp new file mode 100644 index 0000000000..7287c380d5 --- /dev/null +++ b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp @@ -0,0 +1,316 @@ +#include "ControllerInterface.h" + +#ifdef CIFACE_USE_XINPUT + #include "XInput/XInput.h" +#endif +#ifdef CIFACE_USE_DINPUT + #include "DInput/DInput.h" +#endif +#ifdef CIFACE_USE_XLIB + #include "Xlib/Xlib.h" + #ifdef CIFACE_USE_X11_XINPUT2 + #include "Xlib/XInput2.h" + #endif +#endif +#ifdef CIFACE_USE_OSX + #include "OSX/OSX.h" +#endif +#ifdef CIFACE_USE_SDL + #include "SDL/SDL.h" +#endif +#ifdef CIFACE_USE_ANDROID + #include "Android/Android.h" +#endif + +#include "Thread.h" + +using namespace ciface::ExpressionParser; + +namespace +{ +const float INPUT_DETECT_THRESHOLD = 0.55f; +} + +ControllerInterface g_controller_interface; + +// +// Init +// +// detect devices and inputs outputs / will make refresh function later +// +void ControllerInterface::Initialize() +{ + if (m_is_init) + return; + +#ifdef CIFACE_USE_DINPUT + ciface::DInput::Init(m_devices, (HWND)m_hwnd); +#endif +#ifdef CIFACE_USE_XINPUT + ciface::XInput::Init(m_devices); +#endif +#ifdef CIFACE_USE_XLIB + ciface::Xlib::Init(m_devices, m_hwnd); + #ifdef CIFACE_USE_X11_XINPUT2 + ciface::XInput2::Init(m_devices, m_hwnd); + #endif +#endif +#ifdef CIFACE_USE_OSX + ciface::OSX::Init(m_devices, m_hwnd); +#endif +#ifdef CIFACE_USE_SDL + ciface::SDL::Init(m_devices); +#endif +#ifdef CIFACE_USE_ANDROID + ciface::Android::Init(m_devices); +#endif + + m_is_init = true; +} + +// +// DeInit +// +// remove all devices/ call library cleanup functions +// +void ControllerInterface::Shutdown() +{ + if (false == m_is_init) + return; + + std::vector::const_iterator + d = m_devices.begin(), + de = m_devices.end(); + for ( ;d != de; ++d ) + { + std::vector::const_iterator + o = (*d)->Outputs().begin(), + oe = (*d)->Outputs().end(); + // set outputs to ZERO before destroying device + for ( ;o!=oe; ++o) + (*o)->SetState(0); + // update output + (*d)->UpdateOutput(); + + //delete device + delete *d; + } + + m_devices.clear(); + +#ifdef CIFACE_USE_XINPUT + ciface::XInput::DeInit(); +#endif +#ifdef CIFACE_USE_DINPUT + // nothing needed +#endif +#ifdef CIFACE_USE_XLIB + // nothing needed +#endif +#ifdef CIFACE_USE_OSX + ciface::OSX::DeInit(); +#endif +#ifdef CIFACE_USE_SDL + // TODO: there seems to be some sort of memory leak with SDL, quit isn't freeing everything up + SDL_Quit(); +#endif +#ifdef CIFACE_USE_ANDROID + // nothing needed +#endif + + m_is_init = false; +} + +// +// SetHwnd +// +// sets the hwnd used for some crap when initializing, use before calling Init +// +void ControllerInterface::SetHwnd( void* const hwnd ) +{ + m_hwnd = hwnd; +} + +// +// UpdateInput +// +// update input for all devices, return true if all devices returned successful +// +bool ControllerInterface::UpdateInput(const bool force) +{ + std::unique_lock lk(update_lock, std::defer_lock); + + if (force) + lk.lock(); + else if (!lk.try_lock()) + return false; + + size_t ok_count = 0; + + std::vector::const_iterator + d = m_devices.begin(), + e = m_devices.end(); + for ( ;d != e; ++d ) + { + if ((*d)->UpdateInput()) + ++ok_count; + //else + // disabled. it might be causing problems + //(*d)->ClearInputState(); + } + + return (m_devices.size() == ok_count); +} + +// +// UpdateOutput +// +// update output for all devices, return true if all devices returned successful +// +bool ControllerInterface::UpdateOutput(const bool force) +{ + std::unique_lock lk(update_lock, std::defer_lock); + + if (force) + lk.lock(); + else if (!lk.try_lock()) + return false; + + size_t ok_count = 0; + + for (auto d = m_devices.cbegin(); d != m_devices.cend(); ++d) + { + if ((*d)->UpdateOutput()) + ++ok_count; + } + + return (m_devices.size() == ok_count); +} + +// +// InputReference :: State +// +// get the state of an input reference +// override function for ControlReference::State ... +// +ControlState ControllerInterface::InputReference::State( const ControlState ignore ) +{ + if (parsed_expression) + return parsed_expression->GetValue() * range; + else + return 0.0f; +} + +// +// OutputReference :: State +// +// set the state of all binded outputs +// overrides ControlReference::State .. combined them so i could make the gui simple / inputs == same as outputs one list +// i was lazy and it works so watever +// +ControlState ControllerInterface::OutputReference::State(const ControlState state) +{ + if (parsed_expression) + parsed_expression->SetValue(state); + return 0.0f; +} + +// +// UpdateReference +// +// updates a controlreference's binded devices/controls +// need to call this to re-parse a control reference's expression after changing it +// +void ControllerInterface::UpdateReference(ControllerInterface::ControlReference* ref + , const DeviceQualifier& default_device) const +{ + delete ref->parsed_expression; + ref->parsed_expression = NULL; + + ControlFinder finder(*this, default_device, ref->is_input); + ref->parse_error = ParseExpression(ref->expression, finder, &ref->parsed_expression); +} + +// +// InputReference :: Detect +// +// wait for input on all binded devices +// supports not detecting inputs that were held down at the time of Detect start, +// which is useful for those crazy flightsticks that have certain buttons that are always held down +// or some crazy axes or something +// upon input, return pointer to detected Control +// else return NULL +// +Device::Control* ControllerInterface::InputReference::Detect(const unsigned int ms, Device* const device) +{ + unsigned int time = 0; + std::vector states(device->Inputs().size()); + + if (device->Inputs().size() == 0) + return NULL; + + // get starting state of all inputs, + // so we can ignore those that were activated at time of Detect start + std::vector::const_iterator + i = device->Inputs().begin(), + e = device->Inputs().end(); + for (std::vector::iterator state = states.begin(); i != e; ++i) + *state++ = ((*i)->GetState() > (1 - INPUT_DETECT_THRESHOLD)); + + while (time < ms) + { + device->UpdateInput(); + i = device->Inputs().begin(); + for (std::vector::iterator state = states.begin(); i != e; ++i,++state) + { + // detected an input + if ((*i)->IsDetectable() && (*i)->GetState() > INPUT_DETECT_THRESHOLD) + { + // input was released at some point during Detect call + // return the detected input + if (false == *state) + return *i; + } + else if ((*i)->GetState() < (1 - INPUT_DETECT_THRESHOLD)) + { + *state = false; + } + } + Common::SleepCurrentThread(10); time += 10; + } + + // no input was detected + return NULL; +} + +// +// OutputReference :: Detect +// +// Totally different from the inputReference detect / I have them combined so it was simpler to make the GUI. +// The GUI doesn't know the difference between an input and an output / it's odd but I was lazy and it was easy +// +// set all binded outputs to power for x milliseconds return false +// +Device::Control* ControllerInterface::OutputReference::Detect(const unsigned int ms, Device* const device) +{ + // ignore device + + // don't hang if we don't even have any controls mapped + if (BoundCount() > 0) + { + State(1); + unsigned int slept = 0; + + // this loop is to make stuff like flashing keyboard LEDs work + while (ms > (slept += 10)) + { + // TODO: improve this to update more than just the default device's output + device->UpdateOutput(); + Common::SleepCurrentThread(10); + } + + State(0); + device->UpdateOutput(); + } + return NULL; +} -- cgit v1.2.3 From 84aa98a5a4587629d6fa2bc9b3b07a5432c2e131 Mon Sep 17 00:00:00 2001 From: Scott Moreau Date: Sun, 19 Jan 2014 09:11:07 -0700 Subject: wayland: Add bits required to run as a wayland client. --- .../InputCommon/ControllerInterface/ControllerInterface.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp') diff --git a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp index 7287c380d5..493b8ba791 100644 --- a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp +++ b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp @@ -1,5 +1,9 @@ #include "ControllerInterface.h" +#if USE_EGL +#include "GLInterface/Platform.h" +#endif + #ifdef CIFACE_USE_XINPUT #include "XInput/XInput.h" #endif @@ -50,10 +54,16 @@ void ControllerInterface::Initialize() ciface::XInput::Init(m_devices); #endif #ifdef CIFACE_USE_XLIB +#if USE_EGL +if (GLWin.platform == EGL_PLATFORM_X11) { +#endif ciface::Xlib::Init(m_devices, m_hwnd); #ifdef CIFACE_USE_X11_XINPUT2 ciface::XInput2::Init(m_devices, m_hwnd); #endif +#if USE_EGL +} +#endif #endif #ifdef CIFACE_USE_OSX ciface::OSX::Init(m_devices, m_hwnd); -- cgit v1.2.3 From 4b3c338930464c2d3d33d1e6fbd5397ef3067a2e Mon Sep 17 00:00:00 2001 From: Scott Moreau Date: Sun, 19 Jan 2014 19:06:55 -0700 Subject: Merge Platform.h into GLInterface.h --- Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp') diff --git a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp index 493b8ba791..ab99273c31 100644 --- a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp +++ b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp @@ -1,7 +1,7 @@ #include "ControllerInterface.h" #if USE_EGL -#include "GLInterface/Platform.h" +#include "GLInterface.h" #endif #ifdef CIFACE_USE_XINPUT -- cgit v1.2.3 From 2c8340e1dc3b05d7f314c363ebc9278f40eb5350 Mon Sep 17 00:00:00 2001 From: Scott Moreau Date: Mon, 20 Jan 2014 00:46:21 -0700 Subject: Move GLInterface.h into GLInterface directory --- Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp') diff --git a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp index ab99273c31..66a7b1e56c 100644 --- a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp +++ b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp @@ -1,7 +1,7 @@ #include "ControllerInterface.h" #if USE_EGL -#include "GLInterface.h" +#include "GLInterface/GLInterface.h" #endif #ifdef CIFACE_USE_XINPUT -- cgit v1.2.3 From d91a5abba1d66948cc43cc7a6c80827ede061bc8 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 30 Jan 2014 19:51:21 -0500 Subject: Light cleanup to a little bit of InputCommon. Replaces much of the iterators that litter this section of the codebase. Also clean up a little bit of the comments that describe the interface classes. --- .../ControllerInterface/ControllerInterface.cpp | 82 ++++++++++------------ 1 file changed, 37 insertions(+), 45 deletions(-) (limited to 'Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp') diff --git a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp index 66a7b1e56c..9eca17118d 100644 --- a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp +++ b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp @@ -38,9 +38,9 @@ const float INPUT_DETECT_THRESHOLD = 0.55f; ControllerInterface g_controller_interface; // -// Init +// Init // -// detect devices and inputs outputs / will make refresh function later +// Detect devices and inputs outputs / will make refresh function later // void ControllerInterface::Initialize() { @@ -79,31 +79,26 @@ if (GLWin.platform == EGL_PLATFORM_X11) { } // -// DeInit +// DeInit // -// remove all devices/ call library cleanup functions +// Remove all devices/ call library cleanup functions // void ControllerInterface::Shutdown() { - if (false == m_is_init) + if (!m_is_init) return; - std::vector::const_iterator - d = m_devices.begin(), - de = m_devices.end(); - for ( ;d != de; ++d ) + for (Device* d : m_devices) { - std::vector::const_iterator - o = (*d)->Outputs().begin(), - oe = (*d)->Outputs().end(); - // set outputs to ZERO before destroying device - for ( ;o!=oe; ++o) - (*o)->SetState(0); - // update output - (*d)->UpdateOutput(); - - //delete device - delete *d; + // Set outputs to ZERO before destroying device + for (Device::Output* o : d->Outputs()) + o->SetState(0); + + // Update output + d->UpdateOutput(); + + // Delete device + delete d; } m_devices.clear(); @@ -132,9 +127,9 @@ void ControllerInterface::Shutdown() } // -// SetHwnd +// SetHwnd // -// sets the hwnd used for some crap when initializing, use before calling Init +// Sets the hwnd used for some crap when initializing, use before calling Init // void ControllerInterface::SetHwnd( void* const hwnd ) { @@ -142,9 +137,9 @@ void ControllerInterface::SetHwnd( void* const hwnd ) } // -// UpdateInput +// UpdateInput // -// update input for all devices, return true if all devices returned successful +// Update input for all devices, return true if all devices returned successful // bool ControllerInterface::UpdateInput(const bool force) { @@ -153,16 +148,13 @@ bool ControllerInterface::UpdateInput(const bool force) if (force) lk.lock(); else if (!lk.try_lock()) - return false; + return false; size_t ok_count = 0; - std::vector::const_iterator - d = m_devices.begin(), - e = m_devices.end(); - for ( ;d != e; ++d ) + for (Device* d : m_devices) { - if ((*d)->UpdateInput()) + if (d->UpdateInput()) ++ok_count; //else // disabled. it might be causing problems @@ -173,9 +165,9 @@ bool ControllerInterface::UpdateInput(const bool force) } // -// UpdateOutput +// UpdateOutput // -// update output for all devices, return true if all devices returned successful +// Update output for all devices, return true if all devices returned successful // bool ControllerInterface::UpdateOutput(const bool force) { @@ -188,9 +180,9 @@ bool ControllerInterface::UpdateOutput(const bool force) size_t ok_count = 0; - for (auto d = m_devices.cbegin(); d != m_devices.cend(); ++d) + for (Device* d : m_devices) { - if ((*d)->UpdateOutput()) + if (d->UpdateOutput()) ++ok_count; } @@ -198,9 +190,9 @@ bool ControllerInterface::UpdateOutput(const bool force) } // -// InputReference :: State +// InputReference :: State // -// get the state of an input reference +// Gets the state of an input reference // override function for ControlReference::State ... // ControlState ControllerInterface::InputReference::State( const ControlState ignore ) @@ -212,11 +204,11 @@ ControlState ControllerInterface::InputReference::State( const ControlState igno } // -// OutputReference :: State +// OutputReference :: State // -// set the state of all binded outputs -// overrides ControlReference::State .. combined them so i could make the gui simple / inputs == same as outputs one list -// i was lazy and it works so watever +// Set the state of all binded outputs +// overrides ControlReference::State .. combined them so I could make the GUI simple / inputs == same as outputs one list +// I was lazy and it works so watever // ControlState ControllerInterface::OutputReference::State(const ControlState state) { @@ -226,9 +218,9 @@ ControlState ControllerInterface::OutputReference::State(const ControlState stat } // -// UpdateReference +// UpdateReference // -// updates a controlreference's binded devices/controls +// Updates a controlreference's binded devices/controls // need to call this to re-parse a control reference's expression after changing it // void ControllerInterface::UpdateReference(ControllerInterface::ControlReference* ref @@ -242,9 +234,9 @@ void ControllerInterface::UpdateReference(ControllerInterface::ControlReference* } // -// InputReference :: Detect +// InputReference :: Detect // -// wait for input on all binded devices +// Wait for input on all binded devices // supports not detecting inputs that were held down at the time of Detect start, // which is useful for those crazy flightsticks that have certain buttons that are always held down // or some crazy axes or something @@ -294,7 +286,7 @@ Device::Control* ControllerInterface::InputReference::Detect(const unsigned int } // -// OutputReference :: Detect +// OutputReference :: Detect // // Totally different from the inputReference detect / I have them combined so it was simpler to make the GUI. // The GUI doesn't know the difference between an input and an output / it's odd but I was lazy and it was easy -- cgit v1.2.3 From d2038049f51192fbb55fbde2fc08128bacfb7707 Mon Sep 17 00:00:00 2001 From: lioncash Date: Mon, 10 Feb 2014 13:54:46 -0500 Subject: Replace all include guard ifdefs with "#pragma once" --- Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp') diff --git a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp index 9eca17118d..f1e2136ba9 100644 --- a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp +++ b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp @@ -1,3 +1,7 @@ +// Copyright 2013 Dolphin Emulator Project +// Licensed under GPLv2 +// Refer to the license.txt file included. + #include "ControllerInterface.h" #if USE_EGL -- cgit v1.2.3 From 2afe2152712981e21d6bda6f029292ed2b1cf91e Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 17 Feb 2014 05:18:15 -0500 Subject: Convert all includes to relative paths. --- .../ControllerInterface/ControllerInterface.cpp | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp') diff --git a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp index f1e2136ba9..7153a8d7f7 100644 --- a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp +++ b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp @@ -2,36 +2,35 @@ // Licensed under GPLv2 // Refer to the license.txt file included. -#include "ControllerInterface.h" +#include "Common/Thread.h" +#include "InputCommon/ControllerInterface/ControllerInterface.h" #if USE_EGL -#include "GLInterface/GLInterface.h" +#include "DolphinWX/GLInterface/GLInterface.h" #endif #ifdef CIFACE_USE_XINPUT - #include "XInput/XInput.h" + #include "InputCommon/ControllerInterface/XInput/XInput.h" #endif #ifdef CIFACE_USE_DINPUT - #include "DInput/DInput.h" + #include "InputCommon/ControllerInterface/DInput/DInput.h" #endif #ifdef CIFACE_USE_XLIB - #include "Xlib/Xlib.h" + #include "InputCommon/ControllerInterface/Xlib/Xlib.h" #ifdef CIFACE_USE_X11_XINPUT2 - #include "Xlib/XInput2.h" + #include "InputCommon/ControllerInterface/Xlib/XInput2.h" #endif #endif #ifdef CIFACE_USE_OSX - #include "OSX/OSX.h" + #include "InputCommon/ControllerInterface/OSX/OSX.h" #endif #ifdef CIFACE_USE_SDL - #include "SDL/SDL.h" + #include "InputCommon/ControllerInterface/SDL/SDL.h" #endif #ifdef CIFACE_USE_ANDROID - #include "Android/Android.h" + #include "InputCommon/ControllerInterface/Android/Android.h" #endif -#include "Thread.h" - using namespace ciface::ExpressionParser; namespace -- cgit v1.2.3 From d802d392811be44d34ae9cd23f616db93e54c50f Mon Sep 17 00:00:00 2001 From: Tillmann Karras Date: Sun, 9 Mar 2014 21:14:26 +0100 Subject: clang-modernize -use-nullptr and s/\bNULL\b/nullptr/g for *.cpp/h/mm files not compiled on my machine --- .../InputCommon/ControllerInterface/ControllerInterface.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp') diff --git a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp index 7153a8d7f7..a2534b56a1 100644 --- a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp +++ b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp @@ -230,7 +230,7 @@ void ControllerInterface::UpdateReference(ControllerInterface::ControlReference* , const DeviceQualifier& default_device) const { delete ref->parsed_expression; - ref->parsed_expression = NULL; + ref->parsed_expression = nullptr; ControlFinder finder(*this, default_device, ref->is_input); ref->parse_error = ParseExpression(ref->expression, finder, &ref->parsed_expression); @@ -244,7 +244,7 @@ void ControllerInterface::UpdateReference(ControllerInterface::ControlReference* // which is useful for those crazy flightsticks that have certain buttons that are always held down // or some crazy axes or something // upon input, return pointer to detected Control -// else return NULL +// else return nullptr // Device::Control* ControllerInterface::InputReference::Detect(const unsigned int ms, Device* const device) { @@ -252,7 +252,7 @@ Device::Control* ControllerInterface::InputReference::Detect(const unsigned int std::vector states(device->Inputs().size()); if (device->Inputs().size() == 0) - return NULL; + return nullptr; // get starting state of all inputs, // so we can ignore those that were activated at time of Detect start @@ -285,7 +285,7 @@ Device::Control* ControllerInterface::InputReference::Detect(const unsigned int } // no input was detected - return NULL; + return nullptr; } // @@ -317,5 +317,5 @@ Device::Control* ControllerInterface::OutputReference::Detect(const unsigned int State(0); device->UpdateOutput(); } - return NULL; + return nullptr; } -- cgit v1.2.3 From 226a9c239220c5ba99508a6b96ce28903a35be80 Mon Sep 17 00:00:00 2001 From: Pierre Bourdon Date: Fri, 1 Aug 2014 23:21:03 -0700 Subject: Move GLInterface around to remove VideoBackends dependency on DolphinWX --- .../InputCommon/ControllerInterface/ControllerInterface.cpp | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp') diff --git a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp index a2534b56a1..fc797ebdec 100644 --- a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp +++ b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp @@ -5,10 +5,6 @@ #include "Common/Thread.h" #include "InputCommon/ControllerInterface/ControllerInterface.h" -#if USE_EGL -#include "DolphinWX/GLInterface/GLInterface.h" -#endif - #ifdef CIFACE_USE_XINPUT #include "InputCommon/ControllerInterface/XInput/XInput.h" #endif @@ -57,16 +53,10 @@ void ControllerInterface::Initialize() ciface::XInput::Init(m_devices); #endif #ifdef CIFACE_USE_XLIB -#if USE_EGL -if (GLWin.platform == EGL_PLATFORM_X11) { -#endif ciface::Xlib::Init(m_devices, m_hwnd); #ifdef CIFACE_USE_X11_XINPUT2 ciface::XInput2::Init(m_devices, m_hwnd); #endif -#if USE_EGL -} -#endif #endif #ifdef CIFACE_USE_OSX ciface::OSX::Init(m_devices, m_hwnd); -- cgit v1.2.3 From 0d989ea82be5863ac0f1313302c296f7fb9bd92b Mon Sep 17 00:00:00 2001 From: Tony Wasserka Date: Mon, 4 Aug 2014 18:26:03 +0200 Subject: Restore Wayland compatibility. It was broken by e15ec56bf0237 because it wasn't deemed important. However chances are people will eventually start using Dolphin on that configuration, so we shouldn't frivolously drop compatibility without good reason. --- .../InputCommon/ControllerInterface/ControllerInterface.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp') diff --git a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp index fc797ebdec..366485daa2 100644 --- a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp +++ b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp @@ -5,6 +5,10 @@ #include "Common/Thread.h" #include "InputCommon/ControllerInterface/ControllerInterface.h" +#if USE_EGL +#include "DolphinWX/GLInterface/GLInterface.h" +#endif + #ifdef CIFACE_USE_XINPUT #include "InputCommon/ControllerInterface/XInput/XInput.h" #endif @@ -53,10 +57,15 @@ void ControllerInterface::Initialize() ciface::XInput::Init(m_devices); #endif #ifdef CIFACE_USE_XLIB - ciface::Xlib::Init(m_devices, m_hwnd); +#if USE_EGL + if (GLWin.platform == EGL_PLATFORM_X11) +#endif + { + ciface::Xlib::Init(m_devices, m_hwnd); #ifdef CIFACE_USE_X11_XINPUT2 ciface::XInput2::Init(m_devices, m_hwnd); #endif + } #endif #ifdef CIFACE_USE_OSX ciface::OSX::Init(m_devices, m_hwnd); -- cgit v1.2.3 From 8bd4b9d2f90ca62de609be3dd07564f70edc44ad Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Tue, 5 Aug 2014 20:33:50 -0400 Subject: Remove support for Wayland Yes, this is a fancy new feature, but our Wayland support was particularly bitrotten, and ideally this would be handled by a platform layer like SDL. If not, we can always add this back in when GLInterface has caught up. We might be able to even support wxWidgets and GL together with subsurfaces! --- .../Core/InputCommon/ControllerInterface/ControllerInterface.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp') diff --git a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp index 366485daa2..d90b3bf02a 100644 --- a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp +++ b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp @@ -57,15 +57,10 @@ void ControllerInterface::Initialize() ciface::XInput::Init(m_devices); #endif #ifdef CIFACE_USE_XLIB -#if USE_EGL - if (GLWin.platform == EGL_PLATFORM_X11) -#endif - { - ciface::Xlib::Init(m_devices, m_hwnd); + ciface::Xlib::Init(m_devices, m_hwnd); #ifdef CIFACE_USE_X11_XINPUT2 - ciface::XInput2::Init(m_devices, m_hwnd); + ciface::XInput2::Init(m_devices, m_hwnd); #endif - } #endif #ifdef CIFACE_USE_OSX ciface::OSX::Init(m_devices, m_hwnd); -- cgit v1.2.3 From 2d974b60864e0917881d687e29a328c032888a03 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Sat, 9 Aug 2014 09:49:45 -0400 Subject: GLInterface: Destroy GLWin Everything is now safely tucked inside each individual GLInterface. --- Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp | 4 ---- 1 file changed, 4 deletions(-) (limited to 'Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp') diff --git a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp index d90b3bf02a..6d9d3b82a2 100644 --- a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp +++ b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp @@ -5,10 +5,6 @@ #include "Common/Thread.h" #include "InputCommon/ControllerInterface/ControllerInterface.h" -#if USE_EGL -#include "DolphinWX/GLInterface/GLInterface.h" -#endif - #ifdef CIFACE_USE_XINPUT #include "InputCommon/ControllerInterface/XInput/XInput.h" #endif -- cgit v1.2.3 From b0060e51843d085af6c7426d216cdd1bbc41dbbb Mon Sep 17 00:00:00 2001 From: Rohit Nirmal Date: Thu, 4 Sep 2014 19:41:42 -0500 Subject: Controller Interface: Remove "using namespace" in header file. --- .../ControllerInterface/ControllerInterface.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp') diff --git a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp index 6d9d3b82a2..09fcf12ed8 100644 --- a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp +++ b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp @@ -81,10 +81,10 @@ void ControllerInterface::Shutdown() if (!m_is_init) return; - for (Device* d : m_devices) + for (ciface::Core::Device* d : m_devices) { // Set outputs to ZERO before destroying device - for (Device::Output* o : d->Outputs()) + for (ciface::Core::Device::Output* o : d->Outputs()) o->SetState(0); // Update output @@ -145,7 +145,7 @@ bool ControllerInterface::UpdateInput(const bool force) size_t ok_count = 0; - for (Device* d : m_devices) + for (ciface::Core::Device* d : m_devices) { if (d->UpdateInput()) ++ok_count; @@ -173,7 +173,7 @@ bool ControllerInterface::UpdateOutput(const bool force) size_t ok_count = 0; - for (Device* d : m_devices) + for (ciface::Core::Device* d : m_devices) { if (d->UpdateOutput()) ++ok_count; @@ -217,7 +217,7 @@ ControlState ControllerInterface::OutputReference::State(const ControlState stat // need to call this to re-parse a control reference's expression after changing it // void ControllerInterface::UpdateReference(ControllerInterface::ControlReference* ref - , const DeviceQualifier& default_device) const + , const ciface::Core::DeviceQualifier& default_device) const { delete ref->parsed_expression; ref->parsed_expression = nullptr; @@ -236,7 +236,7 @@ void ControllerInterface::UpdateReference(ControllerInterface::ControlReference* // upon input, return pointer to detected Control // else return nullptr // -Device::Control* ControllerInterface::InputReference::Detect(const unsigned int ms, Device* const device) +ciface::Core::Device::Control* ControllerInterface::InputReference::Detect(const unsigned int ms, ciface::Core::Device* const device) { unsigned int time = 0; std::vector states(device->Inputs().size()); @@ -246,7 +246,7 @@ Device::Control* ControllerInterface::InputReference::Detect(const unsigned int // get starting state of all inputs, // so we can ignore those that were activated at time of Detect start - std::vector::const_iterator + std::vector::const_iterator i = device->Inputs().begin(), e = device->Inputs().end(); for (std::vector::iterator state = states.begin(); i != e; ++i) @@ -286,7 +286,7 @@ Device::Control* ControllerInterface::InputReference::Detect(const unsigned int // // set all binded outputs to power for x milliseconds return false // -Device::Control* ControllerInterface::OutputReference::Detect(const unsigned int ms, Device* const device) +ciface::Core::Device::Control* ControllerInterface::OutputReference::Detect(const unsigned int ms, ciface::Core::Device* const device) { // ignore device -- cgit v1.2.3 From b7b2074cc2e78bb13160372ee82be7f85d0e3772 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 13 Oct 2014 12:45:47 -0400 Subject: ControllerInterface: Get rid of SetHwnd(), introduce Reinitialize() Initialize now just takes the handle directly. Reinitialize is added because it is much more straightforward in comparison to doing the Shutdown-Initialize manually. --- .../ControllerInterface/ControllerInterface.cpp | 31 +++++++++++----------- 1 file changed, 16 insertions(+), 15 deletions(-) (limited to 'Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp') diff --git a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp index 09fcf12ed8..ec2973f3d3 100644 --- a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp +++ b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp @@ -41,25 +41,27 @@ ControllerInterface g_controller_interface; // // Detect devices and inputs outputs / will make refresh function later // -void ControllerInterface::Initialize() +void ControllerInterface::Initialize(void* const hwnd) { if (m_is_init) return; + m_hwnd = hwnd; + #ifdef CIFACE_USE_DINPUT - ciface::DInput::Init(m_devices, (HWND)m_hwnd); + ciface::DInput::Init(m_devices, (HWND)hwnd); #endif #ifdef CIFACE_USE_XINPUT ciface::XInput::Init(m_devices); #endif #ifdef CIFACE_USE_XLIB - ciface::Xlib::Init(m_devices, m_hwnd); + ciface::Xlib::Init(m_devices, hwnd); #ifdef CIFACE_USE_X11_XINPUT2 - ciface::XInput2::Init(m_devices, m_hwnd); + ciface::XInput2::Init(m_devices, hwnd); #endif #endif #ifdef CIFACE_USE_OSX - ciface::OSX::Init(m_devices, m_hwnd); + ciface::OSX::Init(m_devices, hwnd); #endif #ifdef CIFACE_USE_SDL ciface::SDL::Init(m_devices); @@ -71,6 +73,15 @@ void ControllerInterface::Initialize() m_is_init = true; } +void ControllerInterface::Reinitialize() +{ + if (!m_is_init) + return; + + Shutdown(); + Initialize(m_hwnd); +} + // // DeInit // @@ -119,16 +130,6 @@ void ControllerInterface::Shutdown() m_is_init = false; } -// -// SetHwnd -// -// Sets the hwnd used for some crap when initializing, use before calling Init -// -void ControllerInterface::SetHwnd( void* const hwnd ) -{ - m_hwnd = hwnd; -} - // // UpdateInput // -- cgit v1.2.3 From e9cb629723bb0fabbad130c2a63b3cdbaaf8ba6a Mon Sep 17 00:00:00 2001 From: Rachel Bryk Date: Sun, 9 Nov 2014 15:02:18 -0500 Subject: Fix some double->float conversions. --- Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp') diff --git a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp index ec2973f3d3..e75df76a36 100644 --- a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp +++ b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp @@ -31,7 +31,7 @@ using namespace ciface::ExpressionParser; namespace { -const float INPUT_DETECT_THRESHOLD = 0.55f; +const ControlState INPUT_DETECT_THRESHOLD = 0.55; } ControllerInterface g_controller_interface; @@ -194,7 +194,7 @@ ControlState ControllerInterface::InputReference::State( const ControlState igno if (parsed_expression) return parsed_expression->GetValue() * range; else - return 0.0f; + return 0.0; } // @@ -208,7 +208,7 @@ ControlState ControllerInterface::OutputReference::State(const ControlState stat { if (parsed_expression) parsed_expression->SetValue(state); - return 0.0f; + return 0.0; } // -- cgit v1.2.3 From b5d4e8d37ec240632c7be40d6f670da10d9de2a4 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Thu, 13 Nov 2014 00:10:02 -0800 Subject: ControllerInterface: Remove unused "force" parameter I'm not sure when this nonsense of forcing locking the mutex when it's already taken should have ever taken effect, but let's be thankful it isn't now. That was a badly worded sentence. --- .../InputCommon/ControllerInterface/ControllerInterface.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp') diff --git a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp index e75df76a36..ddfde30118 100644 --- a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp +++ b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp @@ -135,13 +135,11 @@ void ControllerInterface::Shutdown() // // Update input for all devices, return true if all devices returned successful // -bool ControllerInterface::UpdateInput(const bool force) +bool ControllerInterface::UpdateInput() { std::unique_lock lk(update_lock, std::defer_lock); - if (force) - lk.lock(); - else if (!lk.try_lock()) + if (!lk.try_lock()) return false; size_t ok_count = 0; @@ -163,13 +161,11 @@ bool ControllerInterface::UpdateInput(const bool force) // // Update output for all devices, return true if all devices returned successful // -bool ControllerInterface::UpdateOutput(const bool force) +bool ControllerInterface::UpdateOutput() { std::unique_lock lk(update_lock, std::defer_lock); - if (force) - lk.lock(); - else if (!lk.try_lock()) + if (!lk.try_lock()) return false; size_t ok_count = 0; -- cgit v1.2.3 From 61fcfc4bf2058d971af6882af2765ad34d935fcb Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Thu, 13 Nov 2014 00:56:32 -0800 Subject: ControllerInterface: Remove unused ClearInputState --- Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp | 3 --- 1 file changed, 3 deletions(-) (limited to 'Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp') diff --git a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp index ddfde30118..95ce7e5d96 100644 --- a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp +++ b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp @@ -148,9 +148,6 @@ bool ControllerInterface::UpdateInput() { if (d->UpdateInput()) ++ok_count; - //else - // disabled. it might be causing problems - //(*d)->ClearInputState(); } return (m_devices.size() == ok_count); -- cgit v1.2.3 From f2787f620eebbbfb746f59cfbd0318210297061b Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Thu, 13 Nov 2014 00:55:14 -0800 Subject: ControllerInterface: Make UpdateInput / UpdateOutput return void The return values here have never been checked, so it doesn't make sense to return a value to begin with. --- .../ControllerInterface/ControllerInterface.cpp | 26 +++++----------------- 1 file changed, 6 insertions(+), 20 deletions(-) (limited to 'Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp') diff --git a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp index 95ce7e5d96..74aa6de3a3 100644 --- a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp +++ b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp @@ -135,22 +135,15 @@ void ControllerInterface::Shutdown() // // Update input for all devices, return true if all devices returned successful // -bool ControllerInterface::UpdateInput() +void ControllerInterface::UpdateInput() { std::unique_lock lk(update_lock, std::defer_lock); if (!lk.try_lock()) - return false; - - size_t ok_count = 0; + return; for (ciface::Core::Device* d : m_devices) - { - if (d->UpdateInput()) - ++ok_count; - } - - return (m_devices.size() == ok_count); + d->UpdateInput(); } // @@ -158,22 +151,15 @@ bool ControllerInterface::UpdateInput() // // Update output for all devices, return true if all devices returned successful // -bool ControllerInterface::UpdateOutput() +void ControllerInterface::UpdateOutput() { std::unique_lock lk(update_lock, std::defer_lock); if (!lk.try_lock()) - return false; - - size_t ok_count = 0; + return; for (ciface::Core::Device* d : m_devices) - { - if (d->UpdateOutput()) - ++ok_count; - } - - return (m_devices.size() == ok_count); + d->UpdateOutput(); } // -- cgit v1.2.3 From f3b739341ee5ad000e8c58b971ed7e273dd9870e Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Thu, 13 Nov 2014 01:11:43 -0800 Subject: HW: Remove UpdateOutput All of the rumble interfaces are now immediate mode. --- .../ControllerInterface/ControllerInterface.cpp | 24 ---------------------- 1 file changed, 24 deletions(-) (limited to 'Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp') diff --git a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp index 74aa6de3a3..3eb1b95ff2 100644 --- a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp +++ b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp @@ -98,9 +98,6 @@ void ControllerInterface::Shutdown() for (ciface::Core::Device::Output* o : d->Outputs()) o->SetState(0); - // Update output - d->UpdateOutput(); - // Delete device delete d; } @@ -146,22 +143,6 @@ void ControllerInterface::UpdateInput() d->UpdateInput(); } -// -// UpdateOutput -// -// Update output for all devices, return true if all devices returned successful -// -void ControllerInterface::UpdateOutput() -{ - std::unique_lock lk(update_lock, std::defer_lock); - - if (!lk.try_lock()) - return; - - for (ciface::Core::Device* d : m_devices) - d->UpdateOutput(); -} - // // InputReference :: State // @@ -278,14 +259,9 @@ ciface::Core::Device::Control* ControllerInterface::OutputReference::Detect(cons // this loop is to make stuff like flashing keyboard LEDs work while (ms > (slept += 10)) - { - // TODO: improve this to update more than just the default device's output - device->UpdateOutput(); Common::SleepCurrentThread(10); - } State(0); - device->UpdateOutput(); } return nullptr; } -- cgit v1.2.3 From 780eef68f6ec7deee1a11f8bc1386f70133b6cc0 Mon Sep 17 00:00:00 2001 From: skidau Date: Thu, 5 Mar 2015 19:49:10 +1100 Subject: Fixed the crash that would occur when the Refresh button was pressed in the controllers config. - Simplified the locking mechanism when controllers were updated - Reloaded the config of the controls instead of re-initialising the control plugins - Fixed controls being unresponsive after the Refresh button was pressed - Disables the hotkeys while the controller config is open --- Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp | 3 --- 1 file changed, 3 deletions(-) (limited to 'Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp') diff --git a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp index 3eb1b95ff2..1330cb1e0a 100644 --- a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp +++ b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp @@ -136,9 +136,6 @@ void ControllerInterface::UpdateInput() { std::unique_lock lk(update_lock, std::defer_lock); - if (!lk.try_lock()) - return; - for (ciface::Core::Device* d : m_devices) d->UpdateInput(); } -- cgit v1.2.3 From c76008b4b9eccf0c8fc04a0dada0313fc6d8c3f6 Mon Sep 17 00:00:00 2001 From: skidau Date: Thu, 12 Mar 2015 23:41:30 +1100 Subject: Removed the controller update lock as it is no longer needed. --- Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp') diff --git a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp index 1330cb1e0a..00a9579daf 100644 --- a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp +++ b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp @@ -134,8 +134,6 @@ void ControllerInterface::Shutdown() // void ControllerInterface::UpdateInput() { - std::unique_lock lk(update_lock, std::defer_lock); - for (ciface::Core::Device* d : m_devices) d->UpdateInput(); } -- cgit v1.2.3 From cefcb0ace9d363b3679b4e93bcc9ec05f1e5f4f8 Mon Sep 17 00:00:00 2001 From: Tillmann Karras Date: Mon, 18 May 2015 01:08:10 +0200 Subject: Update license headers to GPLv2+ --- Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp') diff --git a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp index 00a9579daf..ddf89def25 100644 --- a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp +++ b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp @@ -1,5 +1,5 @@ // Copyright 2013 Dolphin Emulator Project -// Licensed under GPLv2 +// Licensed under GPLv2+ // Refer to the license.txt file included. #include "Common/Thread.h" -- cgit v1.2.3 From 30ebb2459eb97ba544547183854775df8460b475 Mon Sep 17 00:00:00 2001 From: Tillmann Karras Date: Sun, 24 May 2015 06:55:12 +0200 Subject: Set copyright year to when a file was created --- Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp') diff --git a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp index ddf89def25..6b8b11fd3a 100644 --- a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp +++ b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp @@ -1,4 +1,4 @@ -// Copyright 2013 Dolphin Emulator Project +// Copyright 2010 Dolphin Emulator Project // Licensed under GPLv2+ // Refer to the license.txt file included. -- cgit v1.2.3 From 9ec5a4544f207a31678e6c5c7636873e9d9e88a1 Mon Sep 17 00:00:00 2001 From: Tillmann Karras Date: Fri, 5 Jun 2015 19:34:06 +0200 Subject: SDL: handle SDL_QUIT event Using SDL_INIT_JOYSTICK implies SDL_INIT_EVENTS which installs a signal handler for SIGINT and SIGTERM. There will be a way to prevent this in 2.0.4 but for now we'll need to handle SDL_QUIT. --- Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp') diff --git a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp index 6b8b11fd3a..2c87e77f01 100644 --- a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp +++ b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp @@ -134,6 +134,11 @@ void ControllerInterface::Shutdown() // void ControllerInterface::UpdateInput() { +#ifdef CIFACE_USE_SDL + // SDL currently also handles SIGINT and SIGTERM, + // so make sure to update it even if there is no SDL device. + ciface::SDL::UpdateInput(); +#endif for (ciface::Core::Device* d : m_devices) d->UpdateInput(); } -- cgit v1.2.3 From 9e1aab663f2afdd61bda773764cc3c8f652659aa Mon Sep 17 00:00:00 2001 From: Matthew Parlane Date: Mon, 8 Jun 2015 13:43:39 +1200 Subject: Revert "SDL: handle SDL_QUIT event" --- Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp | 5 ----- 1 file changed, 5 deletions(-) (limited to 'Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp') diff --git a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp index 2c87e77f01..6b8b11fd3a 100644 --- a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp +++ b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp @@ -134,11 +134,6 @@ void ControllerInterface::Shutdown() // void ControllerInterface::UpdateInput() { -#ifdef CIFACE_USE_SDL - // SDL currently also handles SIGINT and SIGTERM, - // so make sure to update it even if there is no SDL device. - ciface::SDL::UpdateInput(); -#endif for (ciface::Core::Device* d : m_devices) d->UpdateInput(); } -- cgit v1.2.3