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
8578f9c3
Commit
8578f9c3
authored
Apr 26, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Get rid of some redundant coordinate mappings.
parent
897fdfd4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
16 deletions
+4
-16
mouse.c
dlls/dinput/mouse.c
+4
-16
No files found.
dlls/dinput/mouse.c
View file @
8578f9c3
...
...
@@ -66,7 +66,6 @@ struct SysMouseImpl
/* These are used in case of relative -> absolute transitions */
POINT
org_coords
;
POINT
mapped_center
;
DWORD
win_centerX
,
win_centerY
;
/* warping: whether we need to move mouse back to middle once we
* reach window borders (for e.g. shooters, "surface movement" games) */
BOOL
need_warp
;
...
...
@@ -419,20 +418,12 @@ static int dinput_mouse_hook( LPDIRECTINPUTDEVICE8A iface, WPARAM wparam, LPARAM
static
BOOL
dinput_window_check
(
SysMouseImpl
*
This
)
{
RECT
rect
;
DWORD
centerX
,
centerY
;
/* make sure the window hasn't moved */
if
(
!
GetWindowRect
(
This
->
base
.
win
,
&
rect
))
return
FALSE
;
centerX
=
(
rect
.
right
-
rect
.
left
)
/
2
;
centerY
=
(
rect
.
bottom
-
rect
.
top
)
/
2
;
if
(
This
->
win_centerX
!=
centerX
||
This
->
win_centerY
!=
centerY
)
{
This
->
win_centerX
=
centerX
;
This
->
win_centerY
=
centerY
;
}
This
->
mapped_center
.
x
=
This
->
win_centerX
;
This
->
mapped_center
.
y
=
This
->
win_centerY
;
MapWindowPoints
(
This
->
base
.
win
,
HWND_DESKTOP
,
&
This
->
mapped_center
,
1
);
This
->
mapped_center
.
x
=
(
rect
.
left
+
rect
.
right
)
/
2
;
This
->
mapped_center
.
y
=
(
rect
.
top
+
rect
.
bottom
)
/
2
;
return
TRUE
;
}
...
...
@@ -488,15 +479,12 @@ static HRESULT WINAPI SysMouseWImpl_Acquire(LPDIRECTINPUTDEVICE8W iface)
/* Get the window dimension and find the center */
GetWindowRect
(
This
->
base
.
win
,
&
rect
);
This
->
win_centerX
=
(
rect
.
right
-
rect
.
lef
t
)
/
2
;
This
->
win_centerY
=
(
rect
.
bottom
-
rect
.
top
)
/
2
;
This
->
mapped_center
.
x
=
(
rect
.
left
+
rect
.
righ
t
)
/
2
;
This
->
mapped_center
.
y
=
(
rect
.
top
+
rect
.
bottom
)
/
2
;
/* Warp the mouse to the center of the window */
if
(
This
->
base
.
dwCoopLevel
&
DISCL_EXCLUSIVE
||
This
->
warp_override
==
WARP_FORCE_ON
)
{
This
->
mapped_center
.
x
=
This
->
win_centerX
;
This
->
mapped_center
.
y
=
This
->
win_centerY
;
MapWindowPoints
(
This
->
base
.
win
,
HWND_DESKTOP
,
&
This
->
mapped_center
,
1
);
TRACE
(
"Warping mouse to %d - %d
\n
"
,
This
->
mapped_center
.
x
,
This
->
mapped_center
.
y
);
SetCursorPos
(
This
->
mapped_center
.
x
,
This
->
mapped_center
.
y
);
This
->
last_warped
=
GetCurrentTime
();
...
...
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