summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon/Src/ControllerInterface/DInput/DInput.cpp
diff options
context:
space:
mode:
authorNeoBrainX <NeoBrainX@gmail.com>2013-03-26 22:16:29 +0100
committerNeoBrainX <NeoBrainX@gmail.com>2013-03-26 22:21:19 +0100
commit3253603ae7a80860a294c11c95b3697634ac73d9 (patch)
tree5ef2a70521939d71fb3cacbd8a47babd9bdbdba8 /Source/Core/InputCommon/Src/ControllerInterface/DInput/DInput.cpp
parent76148a52b82cae8e6cf11b6eeeeff55345b0f12e (diff)
parentb75a617d8a2e4307ed4af06669e92fc33f6af1df (diff)
Merge 'master' into shader-uids-awesome.
Conflicts: Source/Core/VideoCommon/Src/LightingShaderGen.cpp Source/Core/VideoCommon/Src/PixelShaderGen.cpp Source/Core/VideoCommon/Src/PixelShaderGen.h Source/Core/VideoCommon/Src/PixelShaderManager.cpp Source/Core/VideoCommon/Src/VertexShaderGen.cpp Source/Core/VideoCommon/Src/VertexShaderGen.h Source/Plugins/Plugin_VideoOGL/Src/PixelShaderCache.cpp Source/Plugins/Plugin_VideoOGL/Src/PixelShaderCache.h Source/Plugins/Plugin_VideoOGL/Src/VertexManager.cpp Source/Plugins/Plugin_VideoOGL/Src/VertexShaderCache.cpp Source/Plugins/Plugin_VideoOGL/Src/VertexShaderCache.h
Diffstat (limited to 'Source/Core/InputCommon/Src/ControllerInterface/DInput/DInput.cpp')
-rw-r--r--Source/Core/InputCommon/Src/ControllerInterface/DInput/DInput.cpp16
1 files changed, 5 insertions, 11 deletions
diff --git a/Source/Core/InputCommon/Src/ControllerInterface/DInput/DInput.cpp b/Source/Core/InputCommon/Src/ControllerInterface/DInput/DInput.cpp
index c23e9df17e..01baf9cf1a 100644
--- a/Source/Core/InputCommon/Src/ControllerInterface/DInput/DInput.cpp
+++ b/Source/Core/InputCommon/Src/ControllerInterface/DInput/DInput.cpp
@@ -4,7 +4,7 @@
#include "DInput.h"
-#include <StringUtil.h>
+#include "StringUtil.h"
#ifdef CIFACE_USE_DINPUT_JOYSTICK
#include "DInputJoystick.h"
@@ -41,24 +41,18 @@ BOOL CALLBACK DIEnumDevicesCallback(LPCDIDEVICEINSTANCE lpddi, LPVOID pvRef)
std::string GetDeviceName(const LPDIRECTINPUTDEVICE8 device)
{
- std::string out;
-
- DIPROPSTRING str;
- ZeroMemory(&str, sizeof(str));
+ 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)))
{
- const int size = WideCharToMultiByte(CP_UTF8, 0, str.wsz, -1, NULL, 0, NULL, NULL);
- char* const data = new char[size];
- if (size == WideCharToMultiByte(CP_UTF8, 0, str.wsz, -1, data, size, NULL, NULL))
- out.assign(data);
- delete[] data;
+ result = StripSpaces(UTF16ToUTF8(str.wsz));
}
- return StripSpaces(out);
+ return result;
}
void Init(std::vector<ControllerInterface::Device*>& devices, HWND hwnd)