Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexey Alyaev
wine
Commits
1362d150
Commit
1362d150
authored
15 years ago
by
Vitaliy Margolen
Committed by
Alexandre Julliard
15 years ago
Browse files
Options
Downloads
Patches
Plain Diff
dinput: Move axes count into base joystick class.
parent
5347ab42
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dlls/dinput/joystick_linux.c
+10
-10
10 additions, 10 deletions
dlls/dinput/joystick_linux.c
dlls/dinput/joystick_private.h
+1
-1
1 addition, 1 deletion
dlls/dinput/joystick_private.h
with
11 additions
and
11 deletions
dlls/dinput/joystick_linux.c
+
10
−
10
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
);
}
...
...
This diff is collapsed.
Click to expand it.
dlls/dinput/joystick_private.h
+
1
−
1
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 */
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment