[dinput][joystick_linuxinput] make axes work, that are "not in
a row"
Vitaliy Margolen
wine-devel at kievinfo.com
Thu Jan 11 11:25:51 CST 2007
Christoph Frick wrote:
> with Vitaliy's patches i tried my games yesterday and everything seemed
> ok (RBR works again). but my clutch on the wheel did not work and also
That's a good news. I was hopping not to brake too many things while
reorganizing the dinput.
> @@ -128,11 +122,20 @@ struct JoystickImpl
> /* The 'parent' DInput */
> IDirectInputImpl *dinput;
>
> + /* autodetecting ranges per axe by following movement */
> + LONG havemax[8];
> + LONG havemin[8];
I could never understood why we need these? In other joystick_linux the
range assumed to be 0 - 0xffff.
> /* joystick private */
> /* what range and deadzone the game wants */
> - LONG wantmin[ABS_MAX];
> - LONG wantmax[ABS_MAX];
> - LONG deadz[ABS_MAX];
> + LONG wantmin[8];
> + LONG wantmax[8];
> + LONG deadz[8];
Can we move these into separate struct like it's done in joystick_linux?
It's much cleaner end eventually will allow a better integration of two.
And can you use spaces instead of tabs please?
> @@ -395,19 +373,29 @@ static JoystickImpl *alloc_device(REFGUID rguid, const void *jvt, IDirectInputIm
> /* Supported Axis & POVs should map 1-to-1 */
> for (i = 0; i < 8; i++)
> {
> - if (!test_bit(newDevice->joydev->absbits, i)) continue;
> + if (!test_bit(newDevice->joydev->absbits, i)) {
> + newDevice->axes[i] = -1;
> + continue;
> + }
Can you please don't brake the good readable style? Please put that
curly bracket into separate line, and use 4 space indentation.
> + fake_current_js_state(newDevice);
> +
Can you explain what this suppose to do? Why do we need to "fake current
state" everywhere?
> + int axe = This->axes[ie.code];
It's an "axis" not an "axe" :)
Vitaliy.
More information about the wine-devel
mailing list