diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-01-28 00:30:51 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-01-28 23:35:20 +0300 |
commit | a0b2deb4192bddad4d061f5d5df86411a437f01f (patch) | |
tree | 4739472959d83045eac4d7f7ddf3dc265d37b45c /src/gui/gui.cpp | |
parent | 226202ff807dc860991af0d6665ef9e9b48c1bed (diff) | |
download | manaplus-a0b2deb4192bddad4d061f5d5df86411a437f01f.tar.gz manaplus-a0b2deb4192bddad4d061f5d5df86411a437f01f.tar.bz2 manaplus-a0b2deb4192bddad4d061f5d5df86411a437f01f.tar.xz manaplus-a0b2deb4192bddad4d061f5d5df86411a437f01f.zip |
add support for screen scale in OpenGL modes.
Diffstat (limited to 'src/gui/gui.cpp')
-rw-r--r-- | src/gui/gui.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index d016c0aa3..dcd4d82ea 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -942,5 +942,9 @@ void Gui::removeDragged(gcn::Widget *widget) uint32_t Gui::getMouseState(int *const x, int *const y) const { - return SDL_GetMouseState(x, y); + const uint32_t res = SDL_GetMouseState(x, y); + const int scale = mainGraphics->getScale(); + (*x) /= scale; + (*y) /= scale; + return res; } |