aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/dialogs.cpp
diff options
context:
space:
mode:
authorChristopher Page2008-08-09 19:03:29 +0000
committerChristopher Page2008-08-09 19:03:29 +0000
commitce3d1e1a7d9ec9860d3fc42d8127a1634051d950 (patch)
treefbf6c9a71e7e4bdb90d502755d282c183562e93b /engines/scumm/dialogs.cpp
parentf41471d34bb6afb1dc0b6604b1952d10ef583765 (diff)
parent71f4a15e4efebf4de7a25d2b09817cf3a5aa51b5 (diff)
downloadscummvm-rg350-ce3d1e1a7d9ec9860d3fc42d8127a1634051d950.tar.gz
scummvm-rg350-ce3d1e1a7d9ec9860d3fc42d8127a1634051d950.tar.bz2
scummvm-rg350-ce3d1e1a7d9ec9860d3fc42d8127a1634051d950.zip
Merged revisions 33632-33633,33635,33637,33639-33640,33642-33645,33648,33654-33655,33664,33667-33670,33673-33674,33678,33682,33686-33691,33693,33696,33698,33700,33703,33708,33710,33712-33714,33716 via svnmerge from
https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/trunk svn-id: r33720
Diffstat (limited to 'engines/scumm/dialogs.cpp')
-rw-r--r--engines/scumm/dialogs.cpp43
1 files changed, 16 insertions, 27 deletions
diff --git a/engines/scumm/dialogs.cpp b/engines/scumm/dialogs.cpp
index cb9113fe65..b590bba65e 100644
--- a/engines/scumm/dialogs.cpp
+++ b/engines/scumm/dialogs.cpp
@@ -364,37 +364,32 @@ void SaveLoadChooser::reflowLayout() {
void SaveLoadChooser::updateInfos(bool redraw) {
int selItem = _list->getSelected();
- Graphics::Surface *thumb;
- thumb = _vm->loadThumbnailFromSlot(_saveMode ? selItem + 1 : selItem);
+ Graphics::Surface *thumb = 0;
+ if (selItem >= 0 && !_list->getSelectedString().empty())
+ thumb = _vm->loadThumbnailFromSlot(_saveMode ? selItem + 1 : selItem);
if (thumb) {
_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 (_vm->loadInfosFromSlot(_saveMode ? selItem + 1 : selItem, &infos)) {
+ if (selItem >= 0 && !_list->getSelectedString().empty()
+ && _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;
@@ -403,23 +398,17 @@ void SaveLoadChooser::updateInfos(bool redraw) {
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();
-
- snprintf(buffer, 32, "No time saved");
- _time->setLabel(buffer);
- if (redraw)
- _time->draw();
+ _date->setLabel("No date saved");
+ _time->setLabel("No time saved");
+ _playtime->setLabel("No playtime saved");
+ }
- snprintf(buffer, 32, "No playtime saved");
- _playtime->setLabel(buffer);
- if (redraw)
- _playtime->draw();
+ if (redraw) {
+ _gfxWidget->draw();
+ _date->draw();
+ _time->draw();
+ _playtime->draw();
}
}