On Thu, Jun 30, 2011 at 02:56:08AM -0300, Lucas Zawacki wrote:
Hey guys, how are you doing? I've got some patches for you.
The first is a refactoring of the BuildActionMap implementations for keyboard and mouse. I think with 'semantic_to_obj_id' the mapping is pretty much correct for keyboard and mouse and it's being done "the right way".
The second patch is much like one I sent some time ago, it's SetActionMap for keyboard and mouse, this time (hopefully) with the dataformat stuff done right too. I've split it up in a third patch, which implements the "action mapping" per se.
Anyway, tomorrow I'll code some mouse tests to be sure that this is working.
Cheers
From 37e5a1e6d51778ee0d5c0f3081dad8ca1431968f Mon Sep 17 00:00:00 2001 From: Lucas Fialho Zawacki lfzawacki@gmail.com Date: Fri, 10 Jun 2011 21:43:53 -0300 Subject: dinput: Keyboard and mouse implementation of BuildActionMap (try 4)
+DWORD semantic_to_obj_id(IDirectInputDeviceImpl* This, DWORD dwSemantic) +{
...
- if (!found) return 0;
So 0 is the not found case...
DWORD obj_id = semantic_to_obj_id(&This->base, lpdiaf->rgoAction[i].dwSemantic);
if (obj_id != -1)
But here you check for -1.
DWORD obj_id = semantic_to_obj_id(&This->base, lpdiaf->rgoAction[i].dwSemantic);
if (obj_id != -1)
and here. (both mouse and keyboard code)
should probably check for 0 there, also as DWORD is unsigned ;)
Ciao, Marcus