[Scummvm-cvs-logs] SF.net SVN: scummvm:[39121] scummvm/trunk/engines/sword1

hkz at users.sourceforge.net hkz at users.sourceforge.net
Wed Mar 4 11:33:30 CET 2009


Revision: 39121
          http://scummvm.svn.sourceforge.net/scummvm/?rev=39121&view=rev
Author:   hkz
Date:     2009-03-04 10:33:29 +0000 (Wed, 04 Mar 2009)

Log Message:
-----------
sword1: enable thumbnails when saving through GMM

Modified Paths:
--------------
    scummvm/trunk/engines/sword1/control.cpp
    scummvm/trunk/engines/sword1/control.h

Modified: scummvm/trunk/engines/sword1/control.cpp
===================================================================
--- scummvm/trunk/engines/sword1/control.cpp	2009-03-04 08:33:14 UTC (rev 39120)
+++ scummvm/trunk/engines/sword1/control.cpp	2009-03-04 10:33:29 UTC (rev 39121)
@@ -300,6 +300,7 @@
 }
 
 uint8 Control::runPanel(void) {
+	_panelShown = true;
 	_mouseDown = false;
 	_restoreBuf = NULL;
 	_keyPressed.reset();
@@ -415,6 +416,7 @@
 	free(_screenBuf);
 	_mouse->controlPanel(false);
 	_music->startMusic(Logic::_scriptVars[CURRENT_MUSIC], 1);
+	_panelShown = false;
 	return retVal;
 }
 
@@ -824,6 +826,10 @@
 	_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,16 +1104,13 @@
 	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);
+	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);
 
-	// Thumbnail
-	Graphics::saveThumbnail(*outf);
-#else
-	outf->writeByte(NO_THUMBNAIL);
-#endif
-
 	// Date / time
 	tm curTime;
 	_system->getTimeAndDate(curTime);

Modified: scummvm/trunk/engines/sword1/control.h
===================================================================
--- scummvm/trunk/engines/sword1/control.h	2009-03-04 08:33:14 UTC (rev 39120)
+++ scummvm/trunk/engines/sword1/control.h	2009-03-04 10:33:29 UTC (rev 39121)
@@ -95,7 +95,8 @@
 	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 @@
 	Common::String _oldName;
 	uint8 _cursorTick;
 	bool _cursorVisible;
+	bool _panelShown;
 
 	uint8 getClicks(uint8 mode, uint8 *retVal);
 	uint8 handleButtonClick(uint8 id, uint8 mode, uint8 *retVal);


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list