From 226202ff807dc860991af0d6665ef9e9b48c1bed Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 28 Jan 2014 16:14:15 +0300 Subject: Move direct SDL_GetMouseState calls into method in gui class. --- src/gui/viewport.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/gui/viewport.cpp') 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); -- cgit v1.2.3-70-g09d2