diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-02-15 17:01:46 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-02-15 17:01:46 +0300 |
commit | 382067b05c4fe97bcf0da0143405375ec295f7c6 (patch) | |
tree | f668cd2595ac0c85f0942f88729d3ff1956676fa /src/render | |
parent | ee8191705826d978b7793497fdd307536c709bff (diff) | |
parent | 9b329556e748050c4300174e9bdc72b15e5b8cc5 (diff) | |
download | plus-382067b05c4fe97bcf0da0143405375ec295f7c6.tar.gz plus-382067b05c4fe97bcf0da0143405375ec295f7c6.tar.bz2 plus-382067b05c4fe97bcf0da0143405375ec295f7c6.tar.xz plus-382067b05c4fe97bcf0da0143405375ec295f7c6.zip |
Merge branch 'master' into stable
Diffstat (limited to 'src/render')
-rw-r--r-- | src/render/graphics.cpp | 23 | ||||
-rw-r--r-- | src/render/sdl2softwaregraphics.cpp | 2 |
2 files changed, 20 insertions, 5 deletions
diff --git a/src/render/graphics.cpp b/src/render/graphics.cpp index 6ad1c67d7..7e3687006 100644 --- a/src/render/graphics.cpp +++ b/src/render/graphics.cpp @@ -136,8 +136,21 @@ void Graphics::setScale(int scale) { if (!scale) scale = 1; - if (mActualWidth / scale < 470 || mActualHeight / scale < 320) - scale = 1; + int scaleW = mActualWidth / scale; + int scaleH = mActualHeight / scale; + if (scaleW < 470) + { + scale = mActualWidth / 470; + if (scale < 1) + scale = 1; + scaleH = mActualHeight / scale; + } + if (scaleH < 320) + { + scale = mActualHeight / 320; + if (scale < 1) + scale = 1; + } logger->log("set scale: %d", scale); mScale = scale; mWidth = mActualWidth / mScale; @@ -373,7 +386,7 @@ bool Graphics::videoInfo() mDoubleBuffer = ((mWindow->flags & SDL_DOUBLEBUF) == SDL_DOUBLEBUF); logger->log("Double buffer mode: %s", mDoubleBuffer ? "yes" : "no"); - imageHelper->dumpSurfaceFormat(mWindow); + ImageHelper::dumpSurfaceFormat(mWindow); const SDL_VideoInfo *const vi = SDL_GetVideoInfo(); if (!vi) @@ -420,11 +433,13 @@ bool Graphics::resizeScreen(const int width, const int height) mRect.h = height / mScale; mWidth = width / mScale; mHeight = height / mScale; + mActualWidth = width; + mActualHeight = height; #ifdef USE_OPENGL // +++ probably this way will not work in windows/mac // Setup OpenGL - glViewport(0, 0, mWidth, mHeight); + glViewport(0, 0, mActualWidth, mActualHeight); glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST); #else // +++ need impliment resize in soft mode diff --git a/src/render/sdl2softwaregraphics.cpp b/src/render/sdl2softwaregraphics.cpp index 088aba98c..22a66a911 100644 --- a/src/render/sdl2softwaregraphics.cpp +++ b/src/render/sdl2softwaregraphics.cpp @@ -1487,7 +1487,7 @@ bool SDL2SoftwareGraphics::setVideoMode(const int w, const int h, } mSurface = SDL_GetWindowSurface(mWindow); - imageHelper->dumpSurfaceFormat(mSurface); + ImageHelper::dumpSurfaceFormat(mSurface); SDL2SoftwareImageHelper::setFormat(mSurface->format); int w1 = 0; |