Skip to content
This repository has been archived by the owner on Mar 30, 2019. It is now read-only.

Update Mapping.xml - fix GamepadButtonFlags #963

Merged
merged 2 commits into from
Jan 7, 2018
Merged

Update Mapping.xml - fix GamepadButtonFlags #963

merged 2 commits into from
Jan 7, 2018

Conversation

Gavin-Williams
Copy link
Contributor

@Gavin-Williams Gavin-Williams commented Jan 7, 2018

Change GamepadButtonFlags mapping from type short to ushort to fix issue with Y flag being incorrectly mapped. Y flag is currently mapped to Y = short.MinValue. It should be mapped to Y = 32768. I think changing the type to ushort should correctly remap the enumeration.

Edit: Although I think this behaviour of the code generator may indicate a problem with how it handles the mapping of flags enumerations. It shouldn't try to wrap the enumeration - if that's what it's doing. But that is beyond my ability to investigate, so I can only suggest that as a possible problem.

Edit : Apologies for the mess here, the correct type should be int, not ushort, as ushort isn't a supported type in the SharpDX build software for the enumeration. I've submitted a fresh pull request. But not sure if I should close this PR first or what. GitHub seems to have appended my fresh PR to this one. I've checked the enumeration after building SharpDX, and it looks OK now with int as the type.

Change GamepadButtonFlags mapping from type short to ushort to fix issue with Y flag being incorrectly mapped. Y flag is currently mapped to Y = short.MinValue. It should be mapped to Y = 32768. I think changing the type to ushort should correctly remap the enumeration.
Change GamepadButtonFlags mapping from type short to int.  This fixes an issue with Y flag being incorrectly mapped to Y = short.MinValue. It should be mapped to Y = 32768. 

Here's the relevant DirectX doc section ..

typedef struct _XINPUT_GAMEPAD {  
WORD  wButtons; 
...}

and this ...
XINPUT_GAMEPAD_X 0x4000
XINPUT_GAMEPAD_Y 0x8000
@Gavin-Williams Gavin-Williams reopened this Jan 7, 2018
@xoofx xoofx merged commit 94f2883 into sharpdx:master Jan 7, 2018
@xoofx
Copy link
Member

xoofx commented Jan 7, 2018

thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants