Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
b8b03b54
Commit
b8b03b54
authored
Feb 02, 2007
by
Vitaliy Margolen
Committed by
Alexandre Julliard
Feb 05, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Initialize user limits with the default 0..65535 range. Add tests.
parent
575ede97
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
4 deletions
+16
-4
joystick_linuxinput.c
dlls/dinput/joystick_linuxinput.c
+4
-2
joystick.c
dlls/dinput/tests/joystick.c
+12
-2
No files found.
dlls/dinput/joystick_linuxinput.c
View file @
b8b03b54
...
...
@@ -387,8 +387,10 @@ static JoystickImpl *alloc_device(REFGUID rguid, const void *jvt, IDirectInputIm
memcpy
(
&
df
->
rgodf
[
idx
],
&
c_dfDIJoystick2
.
rgodf
[
i
],
df
->
dwObjSize
);
newDevice
->
axes
[
i
]
=
idx
;
newDevice
->
props
[
idx
].
wantmin
=
newDevice
->
props
[
idx
].
havemin
=
newDevice
->
joydev
->
axes
[
i
][
AXIS_ABSMIN
];
newDevice
->
props
[
idx
].
wantmax
=
newDevice
->
props
[
idx
].
havemax
=
newDevice
->
joydev
->
axes
[
i
][
AXIS_ABSMAX
];
newDevice
->
props
[
idx
].
havemin
=
newDevice
->
joydev
->
axes
[
i
][
AXIS_ABSMIN
];
newDevice
->
props
[
idx
].
havemax
=
newDevice
->
joydev
->
axes
[
i
][
AXIS_ABSMAX
];
newDevice
->
props
[
idx
].
wantmin
=
0
;
newDevice
->
props
[
idx
].
wantmax
=
0xffff
;
newDevice
->
props
[
idx
].
deadzone
=
0
;
df
->
rgodf
[
idx
++
].
dwType
=
DIDFT_MAKEINSTANCE
(
newDevice
->
numAxes
++
)
|
DIDFT_ABSAXIS
;
}
...
...
dlls/dinput/tests/joystick.c
View file @
b8b03b54
...
...
@@ -81,6 +81,7 @@ typedef struct tagJoystickInfo
DWORD
axis
;
DWORD
pov
;
DWORD
button
;
LONG
lMin
,
lMax
;
}
JoystickInfo
;
static
BOOL
CALLBACK
EnumAxes
(
...
...
@@ -102,8 +103,14 @@ static BOOL CALLBACK EnumAxes(
diprg
.
diph
.
dwHeaderSize
=
sizeof
(
DIPROPHEADER
);
diprg
.
diph
.
dwHow
=
DIPH_BYID
;
diprg
.
diph
.
dwObj
=
pdidoi
->
dwType
;
diprg
.
lMin
=
-
1000
;
diprg
.
lMax
=
+
1000
;
hr
=
IDirectInputDevice_GetProperty
(
info
->
pJoystick
,
DIPROP_RANGE
,
&
diprg
.
diph
);
ok
(
SUCCEEDED
(
hr
),
"IDirectInputDevice_GetProperty() failed: %s
\n
"
,
DXGetErrorString8
(
hr
));
ok
(
info
->
lMin
==
diprg
.
lMin
&&
info
->
lMax
==
diprg
.
lMax
,
"Min/Max range invalid: "
"expected %d..%d got %d..%d
\n
"
,
info
->
lMin
,
info
->
lMax
,
diprg
.
lMin
,
diprg
.
lMax
);
diprg
.
lMin
=
-
2000
;
diprg
.
lMax
=
+
2000
;
hr
=
IDirectInputDevice_SetProperty
(
info
->
pJoystick
,
DIPROP_RANGE
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"IDirectInputDevice_SetProperty() should have returned "
...
...
@@ -239,6 +246,9 @@ static BOOL CALLBACK EnumJoysticks(
ZeroMemory
(
&
info
,
sizeof
(
info
));
info
.
pJoystick
=
pJoystick
;
/* default min/max limits */
info
.
lMin
=
0
;
info
.
lMax
=
0xffff
;
/* enumerate objects */
hr
=
IDirectInputDevice_EnumObjects
(
pJoystick
,
EnumAxes
,
(
VOID
*
)
&
info
,
DIDFT_ALL
);
ok
(
hr
==
DI_OK
,
"IDirectInputDevice_EnumObjects() failed: %s
\n
"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment