summaryrefslogtreecommitdiff
path: root/src/gui/viewport.cpp
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2012-07-12 23:10:37 +0200
committerThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2012-07-12 23:10:37 +0200
commit55fc460429899df2d976a11d4521eb2f6ab56367 (patch)
tree7cecc9f16227dc31a46b3d043a7f356eb8d16f63 /src/gui/viewport.cpp
parent6fb4a7f6e0b793a0d3033e1ffdc31c115c8313eb (diff)
downloadmana-client-55fc460429899df2d976a11d4521eb2f6ab56367.tar.gz
mana-client-55fc460429899df2d976a11d4521eb2f6ab56367.tar.bz2
mana-client-55fc460429899df2d976a11d4521eb2f6ab56367.tar.xz
mana-client-55fc460429899df2d976a11d4521eb2f6ab56367.zip
Implemented scaling in OpenGL mode
The screen will be scaled up as much as possible, while keeping a minimum 'virtual' resolution of 640x360.
Diffstat (limited to 'src/gui/viewport.cpp')
-rw-r--r--src/gui/viewport.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp
index 1b5b00c3..0aab399c 100644
--- a/src/gui/viewport.cpp
+++ b/src/gui/viewport.cpp
@@ -286,6 +286,10 @@ void Viewport::logic()
void Viewport::_followMouse()
{
Uint8 button = SDL_GetMouseState(&mMouseX, &mMouseY);
+
+ mMouseX /= graphics->getScale();
+ mMouseY /= graphics->getScale();
+
// If the left button is dragged
if (mPlayerFollowMouse && button & SDL_BUTTON(1))
{
@@ -313,6 +317,9 @@ void Viewport::_drawDebugPath(Graphics *graphics)
// Get the current mouse position
SDL_GetMouseState(&mMouseX, &mMouseY);
+ mMouseX /= graphics->getScale();
+ mMouseY /= graphics->getScale();
+
// Prepare the walkmask corresponding to the protocol
unsigned char walkMask;
switch (Net::getNetworkType())