aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk/riven_saveload.cpp
diff options
context:
space:
mode:
authorBastien Bouclet2018-06-21 21:16:25 +0200
committerBastien Bouclet2018-06-29 13:31:54 +0200
commite7cb40dde57f5331db014eb61ff115baa7917148 (patch)
tree7d464d13f8141696d692d10977bb20eacfaa52c2 /engines/mohawk/riven_saveload.cpp
parent45ab57209f965a4804286e072f181bf98b3af6b4 (diff)
downloadscummvm-rg350-e7cb40dde57f5331db014eb61ff115baa7917148.tar.gz
scummvm-rg350-e7cb40dde57f5331db014eb61ff115baa7917148.tar.bz2
scummvm-rg350-e7cb40dde57f5331db014eb61ff115baa7917148.zip
MOHAWK: RIVEN: Use an in-game thumbnail when saving from the menu
Instead of a thumbnail of the menu itself.
Diffstat (limited to 'engines/mohawk/riven_saveload.cpp')
-rw-r--r--engines/mohawk/riven_saveload.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/engines/mohawk/riven_saveload.cpp b/engines/mohawk/riven_saveload.cpp
index e8d29a0c24..7a156ad9c9 100644
--- a/engines/mohawk/riven_saveload.cpp
+++ b/engines/mohawk/riven_saveload.cpp
@@ -413,10 +413,14 @@ Common::MemoryWriteStreamDynamic *RivenSaveLoad::genZIPSSection() {
return stream;
}
-Common::MemoryWriteStreamDynamic *RivenSaveLoad::genTHMBSection() const {
+Common::MemoryWriteStreamDynamic *RivenSaveLoad::genTHMBSection(const Graphics::Surface *thumbnail) const {
Common::MemoryWriteStreamDynamic *stream = new Common::MemoryWriteStreamDynamic(DisposeAfterUse::YES);
- Graphics::saveThumbnail(*stream);
+ if (thumbnail) {
+ Graphics::saveThumbnail(*stream, *thumbnail);
+ } else {
+ Graphics::saveThumbnail(*stream);
+ }
return stream;
}
@@ -442,7 +446,8 @@ Common::MemoryWriteStreamDynamic *RivenSaveLoad::genMETASection(const Common::St
return stream;
}
-Common::Error RivenSaveLoad::saveGame(const int slot, const Common::String &description, bool autoSave) {
+Common::Error RivenSaveLoad::saveGame(const int slot, const Common::String &description,
+ const Graphics::Surface *thumbnail, bool autoSave) {
// NOTE: This code is designed to only output a Mohawk archive
// for a Riven saved game. It's hardcoded to do this because
// (as of right now) this is the only place in the engine
@@ -460,7 +465,7 @@ Common::Error RivenSaveLoad::saveGame(const int slot, const Common::String &desc
Common::MemoryWriteStreamDynamic *metaSection = genMETASection(description, autoSave);
Common::MemoryWriteStreamDynamic *nameSection = genNAMESection();
- Common::MemoryWriteStreamDynamic *thmbSection = genTHMBSection();
+ Common::MemoryWriteStreamDynamic *thmbSection = genTHMBSection(thumbnail);
Common::MemoryWriteStreamDynamic *varsSection = genVARSSection();
Common::MemoryWriteStreamDynamic *versSection = genVERSSection();
Common::MemoryWriteStreamDynamic *zipsSection = genZIPSSection();