aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorJohannes Schickel2006-07-08 12:23:44 +0000
committerJohannes Schickel2006-07-08 12:23:44 +0000
commit93e9dee0d1b56620005d5c1d7ef65eb34c7da962 (patch)
treedf0145f36795ab8442dcbaeeb1029889f2af257a /engines
parent5658e71f4d7c2245098316434db2f239871e9f05 (diff)
downloadscummvm-rg350-93e9dee0d1b56620005d5c1d7ef65eb34c7da962.tar.gz
scummvm-rg350-93e9dee0d1b56620005d5c1d7ef65eb34c7da962.tar.bz2
scummvm-rg350-93e9dee0d1b56620005d5c1d7ef65eb34c7da962.zip
Adds a message dialog if kyra.dat is missing which tells the user to download the kyra.dat file.
svn-id: r23421
Diffstat (limited to 'engines')
-rw-r--r--engines/kyra/kyra.cpp4
-rw-r--r--engines/kyra/resource.cpp17
-rw-r--r--engines/kyra/staticres.cpp3
3 files changed, 16 insertions, 8 deletions
diff --git a/engines/kyra/kyra.cpp b/engines/kyra/kyra.cpp
index 3472f1d66e..d2f699343d 100644
--- a/engines/kyra/kyra.cpp
+++ b/engines/kyra/kyra.cpp
@@ -177,12 +177,12 @@ int KyraEngine::init() {
}
_sound->setVolume(255);
- _res = new Resource(this);
- assert(_res);
_screen = new Screen(this, _system);
assert(_screen);
if (!_screen->init())
error("_screen->init() failed");
+ _res = new Resource(this);
+ assert(_res);
_sprites = new Sprites(this, _system);
assert(_sprites);
_seq = new SeqPlayer(this, _system);
diff --git a/engines/kyra/resource.cpp b/engines/kyra/resource.cpp
index 179489523f..167042a948 100644
--- a/engines/kyra/resource.cpp
+++ b/engines/kyra/resource.cpp
@@ -23,6 +23,9 @@
#include "common/stdafx.h"
#include "common/endian.h"
#include "common/file.h"
+
+#include "gui/message.h"
+
#include "kyra/resource.h"
#include "kyra/script.h"
#include "kyra/wsamovie.h"
@@ -118,10 +121,10 @@ Resource::Resource(KyraEngine *engine) {
if (_engine->game() == GI_KYRA1) {
/*if (_engine->features() & GF_AMIGA)
usedFilelist = kyra1AmigaFilelist;
- else*/ if (_engine->features() & GF_FLOPPY)
- usedFilelist = kyra1Filelist;
- else if (_engine->features() & GF_TALKIE)
- usedFilelist = kyra1CDFilelist;
+ else*/ if (_engine->features() & GF_FLOPPY)
+ usedFilelist = kyra1Filelist;
+ else if (_engine->features() & GF_TALKIE)
+ usedFilelist = kyra1CDFilelist;
} else if (_engine->game() == GI_KYRA2) {
// TODO: add kyra2 floppy file list
usedFilelist = kyra2CDFilelist;
@@ -132,6 +135,8 @@ Resource::Resource(KyraEngine *engine) {
// we're loading KYRA.DAT here too (but just for Kyrandia 1)
if (_engine->game() == GI_KYRA1) {
if (!loadPakFile("KYRA.DAT")) {
+ GUI::MessageDialog errorMsg("You're missing the 'KYRA.DAT' file, get it from the ScummVM website");
+ errorMsg.runModal();
error("couldn't open Kyrandia resource file ('KYRA.DAT') make sure you got one file for your version");
}
}
@@ -171,7 +176,9 @@ bool Resource::loadPakFile(const Common::String &filename) {
if (isInPakList(filename))
return true;
PAKFile *file = new PAKFile(filename.c_str());
- if (!file) {
+ if (!file)
+ return false;
+ if (!file->isValid()) {
warning("couldn't load file: '%s'", filename.c_str());
return false;
}
diff --git a/engines/kyra/staticres.cpp b/engines/kyra/staticres.cpp
index 05ead8216e..3485243459 100644
--- a/engines/kyra/staticres.cpp
+++ b/engines/kyra/staticres.cpp
@@ -149,7 +149,8 @@ bool StaticResource::init() {
int tempSize = 0;
uint8 *temp = getFile("INDEX", tempSize);
if (!temp) {
- error("no matching INDEX file found");
+ warning("no matching INDEX file found");
+ return false;
}
uint32 version = READ_BE_UINT32(temp);