From c25c406c00175155f635aa1e1d37adb5e37cdb4c Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 14 Jul 2008 19:14:26 +0000 Subject: cleanup (and test for Marwan's branch.... ;) svn-id: r33061 --- engines/scumm/detection.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/scumm') diff --git a/engines/scumm/detection.cpp b/engines/scumm/detection.cpp index 753ad45212..68d3010199 100644 --- a/engines/scumm/detection.cpp +++ b/engines/scumm/detection.cpp @@ -949,7 +949,7 @@ SaveStateList ScummMetaEngine::listSaves(const char *target) const { sort(filenames.begin(), filenames.end()); // Sort (hopefully ensuring we are sorted numerically..) SaveStateList saveList; - for (Common::StringList::const_iterator file = filenames.begin(); file != filenames.end(); file++) { + for (Common::StringList::const_iterator file = filenames.begin(); file != filenames.end(); ++file) { // Obtain the last 2 digits of the filename, since they correspond to the save slot int slotNum = atoi(file->c_str() + file->size() - 2); -- cgit v1.2.3 From ff5f3730c57a81816e3bc2e3365c4fc30701ca1f Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Mon, 14 Jul 2008 21:00:39 +0000 Subject: Don't draw scumm saveload dialog while reflowing layout, as that would use uninitialized values svn-id: r33063 --- engines/scumm/dialogs.cpp | 33 +++++++++++++++++++++++---------- engines/scumm/dialogs.h | 2 +- 2 files changed, 24 insertions(+), 11 deletions(-) (limited to 'engines/scumm') diff --git a/engines/scumm/dialogs.cpp b/engines/scumm/dialogs.cpp index 6d1cf1bbd8..89532b8961 100644 --- a/engines/scumm/dialogs.cpp +++ b/engines/scumm/dialogs.cpp @@ -31,6 +31,8 @@ #include "graphics/scaler.h" +#include "valgrind/memcheck.h" + #ifdef __DS__ #include "scummhelp.h" #endif @@ -297,7 +299,7 @@ void SaveLoadChooser::handleCommand(CommandSender *sender, uint32 cmd, uint32 da break; case GUI::kListSelectionChangedCmd: { if (_gfxWidget) { - updateInfos(); + updateInfos(true); } if (_saveMode) { @@ -326,6 +328,10 @@ void SaveLoadChooser::reflowLayout() { _container->resize(thumbX - hPad, thumbY - vPad, kThumbnailWidth + hPad * 2, thumbH + vPad * 2 + kLineHeight * 4); + VALGRIND_CHECK_VALUE_IS_DEFINED(thumbX); + VALGRIND_CHECK_VALUE_IS_DEFINED(thumbY); + VALGRIND_CHECK_VALUE_IS_DEFINED(thumbH); + // Add the thumbnail display _gfxWidget->resize(thumbX, thumbY, kThumbnailWidth, thumbH); @@ -350,7 +356,7 @@ void SaveLoadChooser::reflowLayout() { _fillR = g_gui.evaluator()->getVar("scummsaveload_thumbnail.fillR"); _fillG = g_gui.evaluator()->getVar("scummsaveload_thumbnail.fillG"); _fillB = g_gui.evaluator()->getVar("scummsaveload_thumbnail.fillB"); - updateInfos(); + updateInfos(false); } else { _container->setFlags(GUI::WIDGET_INVISIBLE); _gfxWidget->setFlags(GUI::WIDGET_INVISIBLE); @@ -362,7 +368,7 @@ void SaveLoadChooser::reflowLayout() { Dialog::reflowLayout(); } -void SaveLoadChooser::updateInfos() { +void SaveLoadChooser::updateInfos(bool draw) { int selItem = _list->getSelected(); Graphics::Surface *thumb; thumb = _vm->loadThumbnailFromSlot(_saveMode ? selItem + 1 : selItem); @@ -376,7 +382,8 @@ void SaveLoadChooser::updateInfos() { } delete thumb; - _gfxWidget->draw(); + if (draw) + _gfxWidget->draw(); InfoStuff infos; memset(&infos, 0, sizeof(InfoStuff)); @@ -386,12 +393,14 @@ void SaveLoadChooser::updateInfos() { (infos.date >> 24) & 0xFF, (infos.date >> 16) & 0xFF, infos.date & 0xFFFF); _date->setLabel(buffer); - _date->draw(); + if (draw) + _date->draw(); snprintf(buffer, 32, "Time: %.2d:%.2d", (infos.time >> 8) & 0xFF, infos.time & 0xFF); _time->setLabel(buffer); - _time->draw(); + if (draw) + _time->draw(); int minutes = infos.playtime / 60; int hours = minutes / 60; @@ -400,19 +409,23 @@ void SaveLoadChooser::updateInfos() { snprintf(buffer, 32, "Playtime: %.2d:%.2d", hours & 0xFF, minutes & 0xFF); _playtime->setLabel(buffer); - _playtime->draw(); + if (draw) + _playtime->draw(); } else { snprintf(buffer, 32, "No date saved"); _date->setLabel(buffer); - _date->draw(); + if (draw) + _date->draw(); snprintf(buffer, 32, "No time saved"); _time->setLabel(buffer); - _time->draw(); + if (draw) + _time->draw(); snprintf(buffer, 32, "No playtime saved"); _playtime->setLabel(buffer); - _playtime->draw(); + if (draw) + _playtime->draw(); } } diff --git a/engines/scumm/dialogs.h b/engines/scumm/dialogs.h index 7c99a0ebcc..730952676c 100644 --- a/engines/scumm/dialogs.h +++ b/engines/scumm/dialogs.h @@ -69,7 +69,7 @@ protected: uint8 _fillR, _fillG, _fillB; - void updateInfos(); + void updateInfos(bool draw); public: SaveLoadChooser(const String &title, const String &buttonLabel, bool saveMode, ScummEngine *engine); ~SaveLoadChooser(); -- cgit v1.2.3 From ba4ba85124d5cffdd75093abb6759f7588280f06 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Mon, 14 Jul 2008 21:04:42 +0000 Subject: remove accidentally committed debugging code; fix shadowing warning svn-id: r33064 --- engines/scumm/dialogs.cpp | 22 ++++++++-------------- engines/scumm/dialogs.h | 2 +- 2 files changed, 9 insertions(+), 15 deletions(-) (limited to 'engines/scumm') diff --git a/engines/scumm/dialogs.cpp b/engines/scumm/dialogs.cpp index 89532b8961..e4e2b2b620 100644 --- a/engines/scumm/dialogs.cpp +++ b/engines/scumm/dialogs.cpp @@ -31,8 +31,6 @@ #include "graphics/scaler.h" -#include "valgrind/memcheck.h" - #ifdef __DS__ #include "scummhelp.h" #endif @@ -328,10 +326,6 @@ void SaveLoadChooser::reflowLayout() { _container->resize(thumbX - hPad, thumbY - vPad, kThumbnailWidth + hPad * 2, thumbH + vPad * 2 + kLineHeight * 4); - VALGRIND_CHECK_VALUE_IS_DEFINED(thumbX); - VALGRIND_CHECK_VALUE_IS_DEFINED(thumbY); - VALGRIND_CHECK_VALUE_IS_DEFINED(thumbH); - // Add the thumbnail display _gfxWidget->resize(thumbX, thumbY, kThumbnailWidth, thumbH); @@ -368,7 +362,7 @@ void SaveLoadChooser::reflowLayout() { Dialog::reflowLayout(); } -void SaveLoadChooser::updateInfos(bool draw) { +void SaveLoadChooser::updateInfos(bool redraw) { int selItem = _list->getSelected(); Graphics::Surface *thumb; thumb = _vm->loadThumbnailFromSlot(_saveMode ? selItem + 1 : selItem); @@ -382,7 +376,7 @@ void SaveLoadChooser::updateInfos(bool draw) { } delete thumb; - if (draw) + if (redraw) _gfxWidget->draw(); InfoStuff infos; @@ -393,13 +387,13 @@ void SaveLoadChooser::updateInfos(bool draw) { (infos.date >> 24) & 0xFF, (infos.date >> 16) & 0xFF, infos.date & 0xFFFF); _date->setLabel(buffer); - if (draw) + if (redraw) _date->draw(); snprintf(buffer, 32, "Time: %.2d:%.2d", (infos.time >> 8) & 0xFF, infos.time & 0xFF); _time->setLabel(buffer); - if (draw) + if (redraw) _time->draw(); int minutes = infos.playtime / 60; @@ -409,22 +403,22 @@ void SaveLoadChooser::updateInfos(bool draw) { snprintf(buffer, 32, "Playtime: %.2d:%.2d", hours & 0xFF, minutes & 0xFF); _playtime->setLabel(buffer); - if (draw) + if (redraw) _playtime->draw(); } else { snprintf(buffer, 32, "No date saved"); _date->setLabel(buffer); - if (draw) + if (redraw) _date->draw(); snprintf(buffer, 32, "No time saved"); _time->setLabel(buffer); - if (draw) + if (redraw) _time->draw(); snprintf(buffer, 32, "No playtime saved"); _playtime->setLabel(buffer); - if (draw) + if (redraw) _playtime->draw(); } } diff --git a/engines/scumm/dialogs.h b/engines/scumm/dialogs.h index 730952676c..0d04d8faea 100644 --- a/engines/scumm/dialogs.h +++ b/engines/scumm/dialogs.h @@ -69,7 +69,7 @@ protected: uint8 _fillR, _fillG, _fillB; - void updateInfos(bool draw); + void updateInfos(bool redraw); public: SaveLoadChooser(const String &title, const String &buttonLabel, bool saveMode, ScummEngine *engine); ~SaveLoadChooser(); -- cgit v1.2.3 From a49a3c6aaa31e3a59c0fa2fec87f82764e6c2bc2 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sun, 20 Jul 2008 16:27:12 +0000 Subject: cleanup svn-id: r33135 --- engines/scumm/imuse_digi/dimuse_sndmgr.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'engines/scumm') diff --git a/engines/scumm/imuse_digi/dimuse_sndmgr.cpp b/engines/scumm/imuse_digi/dimuse_sndmgr.cpp index 1511b9aefc..b18b0ba70f 100644 --- a/engines/scumm/imuse_digi/dimuse_sndmgr.cpp +++ b/engines/scumm/imuse_digi/dimuse_sndmgr.cpp @@ -102,10 +102,10 @@ void ImuseDigiSndMgr::prepareSoundFromRMAP(Common::File *file, SoundDesc *sound, int32 version = file->readUint32BE(); if (version != 3) { if (version == 2) { - warning("ImuseDigiSndMgr::prepareSoundFromRMAP: Wrong version of compressed *.bun file, expected 3, but it's 2."); - warning("Suggested to recompress with latest tool from daily builds."); + warning("ImuseDigiSndMgr::prepareSoundFromRMAP: Wrong version of compressed *.bun file, expected 3, but it's 2"); + warning("Suggested to recompress with latest tool from daily builds"); } else - error("ImuseDigiSndMgr::prepareSoundFromRMAP: Wrong version number, expected 3, but it's: %d.", version); + error("ImuseDigiSndMgr::prepareSoundFromRMAP: Wrong version number, expected 3, but it's: %d", version); } sound->bits = file->readUint32BE(); sound->freq = file->readUint32BE(); -- cgit v1.2.3