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/DInput/DInput.cpp | 65 ++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 Source/Core/InputCommon/ControllerInterface/DInput/DInput.cpp (limited to 'Source/Core/InputCommon/ControllerInterface/DInput/DInput.cpp') diff --git a/Source/Core/InputCommon/ControllerInterface/DInput/DInput.cpp b/Source/Core/InputCommon/ControllerInterface/DInput/DInput.cpp new file mode 100644 index 0000000000..6b7b492ea9 --- /dev/null +++ b/Source/Core/InputCommon/ControllerInterface/DInput/DInput.cpp @@ -0,0 +1,65 @@ + +#include "DInput.h" + +#include "StringUtil.h" + +#include "DInputJoystick.h" +#include "DInputKeyboardMouse.h" + +#pragma comment(lib, "Dinput8.lib") +#pragma comment(lib, "dxguid.lib") + +namespace ciface +{ +namespace DInput +{ + +//BOOL CALLBACK DIEnumEffectsCallback(LPCDIEFFECTINFO pdei, LPVOID pvRef) +//{ +// ((std::list*)pvRef)->push_back(*pdei); +// return DIENUM_CONTINUE; +//} + +BOOL CALLBACK DIEnumDeviceObjectsCallback(LPCDIDEVICEOBJECTINSTANCE lpddoi, LPVOID pvRef) +{ + ((std::list*)pvRef)->push_back(*lpddoi); + return DIENUM_CONTINUE; +} + +BOOL CALLBACK DIEnumDevicesCallback(LPCDIDEVICEINSTANCE lpddi, LPVOID pvRef) +{ + ((std::list*)pvRef)->push_back(*lpddi); + return DIENUM_CONTINUE; +} + +std::string GetDeviceName(const LPDIRECTINPUTDEVICE8 device) +{ + DIPROPSTRING str = {}; + str.diph.dwSize = sizeof(str); + str.diph.dwHeaderSize = sizeof(str.diph); + str.diph.dwHow = DIPH_DEVICE; + + std::string result; + if (SUCCEEDED(device->GetProperty(DIPROP_PRODUCTNAME, &str.diph))) + { + result = StripSpaces(UTF16ToUTF8(str.wsz)); + } + + return result; +} + +void Init(std::vector& devices, HWND hwnd) +{ + IDirectInput8* idi8; + if (FAILED(DirectInput8Create(GetModuleHandle(NULL), DIRECTINPUT_VERSION, IID_IDirectInput8, (LPVOID*)&idi8, NULL))) + return; + + InitKeyboardMouse(idi8, devices, hwnd); + InitJoystick(idi8, devices, hwnd); + + idi8->Release(); + +} + +} +} -- 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/DInput/DInput.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Source/Core/InputCommon/ControllerInterface/DInput/DInput.cpp') diff --git a/Source/Core/InputCommon/ControllerInterface/DInput/DInput.cpp b/Source/Core/InputCommon/ControllerInterface/DInput/DInput.cpp index 6b7b492ea9..7f107812ec 100644 --- a/Source/Core/InputCommon/ControllerInterface/DInput/DInput.cpp +++ b/Source/Core/InputCommon/ControllerInterface/DInput/DInput.cpp @@ -1,3 +1,6 @@ +// Copyright 2013 Dolphin Emulator Project +// Licensed under GPLv2 +// Refer to the license.txt file included. #include "DInput.h" -- cgit v1.2.3 From 3fd87a7636ff434118a5d7f7334550be8db55c0b Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 16 Feb 2014 23:51:41 -0500 Subject: Second and final pass of clearing out tabs. --- Source/Core/InputCommon/ControllerInterface/DInput/DInput.cpp | 6 ------ 1 file changed, 6 deletions(-) (limited to 'Source/Core/InputCommon/ControllerInterface/DInput/DInput.cpp') diff --git a/Source/Core/InputCommon/ControllerInterface/DInput/DInput.cpp b/Source/Core/InputCommon/ControllerInterface/DInput/DInput.cpp index 7f107812ec..b9f483da4d 100644 --- a/Source/Core/InputCommon/ControllerInterface/DInput/DInput.cpp +++ b/Source/Core/InputCommon/ControllerInterface/DInput/DInput.cpp @@ -17,12 +17,6 @@ namespace ciface namespace DInput { -//BOOL CALLBACK DIEnumEffectsCallback(LPCDIEFFECTINFO pdei, LPVOID pvRef) -//{ -// ((std::list*)pvRef)->push_back(*pdei); -// return DIENUM_CONTINUE; -//} - BOOL CALLBACK DIEnumDeviceObjectsCallback(LPCDIDEVICEOBJECTINSTANCE lpddoi, LPVOID pvRef) { ((std::list*)pvRef)->push_back(*lpddoi); -- 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. --- Source/Core/InputCommon/ControllerInterface/DInput/DInput.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Source/Core/InputCommon/ControllerInterface/DInput/DInput.cpp') diff --git a/Source/Core/InputCommon/ControllerInterface/DInput/DInput.cpp b/Source/Core/InputCommon/ControllerInterface/DInput/DInput.cpp index b9f483da4d..f2d2460ee6 100644 --- a/Source/Core/InputCommon/ControllerInterface/DInput/DInput.cpp +++ b/Source/Core/InputCommon/ControllerInterface/DInput/DInput.cpp @@ -2,12 +2,12 @@ // Licensed under GPLv2 // Refer to the license.txt file included. -#include "DInput.h" +#include "Common/StringUtil.h" -#include "StringUtil.h" +#include "InputCommon/ControllerInterface/DInput/DInput.h" -#include "DInputJoystick.h" -#include "DInputKeyboardMouse.h" +#include "InputCommon/ControllerInterface/DInput/DInputJoystick.h" +#include "InputCommon/ControllerInterface/DInput/DInputKeyboardMouse.h" #pragma comment(lib, "Dinput8.lib") #pragma comment(lib, "dxguid.lib") -- 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 --- Source/Core/InputCommon/ControllerInterface/DInput/DInput.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Core/InputCommon/ControllerInterface/DInput/DInput.cpp') diff --git a/Source/Core/InputCommon/ControllerInterface/DInput/DInput.cpp b/Source/Core/InputCommon/ControllerInterface/DInput/DInput.cpp index f2d2460ee6..48b5884312 100644 --- a/Source/Core/InputCommon/ControllerInterface/DInput/DInput.cpp +++ b/Source/Core/InputCommon/ControllerInterface/DInput/DInput.cpp @@ -48,7 +48,7 @@ std::string GetDeviceName(const LPDIRECTINPUTDEVICE8 device) void Init(std::vector& devices, HWND hwnd) { IDirectInput8* idi8; - if (FAILED(DirectInput8Create(GetModuleHandle(NULL), DIRECTINPUT_VERSION, IID_IDirectInput8, (LPVOID*)&idi8, NULL))) + if (FAILED(DirectInput8Create(GetModuleHandle(nullptr), DIRECTINPUT_VERSION, IID_IDirectInput8, (LPVOID*)&idi8, nullptr))) return; InitKeyboardMouse(idi8, devices, hwnd); -- cgit v1.2.3 From 327d35377dd0edfcb3f0a5d7b2853f23102eb950 Mon Sep 17 00:00:00 2001 From: Shawn Hoffman Date: Fri, 22 Aug 2014 17:17:49 -0700 Subject: windows: remove now-extraneous NOMINMAX and WIN32_LEAN_AND_MEAN #defines from dolphin code. Wrap dinput.h in a header defining DIRECTINPUT_VERSION instead of repeating it multiple places. --- Source/Core/InputCommon/ControllerInterface/DInput/DInput.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Source/Core/InputCommon/ControllerInterface/DInput/DInput.cpp') diff --git a/Source/Core/InputCommon/ControllerInterface/DInput/DInput.cpp b/Source/Core/InputCommon/ControllerInterface/DInput/DInput.cpp index 48b5884312..aac795d880 100644 --- a/Source/Core/InputCommon/ControllerInterface/DInput/DInput.cpp +++ b/Source/Core/InputCommon/ControllerInterface/DInput/DInput.cpp @@ -48,8 +48,11 @@ std::string GetDeviceName(const LPDIRECTINPUTDEVICE8 device) void Init(std::vector& devices, HWND hwnd) { IDirectInput8* idi8; - if (FAILED(DirectInput8Create(GetModuleHandle(nullptr), DIRECTINPUT_VERSION, IID_IDirectInput8, (LPVOID*)&idi8, nullptr))) + if (FAILED(DirectInput8Create(GetModuleHandle(nullptr), DIRECTINPUT_VERSION, + IID_IDirectInput8, (LPVOID*)&idi8, nullptr))) + { return; + } InitKeyboardMouse(idi8, devices, hwnd); InitJoystick(idi8, devices, hwnd); -- 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/DInput/DInput.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Core/InputCommon/ControllerInterface/DInput/DInput.cpp') diff --git a/Source/Core/InputCommon/ControllerInterface/DInput/DInput.cpp b/Source/Core/InputCommon/ControllerInterface/DInput/DInput.cpp index aac795d880..5b34d8ede2 100644 --- a/Source/Core/InputCommon/ControllerInterface/DInput/DInput.cpp +++ b/Source/Core/InputCommon/ControllerInterface/DInput/DInput.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/StringUtil.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/DInput/DInput.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Core/InputCommon/ControllerInterface/DInput/DInput.cpp') diff --git a/Source/Core/InputCommon/ControllerInterface/DInput/DInput.cpp b/Source/Core/InputCommon/ControllerInterface/DInput/DInput.cpp index 5b34d8ede2..4a68474618 100644 --- a/Source/Core/InputCommon/ControllerInterface/DInput/DInput.cpp +++ b/Source/Core/InputCommon/ControllerInterface/DInput/DInput.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