From fbcba1a573eff399a1a7b41ff87785c0b9f528d5 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Thu, 3 Jan 2008 14:53:18 +0000 Subject: - got rid of hardcoding "KYRA.DAT" in all places, where it's used - now using "kyra.dat" rather than "KYRA.DAT" svn-id: r30200 --- engines/kyra/resource.cpp | 9 +++++---- engines/kyra/resource.h | 2 ++ engines/kyra/staticres.cpp | 6 ++++-- 3 files changed, 11 insertions(+), 6 deletions(-) (limited to 'engines/kyra') diff --git a/engines/kyra/resource.cpp b/engines/kyra/resource.cpp index 19cd95e6af..c043e47289 100644 --- a/engines/kyra/resource.cpp +++ b/engines/kyra/resource.cpp @@ -69,10 +69,11 @@ bool Resource::reset() { if (_vm->game() == GI_KYRA1) { // we're loading KYRA.DAT here too (but just for Kyrandia 1) - if (!loadPakFile("KYRA.DAT") || !StaticResource::checkKyraDat()) { - GUI::MessageDialog errorMsg("You're missing the 'KYRA.DAT' file or it got corrupted, (re)get it from the ScummVM website"); + if (!loadPakFile(StaticResource::_staticDataFile) || !StaticResource::checkKyraDat()) { + Common::String errorMessage = "You're missing the '" + StaticResource::_staticDataFile + "' file or it got corrupted, (re)get it from the ScummVM website"; + GUI::MessageDialog errorMsg(errorMessage); errorMsg.runModal(); - error("You're missing the 'KYRA.DAT' file or it got corrupted, (re)get it from the ScummVM website"); + error(errorMessage.c_str()); } // We only need kyra.dat for the demo. @@ -144,7 +145,7 @@ bool Resource::loadPakFile(const Common::String &filename) { return true; } - const bool isKyraDat = filename.equalsIgnoreCase("KYRA.DAT"); + const bool isKyraDat = filename.equalsIgnoreCase(StaticResource::_staticDataFile); uint32 size = 0; Common::File handle; diff --git a/engines/kyra/resource.h b/engines/kyra/resource.h index c86aeeb627..ff2e46a40a 100644 --- a/engines/kyra/resource.h +++ b/engines/kyra/resource.h @@ -226,6 +226,8 @@ struct Room; class StaticResource { public: + static const Common::String _staticDataFile; + StaticResource(KyraEngine *vm) : _vm(vm), _resList(), _fileLoader(0), _builtIn(0), _filenameTable(0) {} ~StaticResource() { deinit(); } diff --git a/engines/kyra/staticres.cpp b/engines/kyra/staticres.cpp index b64f2f2b8e..1c1a17597c 100644 --- a/engines/kyra/staticres.cpp +++ b/engines/kyra/staticres.cpp @@ -39,7 +39,7 @@ namespace Kyra { bool StaticResource::checkKyraDat() { Common::File kyraDat; - if (!kyraDat.open("KYRA.DAT")) + if (!kyraDat.open(StaticResource::_staticDataFile)) return false; uint32 size = kyraDat.size() - 16; @@ -50,7 +50,7 @@ bool StaticResource::checkKyraDat() { kyraDat.close(); uint8 digestCalc[16]; - if (!Common::md5_file("KYRA.DAT", digestCalc, size)) + if (!Common::md5_file(StaticResource::_staticDataFile.c_str(), digestCalc, size)) return false; for (int i = 0; i < 16; ++i) @@ -854,6 +854,8 @@ void KyraEngine_v1::loadMainScreen(int page) { _screen->copyRegion(0, 0, 0, 0, 320, 200, page, 0); } +const Common::String StaticResource::_staticDataFile = "kyra.dat"; + const ScreenDim Screen::_screenDimTable[] = { { 0x00, 0x00, 0x28, 0xC8, 0x0F, 0x0C, 0x00, 0x00 }, { 0x08, 0x48, 0x18, 0x38, 0x0F, 0x0C, 0x00, 0x00 }, -- cgit v1.2.3