summaryrefslogtreecommitdiff
path: root/src/gui/viewport.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-01-28 16:14:15 +0300
committerAndrei Karas <akaras@inbox.ru>2014-01-28 16:14:15 +0300
commit226202ff807dc860991af0d6665ef9e9b48c1bed (patch)
treede0be738585f3ab2556865c206981d2d2842ac69 /src/gui/viewport.cpp
parenteb62e14c838788ae7691567a90bf7fe4940d5687 (diff)
downloadmv-226202ff807dc860991af0d6665ef9e9b48c1bed.tar.gz
mv-226202ff807dc860991af0d6665ef9e9b48c1bed.tar.bz2
mv-226202ff807dc860991af0d6665ef9e9b48c1bed.tar.xz
mv-226202ff807dc860991af0d6665ef9e9b48c1bed.zip
Move direct SDL_GetMouseState calls into method in gui class.
Diffstat (limited to 'src/gui/viewport.cpp')
-rw-r--r--src/gui/viewport.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp
index 933c00040..5206b7424 100644
--- a/src/gui/viewport.cpp
+++ b/src/gui/viewport.cpp
@@ -275,7 +275,9 @@ void Viewport::logic()
void Viewport::_followMouse()
{
- const uint8_t button = SDL_GetMouseState(&mMouseX, &mMouseY);
+ if (!gui)
+ return;
+ const uint8_t button = gui->getMouseState(&mMouseX, &mMouseY);
// If the left button is dragged
if (mPlayerFollowMouse && (button & SDL_BUTTON(1)))
{
@@ -297,10 +299,10 @@ void Viewport::_followMouse()
void Viewport::_drawDebugPath(Graphics *const graphics)
{
- if (!player_node || !userPalette || !actorManager || !mMap)
+ if (!player_node || !userPalette || !actorManager || !mMap || !gui)
return;
- SDL_GetMouseState(&mMouseX, &mMouseY);
+ gui->getMouseState(&mMouseX, &mMouseY);
static Path debugPath;
static Vector lastMouseDestination = Vector(0.0F, 0.0F);