summaryrefslogtreecommitdiffstats
path: root/docs/release/src/osd/winui/directinput.cpp
diff options
context:
space:
mode:
author Robbbert <Robbbert@users.noreply.github.com>2018-02-01 01:13:16 +1100
committer Robbbert <Robbbert@users.noreply.github.com>2018-02-01 01:13:16 +1100
commit73ce78f7b4d4c1ff8ed36f6fef61fc00a2e9135e (patch)
tree7a50841459d42fee5739652092d6629870f81e3e /docs/release/src/osd/winui/directinput.cpp
parent6488544820bbf9bc96bd2f29bbc0a8b7c0b246fa (diff)
0.193 Release filestag193
Diffstat (limited to 'docs/release/src/osd/winui/directinput.cpp')
-rw-r--r--docs/release/src/osd/winui/directinput.cpp22
1 files changed, 8 insertions, 14 deletions
diff --git a/docs/release/src/osd/winui/directinput.cpp b/docs/release/src/osd/winui/directinput.cpp
index 5e5c554a95c..33977913b14 100644
--- a/docs/release/src/osd/winui/directinput.cpp
+++ b/docs/release/src/osd/winui/directinput.cpp
@@ -4,7 +4,7 @@
/***************************************************************************
- directinput.c
+ directinput.cpp
Direct Input routines.
@@ -13,7 +13,6 @@
#include <windows.h>
// MAME/MAMEUI headers
-#include "emu.h"
#include "mui_util.h" // For ErrorMsg
#include "directinput.h"
@@ -56,32 +55,27 @@ typedef HRESULT (WINAPI *dic_proc)(HINSTANCE hinst, DWORD dwVersion, LPDIRECTINP
BOOL DirectInputInitialize()
{
- HRESULT hr;
- UINT error_mode = 0;
- dic_proc dic;
-
- if (hDLL != NULL)
+ if (hDLL)
return TRUE;
- hDLL = NULL;
-
/* Turn off error dialog for this call */
- error_mode = SetErrorMode(0);
+ UINT error_mode = SetErrorMode(0);
hDLL = LoadLibrary(TEXT("dinput.dll"));
SetErrorMode(error_mode);
if (hDLL == NULL)
return FALSE;
+ dic_proc dic;
#ifdef UNICODE
dic = (dic_proc)GetProcAddress((HINSTANCE)hDLL, "DirectInputCreateW");
#else
dic = (dic_proc)GetProcAddress((HINSTANCE)hDLL, "DirectInputCreateA");
#endif
if (dic == NULL)
- return FALSE;
+ return false;
- hr = dic(GetModuleHandle(NULL), 0x0700, &di, NULL); // setup DIRECT INPUT 7 for the GUI
+ HRESULT hr = dic(GetModuleHandle(NULL), 0x0700, &di, NULL); // setup DIRECT INPUT 7 for the GUI
if (FAILED(hr))
{
@@ -91,10 +85,10 @@ BOOL DirectInputInitialize()
{
ErrorMsg("DirectInputCreate failed! error=%x\n", (unsigned int)hr);
di = NULL;
- return FALSE;
+ return false;
}
}
- return TRUE;
+ return true;
}
/****************************************************************************