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
1362d150
Commit
1362d150
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: Move axes count into base joystick class.
parent
5347ab42
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
11 deletions
+11
-11
joystick_linux.c
dlls/dinput/joystick_linux.c
+10
-10
joystick_private.h
dlls/dinput/joystick_private.h
+1
-1
No files found.
dlls/dinput/joystick_linux.c
View file @
1362d150
...
...
@@ -87,7 +87,6 @@ struct JoystickImpl
/* joystick private */
int
joyfd
;
int
axes
;
POINTL
povs
[
4
];
};
...
...
@@ -259,7 +258,7 @@ static HRESULT setup_dinput_options(JoystickImpl * device)
TRACE
(
"setting default deadzone to:
\"
%s
\"
%d
\n
"
,
buffer
,
device
->
generic
.
deadzone
);
}
device
->
generic
.
axis_map
=
HeapAlloc
(
GetProcessHeap
(),
0
,
device
->
axes
*
sizeof
(
int
));
device
->
generic
.
axis_map
=
HeapAlloc
(
GetProcessHeap
(),
0
,
device
->
generic
.
device_axis_count
*
sizeof
(
int
));
if
(
!
device
->
generic
.
axis_map
)
return
DIERR_OUTOFMEMORY
;
if
(
!
get_config_key
(
hkey
,
appkey
,
device
->
generic
.
name
,
buffer
,
MAX_PATH
))
{
...
...
@@ -314,9 +313,10 @@ static HRESULT setup_dinput_options(JoystickImpl * device)
tokens
++
;
}
while
((
ptr
=
strtok
(
NULL
,
delim
))
!=
NULL
);
if
(
tokens
!=
device
->
axes
)
{
ERR
(
"not all joystick axes mapped: %d axes(%d,%d), %d arguments
\n
"
,
device
->
axes
,
axis
,
pov
,
tokens
);
while
(
tokens
<
device
->
axes
)
{
if
(
tokens
!=
device
->
generic
.
device_axis_count
)
{
ERR
(
"not all joystick axes mapped: %d axes(%d,%d), %d arguments
\n
"
,
device
->
generic
.
device_axis_count
,
axis
,
pov
,
tokens
);
while
(
tokens
<
device
->
generic
.
device_axis_count
)
{
device
->
generic
.
axis_map
[
tokens
]
=
-
1
;
tokens
++
;
}
...
...
@@ -325,7 +325,7 @@ static HRESULT setup_dinput_options(JoystickImpl * device)
}
else
{
for
(
tokens
=
0
;
tokens
<
device
->
axes
;
tokens
++
)
for
(
tokens
=
0
;
tokens
<
device
->
generic
.
device_axis_count
;
tokens
++
)
{
if
(
tokens
<
8
)
device
->
generic
.
axis_map
[
tokens
]
=
axis
++
;
...
...
@@ -397,9 +397,9 @@ static HRESULT alloc_device(REFGUID rguid, const void *jvt, IDirectInputImpl *di
strcpy
(
newDevice
->
generic
.
name
,
name
);
#ifdef JSIOCGAXES
if
(
ioctl
(
newDevice
->
joyfd
,
JSIOCGAXES
,
&
newDevice
->
axes
)
<
0
)
{
if
(
ioctl
(
newDevice
->
joyfd
,
JSIOCGAXES
,
&
newDevice
->
generic
.
device_axis_count
)
<
0
)
{
WARN
(
"ioctl(%s,JSIOCGAXES) failed: %s, defauting to 2
\n
"
,
newDevice
->
dev
,
strerror
(
errno
));
newDevice
->
axes
=
2
;
newDevice
->
generic
.
device_axis_count
=
2
;
}
#endif
#ifdef JSIOCGBUTTONS
...
...
@@ -437,7 +437,7 @@ static HRESULT alloc_device(REFGUID rguid, const void *jvt, IDirectInputImpl *di
df
->
dwNumObjs
=
newDevice
->
generic
.
devcaps
.
dwAxes
+
newDevice
->
generic
.
devcaps
.
dwPOVs
+
newDevice
->
generic
.
devcaps
.
dwButtons
;
if
(
!
(
df
->
rgodf
=
HeapAlloc
(
GetProcessHeap
(),
0
,
df
->
dwNumObjs
*
df
->
dwObjSize
)))
goto
FAILED
;
for
(
i
=
0
;
i
<
newDevice
->
axes
;
i
++
)
for
(
i
=
0
;
i
<
newDevice
->
generic
.
device_axis_count
;
i
++
)
{
int
wine_obj
=
newDevice
->
generic
.
axis_map
[
i
];
...
...
@@ -486,7 +486,7 @@ static HRESULT alloc_device(REFGUID rguid, const void *jvt, IDirectInputImpl *di
if
(
TRACE_ON
(
dinput
))
{
_dump_DIDATAFORMAT
(
newDevice
->
generic
.
base
.
data_format
.
wine_df
);
for
(
i
=
0
;
i
<
(
newDevice
->
axes
);
i
++
)
for
(
i
=
0
;
i
<
(
newDevice
->
generic
.
device_axis_count
);
i
++
)
TRACE
(
"axis_map[%d] = %d
\n
"
,
i
,
newDevice
->
generic
.
axis_map
[
i
]);
_dump_DIDEVCAPS
(
&
newDevice
->
generic
.
devcaps
);
}
...
...
dlls/dinput/joystick_private.h
View file @
1362d150
...
...
@@ -45,7 +45,7 @@ typedef struct JoystickGenericImpl
GUID
guidProduct
;
GUID
guidInstance
;
char
*
name
;
int
device_axis_count
;
/* Total number of axes in the device */
int
*
axis_map
;
/* User axes remapping */
LONG
deadzone
;
/* Default dead-zone */
...
...
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