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
cd306046
Commit
cd306046
authored
Jan 09, 2007
by
Vitaliy Margolen
Committed by
Alexandre Julliard
Jan 10, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Pass complete DataFormat structure to find_property.
parent
af71538d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
16 deletions
+25
-16
device.c
dlls/dinput/device.c
+3
-3
device_private.h
dlls/dinput/device_private.h
+1
-1
joystick_linux.c
dlls/dinput/joystick_linux.c
+15
-9
joystick_linuxinput.c
dlls/dinput/joystick_linuxinput.c
+6
-3
No files found.
dlls/dinput/device.c
View file @
cd306046
...
...
@@ -518,12 +518,12 @@ int id_to_offset(DataFormat *df, int id)
return
obj
>=
0
&&
df
->
offsets
?
df
->
offsets
[
obj
]
:
-
1
;
}
int
find_property
(
LPCDIDATAFORMAT
df
,
LPCDIPROPHEADER
ph
)
int
find_property
(
DataFormat
*
df
,
LPCDIPROPHEADER
ph
)
{
switch
(
ph
->
dwHow
)
{
case
DIPH_BYID
:
return
id_to_object
(
df
,
ph
->
dwObj
);
case
DIPH_BYOFFSET
:
return
offset_to_object
(
df
,
ph
->
dwObj
);
case
DIPH_BYID
:
return
id_to_object
(
df
->
user_df
,
ph
->
dwObj
);
case
DIPH_BYOFFSET
:
return
offset_to_object
(
df
->
user_df
,
ph
->
dwObj
);
}
FIXME
(
"Unhandled ph->dwHow=='%04X'
\n
"
,
(
unsigned
int
)
ph
->
dwHow
);
...
...
dlls/dinput/device_private.h
View file @
cd306046
...
...
@@ -75,7 +75,7 @@ extern void queue_event(LPDIRECTINPUTDEVICE8A iface, int ofs, DWORD data, DWORD
/* Helper functions to work with data format */
extern
int
offset_to_object
(
LPCDIDATAFORMAT
df
,
int
offset
);
extern
int
id_to_offset
(
DataFormat
*
df
,
int
id
);
extern
int
find_property
(
LPCDIDATAFORMAT
df
,
LPCDIPROPHEADER
ph
);
extern
int
find_property
(
DataFormat
*
df
,
LPCDIPROPHEADER
ph
);
/**
* Callback Data used by specific callback
...
...
dlls/dinput/joystick_linux.c
View file @
cd306046
...
...
@@ -909,7 +909,8 @@ static HRESULT WINAPI JoystickAImpl_SetProperty(
This
->
props
[
i
].
lMax
=
pr
->
lMax
;
}
}
else
{
int
obj
=
find_property
(
This
->
base
.
data_format
.
user_df
,
ph
);
int
obj
=
find_property
(
&
This
->
base
.
data_format
,
ph
);
TRACE
(
"proprange(%d,%d) obj=%d
\n
"
,
pr
->
lMin
,
pr
->
lMax
,
obj
);
if
(
obj
>=
0
)
{
This
->
props
[
obj
].
lMin
=
pr
->
lMin
;
...
...
@@ -926,7 +927,8 @@ static HRESULT WINAPI JoystickAImpl_SetProperty(
for
(
i
=
0
;
i
<
This
->
base
.
data_format
.
user_df
->
dwNumObjs
;
i
++
)
This
->
props
[
i
].
lDeadZone
=
pd
->
dwData
;
}
else
{
int
obj
=
find_property
(
This
->
base
.
data_format
.
user_df
,
ph
);
int
obj
=
find_property
(
&
This
->
base
.
data_format
,
ph
);
TRACE
(
"deadzone(%d) obj=%d
\n
"
,
pd
->
dwData
,
obj
);
if
(
obj
>=
0
)
{
This
->
props
[
obj
].
lDeadZone
=
pd
->
dwData
;
...
...
@@ -942,7 +944,8 @@ static HRESULT WINAPI JoystickAImpl_SetProperty(
for
(
i
=
0
;
i
<
This
->
base
.
data_format
.
user_df
->
dwNumObjs
;
i
++
)
This
->
props
[
i
].
lSaturation
=
pd
->
dwData
;
}
else
{
int
obj
=
find_property
(
This
->
base
.
data_format
.
user_df
,
ph
);
int
obj
=
find_property
(
&
This
->
base
.
data_format
,
ph
);
TRACE
(
"saturation(%d) obj=%d
\n
"
,
pd
->
dwData
,
obj
);
if
(
obj
>=
0
)
{
This
->
props
[
obj
].
lSaturation
=
pd
->
dwData
;
...
...
@@ -1171,8 +1174,9 @@ static HRESULT WINAPI JoystickAImpl_GetProperty(
if
(
!
HIWORD
(
rguid
))
{
switch
(
LOWORD
(
rguid
))
{
case
(
DWORD
)
DIPROP_RANGE
:
{
LPDIPROPRANGE
pr
=
(
LPDIPROPRANGE
)
pdiph
;
int
obj
=
find_property
(
This
->
base
.
data_format
.
user_df
,
pdiph
);
LPDIPROPRANGE
pr
=
(
LPDIPROPRANGE
)
pdiph
;
int
obj
=
find_property
(
&
This
->
base
.
data_format
,
pdiph
);
/* The app is querying the current range of the axis
* return the lMin and lMax values */
if
(
obj
>=
0
)
{
...
...
@@ -1184,8 +1188,9 @@ static HRESULT WINAPI JoystickAImpl_GetProperty(
break
;
}
case
(
DWORD
)
DIPROP_DEADZONE
:
{
LPDIPROPDWORD
pd
=
(
LPDIPROPDWORD
)
pdiph
;
int
obj
=
find_property
(
This
->
base
.
data_format
.
user_df
,
pdiph
);
LPDIPROPDWORD
pd
=
(
LPDIPROPDWORD
)
pdiph
;
int
obj
=
find_property
(
&
This
->
base
.
data_format
,
pdiph
);
if
(
obj
>=
0
)
{
pd
->
dwData
=
This
->
props
[
obj
].
lDeadZone
;
TRACE
(
"deadzone(%d) obj=%d
\n
"
,
pd
->
dwData
,
obj
);
...
...
@@ -1194,8 +1199,9 @@ static HRESULT WINAPI JoystickAImpl_GetProperty(
break
;
}
case
(
DWORD
)
DIPROP_SATURATION
:
{
LPDIPROPDWORD
pd
=
(
LPDIPROPDWORD
)
pdiph
;
int
obj
=
find_property
(
This
->
base
.
data_format
.
user_df
,
pdiph
);
LPDIPROPDWORD
pd
=
(
LPDIPROPDWORD
)
pdiph
;
int
obj
=
find_property
(
&
This
->
base
.
data_format
,
pdiph
);
if
(
obj
>=
0
)
{
pd
->
dwData
=
This
->
props
[
obj
].
lSaturation
;
TRACE
(
"saturation(%d) obj=%d
\n
"
,
pd
->
dwData
,
obj
);
...
...
dlls/dinput/joystick_linuxinput.c
View file @
cd306046
...
...
@@ -849,7 +849,8 @@ static HRESULT WINAPI JoystickAImpl_SetProperty(LPDIRECTINPUTDEVICE8A iface,
This
->
wantmax
[
i
]
=
pr
->
lMax
;
}
}
else
{
int
obj
=
find_property
(
This
->
base
.
data_format
.
user_df
,
ph
);
int
obj
=
find_property
(
&
This
->
base
.
data_format
,
ph
);
TRACE
(
"proprange(%d,%d) obj=%d
\n
"
,
pr
->
lMin
,
pr
->
lMax
,
obj
);
if
(
obj
>=
0
)
{
This
->
wantmin
[
obj
]
=
pr
->
lMin
;
...
...
@@ -868,7 +869,8 @@ static HRESULT WINAPI JoystickAImpl_SetProperty(LPDIRECTINPUTDEVICE8A iface,
This
->
deadz
[
i
]
=
pd
->
dwData
;
}
}
else
{
int
obj
=
find_property
(
This
->
base
.
data_format
.
user_df
,
ph
);
int
obj
=
find_property
(
&
This
->
base
.
data_format
,
ph
);
TRACE
(
"deadzone(%d) obj=%d
\n
"
,
pd
->
dwData
,
obj
);
if
(
obj
>=
0
)
{
This
->
deadz
[
obj
]
=
pd
->
dwData
;
...
...
@@ -1127,7 +1129,8 @@ static HRESULT WINAPI JoystickAImpl_GetProperty(LPDIRECTINPUTDEVICE8A iface,
switch
(
LOWORD
(
rguid
))
{
case
(
DWORD
)
DIPROP_RANGE
:
{
LPDIPROPRANGE
pr
=
(
LPDIPROPRANGE
)
pdiph
;
int
obj
=
find_property
(
This
->
base
.
data_format
.
user_df
,
pdiph
);
int
obj
=
find_property
(
&
This
->
base
.
data_format
,
pdiph
);
if
(
obj
>=
0
)
{
pr
->
lMin
=
This
->
joydev
->
havemin
[
obj
];
pr
->
lMax
=
This
->
joydev
->
havemax
[
obj
];
...
...
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