From bbe6513b10f79ff25d04cd268c5224c3e84cc6ea Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 29 Jan 2014 01:59:10 +0300 Subject: fix on the fly scalle changing. --- src/render/graphics.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src') 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(); -- cgit v1.2.3-60-g2f50