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
f0cd5c5c
Commit
f0cd5c5c
authored
Oct 29, 2021
by
Rémi Bernon
Committed by
Alexandre Julliard
Oct 29, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Move device data format to struct dinput_device.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
4e56801a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
21 deletions
+16
-21
device.c
dlls/dinput/device.c
+13
-13
device_private.h
dlls/dinput/device_private.h
+1
-6
joystick_hid.c
dlls/dinput/joystick_hid.c
+2
-2
No files found.
dlls/dinput/device.c
View file @
f0cd5c5c
...
...
@@ -268,7 +268,7 @@ static BOOL match_device_object( DIDATAFORMAT *device_format, DIDATAFORMAT *user
static
HRESULT
dinput_device_init_user_format
(
struct
dinput_device
*
impl
,
const
DIDATAFORMAT
*
format
)
{
DIDATAFORMAT
*
user_format
,
*
device_format
=
impl
->
d
ata_format
.
wine_df
;
DIDATAFORMAT
*
user_format
,
*
device_format
=
impl
->
d
evice_format
;
DIOBJECTDATAFORMAT
*
user_obj
,
*
match_obj
;
DWORD
i
;
...
...
@@ -314,7 +314,7 @@ failed:
static
int
id_to_offset
(
struct
dinput_device
*
impl
,
int
id
)
{
DIDATAFORMAT
*
device_format
=
impl
->
d
ata_format
.
wine_df
,
*
user_format
=
impl
->
user_format
;
DIDATAFORMAT
*
device_format
=
impl
->
d
evice_format
,
*
user_format
=
impl
->
user_format
;
DIOBJECTDATAFORMAT
*
user_obj
;
if
(
!
user_format
)
return
-
1
;
...
...
@@ -338,9 +338,9 @@ static DWORD semantic_to_obj_id( struct dinput_device *This, DWORD dwSemantic )
DWORD
instance
;
int
i
;
for
(
i
=
0
;
i
<
This
->
d
ata_format
.
wine_df
->
dwNumObjs
&&
!
found
;
i
++
)
for
(
i
=
0
;
i
<
This
->
d
evice_format
->
dwNumObjs
&&
!
found
;
i
++
)
{
LPDIOBJECTDATAFORMAT
odf
=
dataformat_to_odf
(
This
->
data_format
.
wine_df
,
i
);
LPDIOBJECTDATAFORMAT
odf
=
dataformat_to_odf
(
This
->
device_format
,
i
);
if
(
byofs
&&
value
!=
odf
->
dwOfs
)
continue
;
if
(
!
byofs
&&
value
!=
DIDFT_GETINSTANCE
(
odf
->
dwType
))
continue
;
...
...
@@ -747,8 +747,8 @@ void dinput_device_destroy( IDirectInputDevice8W *iface )
free
(
This
->
data_queue
);
/* Free data format */
free
(
This
->
d
ata_format
.
wine_df
->
rgodf
);
free
(
This
->
d
ata_format
.
wine_df
);
free
(
This
->
d
evice_format
->
rgodf
);
free
(
This
->
d
evice_format
);
dinput_device_release_user_format
(
This
);
/* Free action mapping */
...
...
@@ -884,7 +884,7 @@ static HRESULT WINAPI dinput_device_EnumObjects( IDirectInputDevice8W *iface,
static
HRESULT
enum_object_filter_init
(
struct
dinput_device
*
impl
,
DIPROPHEADER
*
filter
)
{
DIDATAFORMAT
*
device_format
=
impl
->
d
ata_format
.
wine_df
,
*
user_format
=
impl
->
user_format
;
DIDATAFORMAT
*
device_format
=
impl
->
d
evice_format
,
*
user_format
=
impl
->
user_format
;
DIOBJECTDATAFORMAT
*
device_obj
,
*
user_obj
;
if
(
filter
->
dwHow
>
DIPH_BYUSAGE
)
return
DIERR_INVALIDPARAM
;
...
...
@@ -1224,7 +1224,7 @@ static HRESULT WINAPI dinput_device_GetObjectInfo( IDirectInputDevice8W *iface,
static
HRESULT
WINAPI
dinput_device_GetDeviceState
(
IDirectInputDevice8W
*
iface
,
DWORD
size
,
void
*
data
)
{
struct
dinput_device
*
impl
=
impl_from_IDirectInputDevice8W
(
iface
);
DIDATAFORMAT
*
device_format
=
impl
->
d
ata_format
.
wine_df
,
*
user_format
;
DIDATAFORMAT
*
device_format
=
impl
->
d
evice_format
,
*
user_format
;
DIOBJECTDATAFORMAT
*
device_obj
,
*
user_obj
;
BYTE
*
user_state
=
data
;
DIPROPHEADER
filter
=
...
...
@@ -1595,7 +1595,7 @@ static HRESULT WINAPI dinput_device_BuildActionMap( IDirectInputDevice8W *iface,
break
;
default:
devMask
=
DIGENRE_ANY
;
df
=
impl
->
d
ata_format
.
wine_df
;
df
=
impl
->
d
evice_format
;
break
;
}
...
...
@@ -1684,7 +1684,7 @@ static HRESULT WINAPI dinput_device_SetActionMap( IDirectInputDevice8W *iface, D
df
=
&
c_dfDIMouse2
;
break
;
default:
df
=
impl
->
d
ata_format
.
wine_df
;
df
=
impl
->
d
evice_format
;
break
;
}
...
...
@@ -1843,7 +1843,7 @@ HRESULT dinput_device_alloc( SIZE_T size, const struct dinput_device_vtbl *vtbl,
This
->
instance
.
dwSize
=
sizeof
(
DIDEVICEINSTANCEW
);
This
->
caps
.
dwSize
=
sizeof
(
DIDEVCAPS
);
This
->
caps
.
dwFlags
=
DIDC_ATTACHED
|
DIDC_EMULATED
;
This
->
d
ata_format
.
wine_df
=
format
;
This
->
d
evice_format
=
format
;
InitializeCriticalSection
(
&
This
->
crit
);
This
->
dinput
=
dinput
;
IDirectInput_AddRef
(
&
dinput
->
IDirectInput7A_iface
);
...
...
@@ -1871,7 +1871,7 @@ static const GUID *object_instance_guid( const DIDEVICEOBJECTINSTANCEW *instance
static
BOOL
CALLBACK
enum_objects_init
(
const
DIDEVICEOBJECTINSTANCEW
*
instance
,
void
*
data
)
{
struct
dinput_device
*
impl
=
impl_from_IDirectInputDevice8W
(
data
);
DIDATAFORMAT
*
format
=
impl
->
d
ata_format
.
wine_df
;
DIDATAFORMAT
*
format
=
impl
->
d
evice_format
;
DIOBJECTDATAFORMAT
*
obj_format
;
if
(
!
format
->
rgodf
)
...
...
@@ -1904,7 +1904,7 @@ static BOOL CALLBACK enum_objects_init( const DIDEVICEOBJECTINSTANCEW *instance,
HRESULT
dinput_device_init
(
IDirectInputDevice8W
*
iface
)
{
struct
dinput_device
*
impl
=
impl_from_IDirectInputDevice8W
(
iface
);
DIDATAFORMAT
*
format
=
impl
->
d
ata_format
.
wine_df
;
DIDATAFORMAT
*
format
=
impl
->
d
evice_format
;
ULONG
i
,
size
;
IDirectInputDevice8_EnumObjects
(
iface
,
enum_objects_init
,
iface
,
DIDFT_ALL
);
...
...
dlls/dinput/device_private.h
View file @
f0cd5c5c
...
...
@@ -30,11 +30,6 @@
typedef
struct
{
LPDIDATAFORMAT
wine_df
;
/* wine internal data format */
}
DataFormat
;
typedef
struct
{
unsigned
int
offset
;
UINT_PTR
uAppData
;
}
ActionMap
;
...
...
@@ -88,7 +83,7 @@ struct dinput_device
BOOL
overflow
;
/* return DI_BUFFEROVERFLOW in 'GetDeviceData' */
DWORD
buffersize
;
/* size of the queue - set in 'SetProperty' */
D
ataFormat
data_format
;
/* user data format and wine to user format converter */
D
IDATAFORMAT
*
device_format
;
DIDATAFORMAT
*
user_format
;
/* Action mapping */
...
...
dlls/dinput/joystick_hid.c
View file @
f0cd5c5c
...
...
@@ -1115,7 +1115,7 @@ static HRESULT hid_joystick_read( IDirectInputDevice8W *iface )
};
struct
hid_joystick
*
impl
=
impl_from_IDirectInputDevice8W
(
iface
);
ULONG
i
,
count
,
report_len
=
impl
->
caps
.
InputReportByteLength
;
DIDATAFORMAT
*
format
=
impl
->
base
.
d
ata_format
.
wine_df
;
DIDATAFORMAT
*
format
=
impl
->
base
.
d
evice_format
;
struct
parse_device_state_params
params
=
{{
0
}};
char
*
report_buf
=
impl
->
input_report_buf
;
USAGE_AND_PAGE
*
usages
;
...
...
@@ -2009,7 +2009,7 @@ static BOOL get_parameters_object_id( struct hid_joystick *impl, struct hid_valu
static
BOOL
get_parameters_object_ofs
(
struct
hid_joystick
*
impl
,
struct
hid_value_caps
*
caps
,
DIDEVICEOBJECTINSTANCEW
*
instance
,
void
*
data
)
{
DIDATAFORMAT
*
device_format
=
impl
->
base
.
d
ata_format
.
wine_df
,
*
user_format
=
impl
->
base
.
user_format
;
DIDATAFORMAT
*
device_format
=
impl
->
base
.
d
evice_format
,
*
user_format
=
impl
->
base
.
user_format
;
DIOBJECTDATAFORMAT
*
device_obj
,
*
user_obj
;
if
(
!
user_format
)
return
DIENUM_CONTINUE
;
...
...
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