diff options
author | Strangerke | 2016-05-19 07:06:48 +0200 |
---|---|---|
committer | Strangerke | 2016-05-19 07:06:48 +0200 |
commit | 97ac77b5f1b41b77b5e9a79bac0f6a11a4063386 (patch) | |
tree | 679fc39714afb99f1cbb3ce11e0fae2b6d20f3c1 /engines/gnap | |
parent | 3bf35331abd506805bbc64537d6fb9b7969d10e4 (diff) | |
download | scummvm-rg350-97ac77b5f1b41b77b5e9a79bac0f6a11a4063386.tar.gz scummvm-rg350-97ac77b5f1b41b77b5e9a79bac0f6a11a4063386.tar.bz2 scummvm-rg350-97ac77b5f1b41b77b5e9a79bac0f6a11a4063386.zip |
GNAP: Compute the thumbnail when opening the device so that it doesn't show the large hand in savegames
Diffstat (limited to 'engines/gnap')
-rw-r--r-- | engines/gnap/gnap.cpp | 2 | ||||
-rw-r--r-- | engines/gnap/gnap.h | 2 | ||||
-rw-r--r-- | engines/gnap/menu.cpp | 11 |
3 files changed, 12 insertions, 3 deletions
diff --git a/engines/gnap/gnap.cpp b/engines/gnap/gnap.cpp index d0d8d0adcd..435d0c7be6 100644 --- a/engines/gnap/gnap.cpp +++ b/engines/gnap/gnap.cpp @@ -97,6 +97,7 @@ GnapEngine::GnapEngine(OSystem *syst, const ADGameDescription *gd) : Engine::syncSoundSettings(); _scene = nullptr; _music = nullptr; + _tempThumbnail = nullptr; _wasSavegameLoaded = false; for (int i = 0; i < kMaxTimers; ++i) @@ -112,6 +113,7 @@ GnapEngine::GnapEngine(OSystem *syst, const ADGameDescription *gd) : GnapEngine::~GnapEngine() { delete _random; delete _music; + delete _tempThumbnail; } Common::Error GnapEngine::run() { diff --git a/engines/gnap/gnap.h b/engines/gnap/gnap.h index cb1c00d044..e6507ccb31 100644 --- a/engines/gnap/gnap.h +++ b/engines/gnap/gnap.h @@ -248,6 +248,8 @@ public: MusicPlayer *_music; Graphics::Font *_font; + Common::MemoryWriteStreamDynamic *_tempThumbnail; + int _lastUpdateClock; int _debugLevel; diff --git a/engines/gnap/menu.cpp b/engines/gnap/menu.cpp index 4381d2f1d3..2196bb6409 100644 --- a/engines/gnap/menu.cpp +++ b/engines/gnap/menu.cpp @@ -210,8 +210,11 @@ void GnapEngine::runMenu() { _menuStatus = 0; _menuDone = false; - createMenuSprite();//??? CHECKME Crashes when done in loadStockDat() find out why + delete _tempThumbnail; + _tempThumbnail = new Common::MemoryWriteStreamDynamic; + Graphics::saveThumbnail(*_tempThumbnail); + createMenuSprite(); insertDeviceIconActive(); for (int i = 0; i < 7; ++i) { @@ -577,7 +580,9 @@ void GnapEngine::writeSavegameHeader(Common::OutSaveFile *out, GnapSavegameHeade out->writeString(header._saveName); out->writeByte('\0'); - Graphics::saveThumbnail(*out); + // This implies the menu is used + // If we want to save/load at any time, then a check should be added + out->write(_tempThumbnail->getData(), _tempThumbnail->size()); // Write out the save date/time TimeDate td; @@ -608,7 +613,7 @@ bool GnapEngine::readSavegameHeader(Common::InSaveFile *in, GnapSavegameHeader & while ((ch = (char)in->readByte()) != '\0') header._saveName += ch; - // TODO: Get the thumbnail + // Get the thumbnail, saved in v2 or later if (header._version == 1) header._thumbnail = nullptr; else { |