summaryrefslogtreecommitdiff
path: root/src/gui/gui.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/gui.cpp
parenteb62e14c838788ae7691567a90bf7fe4940d5687 (diff)
downloadplus-226202ff807dc860991af0d6665ef9e9b48c1bed.tar.gz
plus-226202ff807dc860991af0d6665ef9e9b48c1bed.tar.bz2
plus-226202ff807dc860991af0d6665ef9e9b48c1bed.tar.xz
plus-226202ff807dc860991af0d6665ef9e9b48c1bed.zip
Move direct SDL_GetMouseState calls into method in gui class.
Diffstat (limited to 'src/gui/gui.cpp')
-rw-r--r--src/gui/gui.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp
index a8c31469a..d016c0aa3 100644
--- a/src/gui/gui.cpp
+++ b/src/gui/gui.cpp
@@ -494,7 +494,7 @@ void Gui::draw()
touchManager.draw();
int mouseX, mouseY;
- const uint8_t button = SDL_GetMouseState(&mouseX, &mouseY);
+ const uint8_t button = getMouseState(&mouseX, &mouseY);
if ((client->getMouseFocused() || button & SDL_BUTTON(1))
&& mMouseCursors && mCustomCursor && mMouseCursorAlpha > 0.0F)
@@ -787,7 +787,7 @@ MouseEvent *Gui::createMouseEvent(Window *const widget)
int mouseY = 0;
getAbsolutePosition(widget, x, y);
- SDL_GetMouseState(&mouseX, &mouseY);
+ getMouseState(&mouseX, &mouseY);
return new MouseEvent(widget, mShiftPressed,
mControlPressed, mAltPressed, mMetaPressed, 0, 0,
@@ -939,3 +939,8 @@ void Gui::removeDragged(gcn::Widget *widget)
if (mFocusHandler->getDraggedWidget() == widget)
mFocusHandler->setDraggedWidget(nullptr);
}
+
+uint32_t Gui::getMouseState(int *const x, int *const y) const
+{
+ return SDL_GetMouseState(x, y);
+}