summaryrefslogtreecommitdiffstats
path: root/src/joystick.cpp
diff options
context:
space:
mode:
authorPiotr Dziwinski <piotrdz@gmail.com>2012-04-15 00:50:13 +0200
committerPiotr Dziwinski <piotrdz@gmail.com>2012-04-15 00:50:13 +0200
commit011d86ed668cbbff5c7bfc5f7e88086acb849921 (patch)
treea47f2a0d1f61f33455c5b53f9ef63741ca9b35d8 /src/joystick.cpp
parenta0303105b616331778b61db06f9012f5c8970609 (diff)
downloadcolobot-011d86ed668cbbff5c7bfc5f7e88086acb849921.tar.gz
colobot-011d86ed668cbbff5c7bfc5f7e88086acb849921.tar.bz2
colobot-011d86ed668cbbff5c7bfc5f7e88086acb849921.zip
Pulled changes from test mingw branch
* include fixes * syntax fixes for MinGW * fixed encoding of restext.cpp * temporary fix for MinGW in joystick.cpp Successfully compiles under MinGW :)
Diffstat (limited to 'src/joystick.cpp')
-rw-r--r--src/joystick.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/joystick.cpp b/src/joystick.cpp
index 29be76f..609a1fb 100644
--- a/src/joystick.cpp
+++ b/src/joystick.cpp
@@ -79,6 +79,7 @@ BOOL CALLBACK EnumAxesCallback( const DIDEVICEOBJECTINSTANCE* pdidoi,
if( FAILED( g_pJoystick->SetProperty( DIPROP_RANGE, &diprg.diph ) ) )
return DIENUM_STOP;
+#ifndef __MINGW32__ // FIXME Doesn't work under MinGW
// Set the UI to reflect what axes the joystick supports
switch( pdidoi->dwOfs )
{
@@ -107,6 +108,7 @@ BOOL CALLBACK EnumAxesCallback( const DIDEVICEOBJECTINSTANCE* pdidoi,
OutputDebugString("EnumAxesCallback -s1\n");
break;
}
+#endif
return DIENUM_CONTINUE;
}
@@ -120,8 +122,12 @@ BOOL InitDirectInput(HINSTANCE hInst, HWND hWnd)
// Register with the DirectInput subsystem and get a pointer
// to a IDirectInput interface we can use.
+#ifndef __MINGW32__ // FIXME Doesn't work under MinGW
hr = DirectInputCreateEx( hInst, DIRECTINPUT_VERSION,IID_IDirectInput7, (LPVOID*)&g_pDI, NULL );
- if( FAILED(hr) ) return FALSE;;
+ if( FAILED(hr) ) return FALSE;
+#else
+ return FALSE;
+#endif
// Look for a simple joystick we can use for this sample program.
hr = g_pDI->EnumDevices( DIDEVTYPE_JOYSTICK, EnumJoysticksCallback,