aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippos Karapetis2009-01-17 22:29:55 +0000
committerFilippos Karapetis2009-01-17 22:29:55 +0000
commitc56faf3216ceab89d9bbe96c949e8af569d2231d (patch)
tree4a42477d38e62c2b6bb12b870c593cfc2e74027b
parent56f75b4c41b9fbd8736477ac28a6004e6b4a5014 (diff)
downloadscummvm-rg350-c56faf3216ceab89d9bbe96c949e8af569d2231d.tar.gz
scummvm-rg350-c56faf3216ceab89d9bbe96c949e8af569d2231d.tar.bz2
scummvm-rg350-c56faf3216ceab89d9bbe96c949e8af569d2231d.zip
Since users need to rename the sound and index files in DW2, throw nice GUI error messages when these files are not found before dying with an error
svn-id: r35886
-rw-r--r--engines/tinsel/sound.cpp18
-rw-r--r--engines/tinsel/strres.cpp10
2 files changed, 25 insertions, 3 deletions
diff --git a/engines/tinsel/sound.cpp b/engines/tinsel/sound.cpp
index fef9a0f858..3a03fea6ef 100644
--- a/engines/tinsel/sound.cpp
+++ b/engines/tinsel/sound.cpp
@@ -41,6 +41,8 @@
#include "sound/mixer.h"
#include "sound/adpcm.h"
+#include "gui/message.h"
+
namespace Tinsel {
extern LANGUAGE sampleLanguage;
@@ -439,12 +441,24 @@ void SoundManager::openSampleFiles(void) {
// convert file size to size in DWORDs
_sampleIndexLen /= sizeof(uint32);
- } else
+ } else {
+ char buf[50];
+ sprintf(buf, CANNOT_FIND_FILE, _vm->getSampleIndex(sampleLanguage));
+ GUI::MessageDialog dialog(buf, "OK");
+ dialog.runModal();
+
error(CANNOT_FIND_FILE, _vm->getSampleIndex(sampleLanguage));
+ }
// open sample file in binary mode
- if (!_sampleStream.open(_vm->getSampleFile(sampleLanguage)))
+ if (!_sampleStream.open(_vm->getSampleFile(sampleLanguage))) {
+ char buf[50];
+ sprintf(buf, CANNOT_FIND_FILE, _vm->getSampleFile(sampleLanguage));
+ GUI::MessageDialog dialog(buf, "OK");
+ dialog.runModal();
+
error(CANNOT_FIND_FILE, _vm->getSampleFile(sampleLanguage));
+ }
/*
// gen length of the largest sample
diff --git a/engines/tinsel/strres.cpp b/engines/tinsel/strres.cpp
index 2d963ae8bb..60ac8cdb2a 100644
--- a/engines/tinsel/strres.cpp
+++ b/engines/tinsel/strres.cpp
@@ -30,6 +30,8 @@
#include "common/file.h"
#include "common/endian.h"
+#include "gui/message.h"
+
namespace Tinsel {
#ifdef DEBUG
@@ -94,8 +96,14 @@ void ChangeLanguage(LANGUAGE newLang) {
// isn't English, try falling back on opening 'english.txt' - some foreign
// language versions reused it rather than their proper filename
if (!f.open(_vm->getTextFile(newLang))) {
- if ((newLang == TXT_ENGLISH) || !f.open(_vm->getTextFile(TXT_ENGLISH)))
+ if ((newLang == TXT_ENGLISH) || !f.open(_vm->getTextFile(TXT_ENGLISH))) {
+ char buf[50];
+ sprintf(buf, CANNOT_FIND_FILE, _vm->getTextFile(newLang));
+ GUI::MessageDialog dialog(buf, "OK");
+ dialog.runModal();
+
error(CANNOT_FIND_FILE, _vm->getTextFile(newLang));
+ }
}
// Check whether the file is compressed or not - for compressed files the