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
fa9c11da
Commit
fa9c11da
authored
Aug 15, 2009
by
Vitaliy Margolen
Committed by
Alexandre Julliard
Aug 19, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Let driver specify default axis mapping.
parent
167457ef
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
13 deletions
+35
-13
joystick.c
dlls/dinput/joystick.c
+32
-10
joystick_linux.c
dlls/dinput/joystick_linux.c
+1
-1
joystick_linuxinput.c
dlls/dinput/joystick_linuxinput.c
+1
-1
joystick_private.h
dlls/dinput/joystick_private.h
+1
-1
No files found.
dlls/dinput/joystick.c
View file @
fa9c11da
...
...
@@ -448,7 +448,7 @@ DWORD joystick_map_pov(POINTL *p)
* Setup the dinput options.
*/
HRESULT
setup_dinput_options
(
JoystickGenericImpl
*
This
)
HRESULT
setup_dinput_options
(
JoystickGenericImpl
*
This
,
const
BYTE
*
default_axis_map
)
{
char
buffer
[
MAX_PATH
+
16
];
HKEY
hkey
,
appkey
;
...
...
@@ -540,18 +540,40 @@ HRESULT setup_dinput_options(JoystickGenericImpl *This)
}
else
{
/* No config - set default mapping. */
for
(
tokens
=
0
;
tokens
<
This
->
device_axis_count
;
tokens
++
)
int
i
;
if
(
default_axis_map
)
{
if
(
tokens
<
8
)
This
->
axis_map
[
tokens
]
=
axis
++
;
else
if
(
tokens
<
15
)
/* Use default mapping from the driver */
for
(
i
=
0
;
i
<
This
->
device_axis_count
;
i
++
)
{
This
->
axis_map
[
tokens
++
]
=
8
+
pov
;
This
->
axis_map
[
tokens
]
=
8
+
pov
++
;
This
->
axis_map
[
i
]
=
default_axis_map
[
i
];
tokens
=
default_axis_map
[
i
];
if
(
tokens
>=
0
&&
tokens
<
8
)
axis
++
;
else
if
(
tokens
<
15
)
{
i
++
;
pov
++
;
This
->
axis_map
[
i
]
=
default_axis_map
[
i
];
}
}
}
else
{
/* No config - set default mapping. */
for
(
i
=
0
;
i
<
This
->
device_axis_count
;
i
++
)
{
if
(
i
<
8
)
This
->
axis_map
[
i
]
=
axis
++
;
else
if
(
i
<
15
)
{
This
->
axis_map
[
i
++
]
=
8
+
pov
;
This
->
axis_map
[
i
]
=
8
+
pov
++
;
}
else
This
->
axis_map
[
i
]
=
-
1
;
}
else
This
->
axis_map
[
tokens
]
=
-
1
;
}
}
This
->
devcaps
.
dwAxes
=
axis
;
...
...
dlls/dinput/joystick_linux.c
View file @
fa9c11da
...
...
@@ -310,7 +310,7 @@ static HRESULT alloc_device(REFGUID rguid, const void *jvt, IDirectInputImpl *di
newDevice
->
generic
.
deadzone
=
0
;
/* do any user specified configuration */
hr
=
setup_dinput_options
(
&
newDevice
->
generic
);
hr
=
setup_dinput_options
(
&
newDevice
->
generic
,
NULL
);
if
(
hr
!=
DI_OK
)
goto
FAILED1
;
...
...
dlls/dinput/joystick_linuxinput.c
View file @
fa9c11da
...
...
@@ -433,7 +433,7 @@ static JoystickImpl *alloc_device(REFGUID rguid, const void *jvt, IDirectInputIm
}
/* do any user specified configuration */
if
(
setup_dinput_options
(
&
newDevice
->
generic
)
!=
DI_OK
)
goto
failed
;
if
(
setup_dinput_options
(
&
newDevice
->
generic
,
NULL
)
!=
DI_OK
)
goto
failed
;
/* Create copy of default data format */
if
(
!
(
df
=
HeapAlloc
(
GetProcessHeap
(),
0
,
c_dfDIJoystick2
.
dwSize
)))
goto
failed
;
...
...
dlls/dinput/joystick_private.h
View file @
fa9c11da
...
...
@@ -53,7 +53,7 @@ typedef struct JoystickGenericImpl
}
JoystickGenericImpl
;
LONG
joystick_map_axis
(
ObjProps
*
props
,
int
val
);
HRESULT
setup_dinput_options
(
JoystickGenericImpl
*
This
);
HRESULT
setup_dinput_options
(
JoystickGenericImpl
*
This
,
const
BYTE
*
default_axis_map
);
DWORD
joystick_map_pov
(
POINTL
*
p
);
...
...
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