simplify
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "SDL_utils.h"
|
|
||||||
#include "InputHandler_DirectInputHelper.h"
|
#include "InputHandler_DirectInputHelper.h"
|
||||||
#include "RageUtil.h"
|
#include "RageUtil.h"
|
||||||
#include "RageLog.h"
|
#include "RageLog.h"
|
||||||
|
#include "StepMania.h"
|
||||||
|
|
||||||
#pragma comment(lib, "dinput.lib")
|
#pragma comment(lib, "dinput.lib")
|
||||||
#if defined(_WINDOWS)
|
#if defined(_WINDOWS)
|
||||||
@@ -12,7 +12,6 @@ LPDIRECTINPUT dinput = NULL;
|
|||||||
|
|
||||||
static int ConvertScancodeToKey( int scancode );
|
static int ConvertScancodeToKey( int scancode );
|
||||||
static BOOL CALLBACK DIJoystick_EnumDevObjectsProc(LPCDIDEVICEOBJECTINSTANCE dev, LPVOID data);
|
static BOOL CALLBACK DIJoystick_EnumDevObjectsProc(LPCDIDEVICEOBJECTINSTANCE dev, LPVOID data);
|
||||||
static HWND GetHwnd();
|
|
||||||
|
|
||||||
DIDevice::DIDevice()
|
DIDevice::DIDevice()
|
||||||
{
|
{
|
||||||
@@ -50,7 +49,7 @@ bool DIDevice::Open()
|
|||||||
if( type == KEYBOARD )
|
if( type == KEYBOARD )
|
||||||
coop = DISCL_FOREGROUND|DISCL_NONEXCLUSIVE;
|
coop = DISCL_FOREGROUND|DISCL_NONEXCLUSIVE;
|
||||||
|
|
||||||
hr = IDirectInputDevice2_SetCooperativeLevel( Device, GetHwnd(), coop );
|
hr = IDirectInputDevice2_SetCooperativeLevel( Device, g_hWndMain, coop );
|
||||||
if ( hr != DI_OK )
|
if ( hr != DI_OK )
|
||||||
{
|
{
|
||||||
LOG->Info( hr_ssprintf(hr, "OpenDevice(%s): IDirectInputDevice2_SetCooperativeLevel", JoystickInst.tszProductName) );
|
LOG->Info( hr_ssprintf(hr, "OpenDevice(%s): IDirectInputDevice2_SetCooperativeLevel", JoystickInst.tszProductName) );
|
||||||
@@ -301,16 +300,6 @@ static int ConvertScancodeToKey( int scancode )
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
static HWND GetHwnd()
|
|
||||||
{
|
|
||||||
SDL_SysWMinfo info;
|
|
||||||
SDL_VERSION(&info.version);
|
|
||||||
if( SDL_GetWMInfo(&info) < 0 )
|
|
||||||
RageException::Throw( "SDL_GetWMInfo failed" );
|
|
||||||
|
|
||||||
return info.window;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (c) 2003-2004 Glenn Maynard
|
* (c) 2003-2004 Glenn Maynard
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
|
|||||||
Reference in New Issue
Block a user