diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-01-29 01:59:10 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-01-29 01:59:10 +0300 |
commit | bbe6513b10f79ff25d04cd268c5224c3e84cc6ea (patch) | |
tree | 92302f74b33c00c8584e3479f1ea8d98011deeb6 /src/render/graphics.cpp | |
parent | 6aed2d7d4c6a3cb181f053ba52488cb1a0ea232c (diff) | |
download | plus-bbe6513b10f79ff25d04cd268c5224c3e84cc6ea.tar.gz plus-bbe6513b10f79ff25d04cd268c5224c3e84cc6ea.tar.bz2 plus-bbe6513b10f79ff25d04cd268c5224c3e84cc6ea.tar.xz plus-bbe6513b10f79ff25d04cd268c5224c3e84cc6ea.zip |
fix on the fly scalle changing.
Diffstat (limited to 'src/render/graphics.cpp')
-rw-r--r-- | src/render/graphics.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/render/graphics.cpp b/src/render/graphics.cpp index 82f44460b..c6237cf97 100644 --- a/src/render/graphics.cpp +++ b/src/render/graphics.cpp @@ -140,13 +140,15 @@ void Graphics::setScale(int scale) scale = 1; logger->log("set scale: %d", scale); mScale = scale; + mWidth = mActualWidth / mScale; + mHeight = mActualHeight / mScale; } else { mScale = 1; + mWidth = mActualWidth; + mHeight = mActualHeight; } - mWidth = mActualWidth / mScale; - mHeight = mActualHeight / mScale; mRect.w = mWidth; mRect.h = mHeight; } @@ -411,9 +413,6 @@ bool Graphics::setFullscreen(const bool fs) bool Graphics::resizeScreen(const int width, const int height) { - if (mWidth == width && mHeight == height) - return true; - #ifdef USE_SDL2 _endDraw(); |