aboutsummaryrefslogtreecommitdiff
path: root/engines/sword1
diff options
context:
space:
mode:
authorFabio Battaglia2009-03-04 10:33:29 +0000
committerFabio Battaglia2009-03-04 10:33:29 +0000
commit928a276c04f485ed0ca2d83d8b0827a81a33dff0 (patch)
tree6360b7e90f8a984aecfc32a9c698caaf5b57ad07 /engines/sword1
parent2a7eef19c0722752200713d3834f53637a2ecd5e (diff)
downloadscummvm-rg350-928a276c04f485ed0ca2d83d8b0827a81a33dff0.tar.gz
scummvm-rg350-928a276c04f485ed0ca2d83d8b0827a81a33dff0.tar.bz2
scummvm-rg350-928a276c04f485ed0ca2d83d8b0827a81a33dff0.zip
sword1: enable thumbnails when saving through GMM
svn-id: r39121
Diffstat (limited to 'engines/sword1')
-rw-r--r--engines/sword1/control.cpp21
-rw-r--r--engines/sword1/control.h4
2 files changed, 15 insertions, 10 deletions
diff --git a/engines/sword1/control.cpp b/engines/sword1/control.cpp
index abb02106e3..575f031cc7 100644
--- a/engines/sword1/control.cpp
+++ b/engines/sword1/control.cpp
@@ -300,6 +300,7 @@ static int volToBalance(int volL, int volR) {
}
uint8 Control::runPanel(void) {
+ _panelShown = true;
_mouseDown = false;
_restoreBuf = NULL;
_keyPressed.reset();
@@ -415,6 +416,7 @@ uint8 Control::runPanel(void) {
free(_screenBuf);
_mouse->controlPanel(false);
_music->startMusic(Logic::_scriptVars[CURRENT_MUSIC], 1);
+ _panelShown = false;
return retVal;
}
@@ -824,6 +826,10 @@ void Control::readSavegameDescriptions(void) {
_saveFiles = _numSaves = _saveNames.size();
}
+bool Control::isPanelShown(void) {
+ return _panelShown;
+}
+
int Control::displayMessage(const char *altButton, const char *message, ...) {
char buf[STRINGBUFLEN];
va_list va;
@@ -1098,15 +1104,12 @@ void Control::saveGameToFile(uint8 slot) {
outf->write(_saveNames[slot].c_str(), 40);
outf->writeByte(SAVEGAME_VERSION);
- // FIXME: at this point, we can't save a thumbnail of the game screen, as the save menu is shown
-#if 0
- outf->writeByte(HAS_THUMBNAIL);
-
- // Thumbnail
- Graphics::saveThumbnail(*outf);
-#else
- outf->writeByte(NO_THUMBNAIL);
-#endif
+ if (!isPanelShown()) {
+ outf->writeByte(HAS_THUMBNAIL);
+ // Thumbnail
+ Graphics::saveThumbnail(*outf);
+ } else // at this point we can't save a thumbnail of the game screen, as the save menu is shown
+ outf->writeByte(NO_THUMBNAIL);
// Date / time
tm curTime;
diff --git a/engines/sword1/control.h b/engines/sword1/control.h
index 9170a140eb..d1796734a8 100644
--- a/engines/sword1/control.h
+++ b/engines/sword1/control.h
@@ -95,7 +95,8 @@ public:
void readSavegameDescriptions(void);
void saveGameToFile(uint8 slot);
bool restoreGameFromFile(uint8 slot);
- void checkForOldSaveGames();
+ void checkForOldSaveGames(void);
+ bool isPanelShown(void);
void setSaveDescription(int slot, const char *desc) {
_saveNames[slot] = desc;
@@ -116,6 +117,7 @@ private:
Common::String _oldName;
uint8 _cursorTick;
bool _cursorVisible;
+ bool _panelShown;
uint8 getClicks(uint8 mode, uint8 *retVal);
uint8 handleButtonClick(uint8 id, uint8 mode, uint8 *retVal);