Fixed bug #675 SDL-1.2
authorSam Lantinga <slouken@libsdl.org>
Mon, 13 Apr 2009 08:49:41 +0000
branchSDL-1.2
changeset 417248f1406df2a8
parent 4171 3012f1c37361
child 4173 34068be6aa0b
Fixed bug #675

Description From maf6@cornell.edu 2009-01-10 14:07:52 (-) [reply]

Assuming the SDL project doesn't just want to pick these up from dinput8.lib or
whatever instead, the definitions in SDL_dx5video.c should be:

const DIDATAFORMAT c_dfDIKeyboard = { sizeof(DIDATAFORMAT),
sizeof(DIOBJECTDATAFORMAT), 0x00000002, 256, 256, KBD_fmt };
const DIDATAFORMAT c_dfDIMouse = { sizeof(DIDATAFORMAT),
sizeof(DIOBJECTDATAFORMAT), 0x00000002, 16, 7, PTR_fmt };
const DIDATAFORMAT c_dfDIJoystick = { sizeof(DIDATAFORMAT),
sizeof(DIOBJECTDATAFORMAT), 0x00000001, 80, 44, JOY_fmt };

This way the call to IDirectInputDevice2_SetDataFormat in SDL_dx5events.c will
succeed on x64.
src/video/windx5/SDL_dx5video.c
     1.1 --- a/src/video/windx5/SDL_dx5video.c	Mon Apr 13 08:44:48 2009 +0000
     1.2 +++ b/src/video/windx5/SDL_dx5video.c	Mon Apr 13 08:49:41 2009 +0000
     1.3 @@ -332,7 +332,7 @@
     1.4  	{ &GUID_Key, 255, 0x8000FF0C, 0x00000000 },
     1.5  };
     1.6  
     1.7 -const DIDATAFORMAT c_dfDIKeyboard = { 24, 16, 0x00000002, 256, 256, KBD_fmt };
     1.8 +const DIDATAFORMAT c_dfDIKeyboard = { sizeof(DIDATAFORMAT), sizeof(DIOBJECTDATAFORMAT), 0x00000002, 256, 256, KBD_fmt };
     1.9  
    1.10  
    1.11  /* Mouse */
    1.12 @@ -347,7 +347,7 @@
    1.13  	{ NULL, 15, 0x80FFFF0C, 0x00000000 },
    1.14  };
    1.15  
    1.16 -const DIDATAFORMAT c_dfDIMouse = { 24, 16, 0x00000002, 16, 7, PTR_fmt };
    1.17 +const DIDATAFORMAT c_dfDIMouse = { sizeof(DIDATAFORMAT), sizeof(DIOBJECTDATAFORMAT), 0x00000002, 16, 7, PTR_fmt };
    1.18  
    1.19  
    1.20  /* Joystick */
    1.21 @@ -399,7 +399,7 @@
    1.22  	{ NULL, 79, 0x80FFFF0C, 0x00000000 },
    1.23  };
    1.24  
    1.25 -const DIDATAFORMAT c_dfDIJoystick = { 24, 16, 0x00000001, 80, 44, JOY_fmt };
    1.26 +const DIDATAFORMAT c_dfDIJoystick = { sizeof(DIDATAFORMAT), sizeof(DIOBJECTDATAFORMAT), 0x00000001, 80, 44, JOY_fmt };
    1.27  
    1.28  
    1.29  /* Initialization/Query functions */