Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Libretro
Citra2018
Commits
ba0e28ab
Commit
ba0e28ab
authored
Nov 11, 2017
by
James
Browse files
Comment mouse tracker actions
parent
e32cd50c
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/citra_libretro/input/mouse_tracker.cpp
View file @
ba0e28ab
...
...
@@ -74,12 +74,14 @@ void MouseTracker::Update(int bufferWidth, int bufferHeight,
auto
widthSpeed
=
(
bottomScreen
.
GetWidth
()
/
20.0
);
auto
heightSpeed
=
(
bottomScreen
.
GetHeight
()
/
20.0
);
// Read in and convert pointer values to absolute values on the canvas
auto
pointerX
=
LibRetro
::
CheckInput
(
0
,
RETRO_DEVICE_POINTER
,
0
,
RETRO_DEVICE_ID_POINTER_X
);
auto
pointerY
=
LibRetro
::
CheckInput
(
0
,
RETRO_DEVICE_POINTER
,
0
,
RETRO_DEVICE_ID_POINTER_Y
);
auto
newX
=
static_cast
<
int
>
((
pointerX
+
0x7fff
)
/
(
float
)(
0x7fff
*
2
)
*
bufferWidth
);
auto
newY
=
static_cast
<
int
>
((
pointerY
+
0x7fff
)
/
(
float
)(
0x7fff
*
2
)
*
bufferHeight
);
if
((
pointerX
!=
0
||
pointerY
!=
0
)
&&
(
newX
!=
lastMouseX
||
newY
!=
lastMouseY
))
{
// Use mouse pointer movement
lastMouseX
=
newX
;
lastMouseY
=
newY
;
...
...
@@ -88,6 +90,7 @@ void MouseTracker::Update(int bufferWidth, int bufferHeight,
y
=
std
::
max
(
static_cast
<
int
>
(
bottomScreen
.
top
),
std
::
min
(
newY
,
static_cast
<
int
>
(
bottomScreen
.
bottom
)))
-
bottomScreen
.
top
;
}
else
if
(
LibRetro
::
settings
.
analog_function
!=
LibRetro
::
CStickFunction
::
CStick
)
{
// Use controller movement
float
controllerX
=
((
float
)
LibRetro
::
CheckInput
(
0
,
RETRO_DEVICE_ANALOG
,
RETRO_DEVICE_INDEX_ANALOG_RIGHT
,
RETRO_DEVICE_ID_ANALOG_X
)
/
...
...
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