diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-12-16 01:03:19 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-12-16 01:03:19 +0300 |
commit | 78fb544aeb8761e8d554487487bc27e610822e2d (patch) | |
tree | 45ec42f5dcba94cd391f54a4cef2c017d7318d38 /src/resources/sdlscreenshothelper.cpp | |
parent | fcdc44b21bda79052205ca1884b7f3a1ebd32957 (diff) | |
download | ManaVerse-78fb544aeb8761e8d554487487bc27e610822e2d.tar.gz ManaVerse-78fb544aeb8761e8d554487487bc27e610822e2d.tar.bz2 ManaVerse-78fb544aeb8761e8d554487487bc27e610822e2d.tar.xz ManaVerse-78fb544aeb8761e8d554487487bc27e610822e2d.zip |
Use screenshort helpers for creating screenshots
Diffstat (limited to 'src/resources/sdlscreenshothelper.cpp')
-rw-r--r-- | src/resources/sdlscreenshothelper.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/resources/sdlscreenshothelper.cpp b/src/resources/sdlscreenshothelper.cpp index f194f93ed..eff32e303 100644 --- a/src/resources/sdlscreenshothelper.cpp +++ b/src/resources/sdlscreenshothelper.cpp @@ -39,14 +39,15 @@ SdlScreenshotHelper::~SdlScreenshotHelper() { } -void SdlScreenshotHelper::prepare(const int width A_UNUSED, - const int height A_UNUSED) +void SdlScreenshotHelper::prepare() { } -SDL_Surface *SdlScreenshotHelper::getScreenshot(const int width, - const int height) +SDL_Surface *SdlScreenshotHelper::getScreenshot() { + if (!mainGraphics) + return nullptr; + #if SDL_BYTEORDER == SDL_BIG_ENDIAN const int rmask = 0xff000000; const int gmask = 0x00ff0000; @@ -59,7 +60,7 @@ SDL_Surface *SdlScreenshotHelper::getScreenshot(const int width, const int amask = 0x00000000; SDL_Surface *const screenshot = MSDL_CreateRGBSurface(SDL_SWSURFACE, - width, height, + mainGraphics->mWidth, mainGraphics->mHeight, 24, rmask, gmask, bmask, amask); |