[Scummvm-cvs-logs] SF.net SVN: scummvm:[33640] scummvm/trunk/engines/scumm/dialogs.cpp

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Tue Aug 5 15:11:22 CEST 2008


Revision: 33640
          http://scummvm.svn.sourceforge.net/scummvm/?rev=33640&view=rev
Author:   fingolfin
Date:     2008-08-05 13:11:22 +0000 (Tue, 05 Aug 2008)

Log Message:
-----------
SCUMM: cleanup SaveLoadChooser::updateInfos code

Modified Paths:
--------------
    scummvm/trunk/engines/scumm/dialogs.cpp

Modified: scummvm/trunk/engines/scumm/dialogs.cpp
===================================================================
--- scummvm/trunk/engines/scumm/dialogs.cpp	2008-08-05 13:08:07 UTC (rev 33639)
+++ scummvm/trunk/engines/scumm/dialogs.cpp	2008-08-05 13:11:22 UTC (rev 33640)
@@ -372,30 +372,23 @@
 		_gfxWidget->setGfx(thumb);
 		_gfxWidget->useAlpha(256);
 		thumb->free();
+		delete thumb;
 	} else {
 		_gfxWidget->setGfx(-1, -1, _fillR, _fillG, _fillB);
 	}
 
-	delete thumb;
-	if (redraw)
-		_gfxWidget->draw();
-
 	InfoStuff infos;
 	memset(&infos, 0, sizeof(InfoStuff));
-	char buffer[32];
 	if (selItem >= 0 && _vm->loadInfosFromSlot(_saveMode ? selItem + 1 : selItem, &infos)) {
+		char buffer[32];
 		snprintf(buffer, 32, "Date: %.2d.%.2d.%.4d",
 			(infos.date >> 24) & 0xFF, (infos.date >> 16) & 0xFF,
 			infos.date & 0xFFFF);
 		_date->setLabel(buffer);
-		if (redraw)
-			_date->draw();
 
 		snprintf(buffer, 32, "Time: %.2d:%.2d",
 			(infos.time >> 8) & 0xFF, infos.time & 0xFF);
 		_time->setLabel(buffer);
-		if (redraw)
-			_time->draw();
 
 		int minutes = infos.playtime / 60;
 		int hours = minutes / 60;
@@ -404,23 +397,17 @@
 		snprintf(buffer, 32, "Playtime: %.2d:%.2d",
 			hours & 0xFF, minutes & 0xFF);
 		_playtime->setLabel(buffer);
-		if (redraw)
-			_playtime->draw();
 	} else {
-		snprintf(buffer, 32, "No date saved");
-		_date->setLabel(buffer);
-		if (redraw)
-			_date->draw();
+		_date->setLabel("No date saved");
+		_time->setLabel("No time saved");
+		_playtime->setLabel("No playtime saved");
+	}
 
-		snprintf(buffer, 32, "No time saved");
-		_time->setLabel(buffer);
-		if (redraw)
-			_time->draw();
-
-		snprintf(buffer, 32, "No playtime saved");
-		_playtime->setLabel(buffer);
-		if (redraw)
-			_playtime->draw();
+	if (redraw) {
+		_gfxWidget->draw();
+		_date->draw();
+		_time->draw();
+		_playtime->draw();
 	}
 }
 


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