diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-08-22 11:59:38 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-08-24 21:08:15 +0300 |
commit | 2480ea4cc668ff99007dd6fb8b44911eea5d5287 (patch) | |
tree | c8fc22a9612d30474cddd6d40da5269ffd7f55a5 /src/sdl2graphics.cpp | |
parent | 07390a4c8dcde85602c1a91d3773061d67d169ab (diff) | |
download | ManaVerse-2480ea4cc668ff99007dd6fb8b44911eea5d5287.tar.gz ManaVerse-2480ea4cc668ff99007dd6fb8b44911eea5d5287.tar.bz2 ManaVerse-2480ea4cc668ff99007dd6fb8b44911eea5d5287.tar.xz ManaVerse-2480ea4cc668ff99007dd6fb8b44911eea5d5287.zip |
store window size into rectangle.
Diffstat (limited to 'src/sdl2graphics.cpp')
-rw-r--r-- | src/sdl2graphics.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/sdl2graphics.cpp b/src/sdl2graphics.cpp index 99f022bcb..a2fc010f6 100644 --- a/src/sdl2graphics.cpp +++ b/src/sdl2graphics.cpp @@ -434,7 +434,7 @@ SDL_Surface *SDLGraphics::getScreenshot() const int amask = 0x00000000; SDL_Surface *const screenshot = SDL_CreateRGBSurface(SDL_SWSURFACE, - mWindow->w, mWindow->h, 24, rmask, gmask, bmask, amask); + mRect.w, mRect.h, 24, rmask, gmask, bmask, amask); if (screenshot) SDL_BlitSurface(mWindow, nullptr, screenshot, nullptr); @@ -782,7 +782,7 @@ void SDLGraphics::fillRectangle(const gcn::Rectangle& rectangle) void SDLGraphics::_beginDraw() { - pushClipArea(gcn::Rectangle(0, 0, mWindow->w, mWindow->h)); + pushClipArea(gcn::Rectangle(0, 0, mRect.w, mRect.h)); } void SDLGraphics::_endDraw() @@ -1141,6 +1141,8 @@ bool SDLGraphics::setVideoMode(const int w, const int h, const int bpp, if (!(mWindow = graphicsManager.createWindow(w, h, bpp, getSoftwareFlags()))) { + mRect.w = 0; + mRect.h = 0; return false; } |