aboutsummaryrefslogtreecommitdiff
path: root/engines/wintermute/base/base_save_thumb_helper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/wintermute/base/base_save_thumb_helper.cpp')
-rw-r--r--engines/wintermute/base/base_save_thumb_helper.cpp56
1 files changed, 44 insertions, 12 deletions
diff --git a/engines/wintermute/base/base_save_thumb_helper.cpp b/engines/wintermute/base/base_save_thumb_helper.cpp
index b4205c21c4..d4df1dffb4 100644
--- a/engines/wintermute/base/base_save_thumb_helper.cpp
+++ b/engines/wintermute/base/base_save_thumb_helper.cpp
@@ -30,51 +30,83 @@
#include "engines/wintermute/base/gfx/base_image.h"
#include "engines/wintermute/base/gfx/base_renderer.h"
#include "engines/wintermute/base/base_game.h"
+#include "graphics/scaler.h"
namespace Wintermute {
//////////////////////////////////////////////////////////////////////////
BaseSaveThumbHelper::BaseSaveThumbHelper(BaseGame *inGame) : BaseClass(inGame) {
_thumbnail = NULL;
+ _scummVMThumb = NULL;
}
//////////////////////////////////////////////////////////////////////////
BaseSaveThumbHelper::~BaseSaveThumbHelper(void) {
delete _thumbnail;
_thumbnail = NULL;
+ delete _scummVMThumb;
+ _scummVMThumb = NULL;
}
-//////////////////////////////////////////////////////////////////////////
-bool BaseSaveThumbHelper::storeThumbnail(bool doFlip) {
- delete _thumbnail;
- _thumbnail = NULL;
-
+BaseImage *BaseSaveThumbHelper::storeThumb(bool doFlip, int width, int height) {
+ BaseImage *thumbnail = NULL;
if (_gameRef->_thumbnailWidth > 0 && _gameRef->_thumbnailHeight > 0) {
if (doFlip) {
// when using opengl on windows it seems to be necessary to do this twice
// works normally for direct3d
_gameRef->displayContent(false);
_gameRef->_renderer->flip();
-
+
_gameRef->displayContent(false);
_gameRef->_renderer->flip();
}
-
+
BaseImage *screenshot = _gameRef->_renderer->takeScreenshot();
if (!screenshot) {
return STATUS_FAILED;
}
-
+
// normal thumbnail
if (_gameRef->_thumbnailWidth > 0 && _gameRef->_thumbnailHeight > 0) {
- _thumbnail = new BaseImage();
- _thumbnail->copyFrom(screenshot, _gameRef->_thumbnailWidth, _gameRef->_thumbnailHeight);
+ thumbnail = new BaseImage();
+ thumbnail->copyFrom(screenshot, width, height);
}
-
-
+
+
delete screenshot;
screenshot = NULL;
}
+ return thumbnail;
+}
+
+//////////////////////////////////////////////////////////////////////////
+bool BaseSaveThumbHelper::storeThumbnail(bool doFlip) {
+ delete _thumbnail;
+ _thumbnail = NULL;
+
+ if (_gameRef->_thumbnailWidth > 0 && _gameRef->_thumbnailHeight > 0) {
+
+ _thumbnail = storeThumb(doFlip, _gameRef->_thumbnailWidth, _gameRef->_thumbnailHeight);
+ if (!_thumbnail) {
+ return STATUS_FAILED;
+ }
+ }
+ storeScummVMThumbNail();
+ return STATUS_OK;
+}
+
+//////////////////////////////////////////////////////////////////////////
+bool BaseSaveThumbHelper::storeScummVMThumbNail(bool doFlip) {
+ delete _thumbnail;
+ _thumbnail = NULL;
+
+ if (_gameRef->_thumbnailWidth > 0 && _gameRef->_thumbnailHeight > 0) {
+
+ _scummVMThumb = storeThumb(doFlip, kThumbnailWidth, kThumbnailHeight2);
+ if (!_scummVMThumb) {
+ return STATUS_FAILED;
+ }
+ }
return STATUS_OK;
}