Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
856221c0
Commit
856221c0
authored
Sep 07, 2005
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use the COM macros instead of accessing lpVtbl directly.
parent
e6c76692
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
36 deletions
+36
-36
joystick_linuxinput.c
dlls/dinput/joystick_linuxinput.c
+36
-36
No files found.
dlls/dinput/joystick_linuxinput.c
View file @
856221c0
...
...
@@ -394,7 +394,7 @@ static ULONG WINAPI JoystickAImpl_Release(LPDIRECTINPUTDEVICE8A iface)
return
ref
;
/* Reset the FF state, free all effects, etc */
iface
->
lpVtbl
->
SendForceFeedbackCommand
(
iface
,
DISFFC_RESET
);
IDirectInputDevice8_
SendForceFeedbackCommand
(
iface
,
DISFFC_RESET
);
/* Free the data queue */
HeapFree
(
GetProcessHeap
(),
0
,
This
->
data_queue
);
...
...
@@ -921,7 +921,7 @@ static HRESULT WINAPI JoystickAImpl_EnumObjects(
/* We need to work even if we're not yet acquired */
if
(
xfd
==
-
1
)
iface
->
lpVtbl
->
Acquire
(
iface
);
IDirectInputDevice8_
Acquire
(
iface
);
/* Only the fields till dwFFMaxForce are relevant */
ddoi
.
dwSize
=
FIELD_OFFSET
(
DIDEVICEOBJECTINSTANCEA
,
dwFFMaxForce
);
...
...
@@ -982,7 +982,7 @@ static HRESULT WINAPI JoystickAImpl_EnumObjects(
if
(
lpCallback
(
&
ddoi
,
lpvRef
)
!=
DIENUM_CONTINUE
)
{
/* return to unaquired state if that's where we were */
if
(
xfd
==
-
1
)
iface
->
lpVtbl
->
Unacquire
(
iface
);
IDirectInputDevice8_
Unacquire
(
iface
);
return
DI_OK
;
}
}
...
...
@@ -1070,7 +1070,7 @@ static HRESULT WINAPI JoystickAImpl_EnumObjects(
if
(
lpCallback
(
&
ddoi
,
lpvRef
)
!=
DIENUM_CONTINUE
)
{
/* return to unaquired state if that's where we were */
if
(
xfd
==
-
1
)
iface
->
lpVtbl
->
Unacquire
(
iface
);
IDirectInputDevice8_
Unacquire
(
iface
);
return
DI_OK
;
}
}
...
...
@@ -1078,7 +1078,7 @@ static HRESULT WINAPI JoystickAImpl_EnumObjects(
/* return to unaquired state if that's where we were */
if
(
xfd
==
-
1
)
iface
->
lpVtbl
->
Unacquire
(
iface
);
IDirectInputDevice8_
Unacquire
(
iface
);
return
DI_OK
;
}
...
...
@@ -1176,7 +1176,7 @@ static HRESULT WINAPI JoystickAImpl_CreateEffect(LPDIRECTINPUTDEVICE8A iface,
return
retval
;
if
(
lpeff
!=
NULL
)
retval
=
new
->
ref
->
lpVtbl
->
SetParameters
(
new
->
ref
,
lpeff
,
0
);
retval
=
IDirectInputEffect_SetParameters
(
new
->
ref
,
lpeff
,
0
);
if
(
retval
!=
DI_OK
&&
retval
!=
DI_DOWNLOADSKIPPED
)
return
retval
;
...
...
@@ -1210,66 +1210,66 @@ static HRESULT WINAPI JoystickAImpl_EnumEffects(LPDIRECTINPUTDEVICE8A iface,
/* We need to return something even if we're not yet acquired */
if
(
xfd
==
-
1
)
iface
->
lpVtbl
->
Acquire
(
iface
);
IDirectInputDevice8_
Acquire
(
iface
);
if
((
type
==
DIEFT_ALL
||
type
==
DIEFT_CONSTANTFORCE
)
&&
test_bit
(
This
->
ffbits
,
FF_CONSTANT
))
{
iface
->
lpVtbl
->
GetEffectInfo
(
iface
,
&
dei
,
&
GUID_ConstantForce
);
IDirectInputDevice8_
GetEffectInfo
(
iface
,
&
dei
,
&
GUID_ConstantForce
);
(
*
lpCallback
)(
&
dei
,
pvRef
);
}
if
((
type
==
DIEFT_ALL
||
type
==
DIEFT_PERIODIC
)
&&
test_bit
(
This
->
ffbits
,
FF_PERIODIC
))
{
if
(
test_bit
(
This
->
ffbits
,
FF_SQUARE
))
{
iface
->
lpVtbl
->
GetEffectInfo
(
iface
,
&
dei
,
&
GUID_Square
);
IDirectInputDevice8_
GetEffectInfo
(
iface
,
&
dei
,
&
GUID_Square
);
(
*
lpCallback
)(
&
dei
,
pvRef
);
}
if
(
test_bit
(
This
->
ffbits
,
FF_SINE
))
{
iface
->
lpVtbl
->
GetEffectInfo
(
iface
,
&
dei
,
&
GUID_Sine
);
IDirectInputDevice8_
GetEffectInfo
(
iface
,
&
dei
,
&
GUID_Sine
);
(
*
lpCallback
)(
&
dei
,
pvRef
);
}
if
(
test_bit
(
This
->
ffbits
,
FF_TRIANGLE
))
{
iface
->
lpVtbl
->
GetEffectInfo
(
iface
,
&
dei
,
&
GUID_Triangle
);
IDirectInputDevice8_
GetEffectInfo
(
iface
,
&
dei
,
&
GUID_Triangle
);
(
*
lpCallback
)(
&
dei
,
pvRef
);
}
if
(
test_bit
(
This
->
ffbits
,
FF_SAW_UP
))
{
iface
->
lpVtbl
->
GetEffectInfo
(
iface
,
&
dei
,
&
GUID_SawtoothUp
);
IDirectInputDevice8_
GetEffectInfo
(
iface
,
&
dei
,
&
GUID_SawtoothUp
);
(
*
lpCallback
)(
&
dei
,
pvRef
);
}
if
(
test_bit
(
This
->
ffbits
,
FF_SAW_DOWN
))
{
iface
->
lpVtbl
->
GetEffectInfo
(
iface
,
&
dei
,
&
GUID_SawtoothDown
);
IDirectInputDevice8_
GetEffectInfo
(
iface
,
&
dei
,
&
GUID_SawtoothDown
);
(
*
lpCallback
)(
&
dei
,
pvRef
);
}
}
if
((
type
==
DIEFT_ALL
||
type
==
DIEFT_RAMPFORCE
)
&&
test_bit
(
This
->
ffbits
,
FF_RAMP
))
{
iface
->
lpVtbl
->
GetEffectInfo
(
iface
,
&
dei
,
&
GUID_RampForce
);
IDirectInputDevice8_
GetEffectInfo
(
iface
,
&
dei
,
&
GUID_RampForce
);
(
*
lpCallback
)(
&
dei
,
pvRef
);
}
if
(
type
==
DIEFT_ALL
||
type
==
DIEFT_CONDITION
)
{
if
(
test_bit
(
This
->
ffbits
,
FF_SPRING
))
{
iface
->
lpVtbl
->
GetEffectInfo
(
iface
,
&
dei
,
&
GUID_Spring
);
IDirectInputDevice8_
GetEffectInfo
(
iface
,
&
dei
,
&
GUID_Spring
);
(
*
lpCallback
)(
&
dei
,
pvRef
);
}
if
(
test_bit
(
This
->
ffbits
,
FF_DAMPER
))
{
iface
->
lpVtbl
->
GetEffectInfo
(
iface
,
&
dei
,
&
GUID_Damper
);
IDirectInputDevice8_
GetEffectInfo
(
iface
,
&
dei
,
&
GUID_Damper
);
(
*
lpCallback
)(
&
dei
,
pvRef
);
}
if
(
test_bit
(
This
->
ffbits
,
FF_INERTIA
))
{
iface
->
lpVtbl
->
GetEffectInfo
(
iface
,
&
dei
,
&
GUID_Inertia
);
IDirectInputDevice8_
GetEffectInfo
(
iface
,
&
dei
,
&
GUID_Inertia
);
(
*
lpCallback
)(
&
dei
,
pvRef
);
}
if
(
test_bit
(
This
->
ffbits
,
FF_FRICTION
))
{
iface
->
lpVtbl
->
GetEffectInfo
(
iface
,
&
dei
,
&
GUID_Friction
);
IDirectInputDevice8_
GetEffectInfo
(
iface
,
&
dei
,
&
GUID_Friction
);
(
*
lpCallback
)(
&
dei
,
pvRef
);
}
}
/* return to unaquired state if that's where it was */
if
(
xfd
==
-
1
)
iface
->
lpVtbl
->
Unacquire
(
iface
);
IDirectInputDevice8_
Unacquire
(
iface
);
#endif
return
DI_OK
;
...
...
@@ -1294,66 +1294,66 @@ static HRESULT WINAPI JoystickWImpl_EnumEffects(LPDIRECTINPUTDEVICE8W iface,
/* We need to return something even if we're not yet acquired */
if
(
xfd
==
-
1
)
iface
->
lpVtbl
->
Acquire
(
iface
);
IDirectInputDevice8_
Acquire
(
iface
);
if
((
type
==
DIEFT_ALL
||
type
==
DIEFT_CONSTANTFORCE
)
&&
test_bit
(
This
->
ffbits
,
FF_CONSTANT
))
{
iface
->
lpVtbl
->
GetEffectInfo
(
iface
,
&
dei
,
&
GUID_ConstantForce
);
IDirectInputDevice8_
GetEffectInfo
(
iface
,
&
dei
,
&
GUID_ConstantForce
);
(
*
lpCallback
)(
&
dei
,
pvRef
);
}
if
((
type
==
DIEFT_ALL
||
type
==
DIEFT_PERIODIC
)
&&
test_bit
(
This
->
ffbits
,
FF_PERIODIC
))
{
if
(
test_bit
(
This
->
ffbits
,
FF_SQUARE
))
{
iface
->
lpVtbl
->
GetEffectInfo
(
iface
,
&
dei
,
&
GUID_Square
);
IDirectInputDevice8_
GetEffectInfo
(
iface
,
&
dei
,
&
GUID_Square
);
(
*
lpCallback
)(
&
dei
,
pvRef
);
}
if
(
test_bit
(
This
->
ffbits
,
FF_SINE
))
{
iface
->
lpVtbl
->
GetEffectInfo
(
iface
,
&
dei
,
&
GUID_Sine
);
IDirectInputDevice8_
GetEffectInfo
(
iface
,
&
dei
,
&
GUID_Sine
);
(
*
lpCallback
)(
&
dei
,
pvRef
);
}
if
(
test_bit
(
This
->
ffbits
,
FF_TRIANGLE
))
{
iface
->
lpVtbl
->
GetEffectInfo
(
iface
,
&
dei
,
&
GUID_Triangle
);
IDirectInputDevice8_
GetEffectInfo
(
iface
,
&
dei
,
&
GUID_Triangle
);
(
*
lpCallback
)(
&
dei
,
pvRef
);
}
if
(
test_bit
(
This
->
ffbits
,
FF_SAW_UP
))
{
iface
->
lpVtbl
->
GetEffectInfo
(
iface
,
&
dei
,
&
GUID_SawtoothUp
);
IDirectInputDevice8_
GetEffectInfo
(
iface
,
&
dei
,
&
GUID_SawtoothUp
);
(
*
lpCallback
)(
&
dei
,
pvRef
);
}
if
(
test_bit
(
This
->
ffbits
,
FF_SAW_DOWN
))
{
iface
->
lpVtbl
->
GetEffectInfo
(
iface
,
&
dei
,
&
GUID_SawtoothDown
);
IDirectInputDevice8_
GetEffectInfo
(
iface
,
&
dei
,
&
GUID_SawtoothDown
);
(
*
lpCallback
)(
&
dei
,
pvRef
);
}
}
if
((
type
==
DIEFT_ALL
||
type
==
DIEFT_RAMPFORCE
)
&&
test_bit
(
This
->
ffbits
,
FF_RAMP
))
{
iface
->
lpVtbl
->
GetEffectInfo
(
iface
,
&
dei
,
&
GUID_RampForce
);
IDirectInputDevice8_
GetEffectInfo
(
iface
,
&
dei
,
&
GUID_RampForce
);
(
*
lpCallback
)(
&
dei
,
pvRef
);
}
if
(
type
==
DIEFT_ALL
||
type
==
DIEFT_CONDITION
)
{
if
(
test_bit
(
This
->
ffbits
,
FF_SPRING
))
{
iface
->
lpVtbl
->
GetEffectInfo
(
iface
,
&
dei
,
&
GUID_Spring
);
IDirectInputDevice8_
GetEffectInfo
(
iface
,
&
dei
,
&
GUID_Spring
);
(
*
lpCallback
)(
&
dei
,
pvRef
);
}
if
(
test_bit
(
This
->
ffbits
,
FF_DAMPER
))
{
iface
->
lpVtbl
->
GetEffectInfo
(
iface
,
&
dei
,
&
GUID_Damper
);
IDirectInputDevice8_
GetEffectInfo
(
iface
,
&
dei
,
&
GUID_Damper
);
(
*
lpCallback
)(
&
dei
,
pvRef
);
}
if
(
test_bit
(
This
->
ffbits
,
FF_INERTIA
))
{
iface
->
lpVtbl
->
GetEffectInfo
(
iface
,
&
dei
,
&
GUID_Inertia
);
IDirectInputDevice8_
GetEffectInfo
(
iface
,
&
dei
,
&
GUID_Inertia
);
(
*
lpCallback
)(
&
dei
,
pvRef
);
}
if
(
test_bit
(
This
->
ffbits
,
FF_FRICTION
))
{
iface
->
lpVtbl
->
GetEffectInfo
(
iface
,
&
dei
,
&
GUID_Friction
);
IDirectInputDevice8_
GetEffectInfo
(
iface
,
&
dei
,
&
GUID_Friction
);
(
*
lpCallback
)(
&
dei
,
pvRef
);
}
}
/* return to unaquired state if that's where it was */
if
(
xfd
==
-
1
)
iface
->
lpVtbl
->
Unacquire
(
iface
);
IDirectInputDevice8_
Unacquire
(
iface
);
#endif
return
DI_OK
;
...
...
@@ -1429,7 +1429,7 @@ static HRESULT WINAPI JoystickAImpl_SendForceFeedbackCommand(
/* Stop all effects */
EffectListItem
*
itr
=
This
->
top_effect
;
while
(
itr
)
{
itr
->
ref
->
lpVtbl
->
Stop
(
itr
->
ref
);
IDirectInputEffect_
Stop
(
itr
->
ref
);
itr
=
itr
->
next
;
}
}
else
if
(
dwFlags
==
DISFFC_RESET
)
{
...
...
@@ -1437,9 +1437,9 @@ static HRESULT WINAPI JoystickAImpl_SendForceFeedbackCommand(
/* This returns the device to its "bare" state */
while
(
This
->
top_effect
)
{
EffectListItem
*
temp
=
This
->
top_effect
;
temp
->
ref
->
lpVtbl
->
Stop
(
temp
->
ref
);
temp
->
ref
->
lpVtbl
->
Unload
(
temp
->
ref
);
temp
->
ref
->
lpVtbl
->
Release
(
temp
->
ref
);
IDirectInputEffect_
Stop
(
temp
->
ref
);
IDirectInputEffect_
Unload
(
temp
->
ref
);
IDirectInputEffect_
Release
(
temp
->
ref
);
This
->
top_effect
=
temp
->
next
;
free
(
temp
);
}
...
...
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