diff options
author | Joost Peters | 2006-02-02 12:53:42 +0000 |
---|---|---|
committer | Joost Peters | 2006-02-02 12:53:42 +0000 |
commit | 5c7267b49ecccf6f7b8d9c507b311b3a23cf214b (patch) | |
tree | e0fb1bf00e1286700271f45d9a9533564655d8f2 /sky | |
parent | 64ec8a95cf419810cc31aa5d83a406c66b8c3367 (diff) | |
download | scummvm-rg350-5c7267b49ecccf6f7b8d9c507b311b3a23cf214b.tar.gz scummvm-rg350-5c7267b49ecccf6f7b8d9c507b311b3a23cf214b.tar.bz2 scummvm-rg350-5c7267b49ecccf6f7b8d9c507b311b3a23cf214b.zip |
Because incomplete SKY.CPT files are apparently a common problem due to some problems with the scummvm.org server or connection, check if it's the expected size.
svn-id: r20349
Diffstat (limited to 'sky')
-rw-r--r-- | sky/compact.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sky/compact.cpp b/sky/compact.cpp index ab8414f00d..218dbd2fdb 100644 --- a/sky/compact.cpp +++ b/sky/compact.cpp @@ -27,6 +27,8 @@ namespace Sky { +#define SKY_CPT_SIZE 419427 + #define OFFS(type,item) (((long)(&((type*)0)->item))) #define MK32(type,item) OFFS(type, item),0,0,0 #define MK16(type,item) OFFS(type, item),0 @@ -130,6 +132,12 @@ SkyCompact::SkyCompact(void) { if (fileVersion != 0) error("unknown \"sky.cpt\" version"); + if (SKY_CPT_SIZE != _cptFile->size()) { + GUI::MessageDialog dialog("The \"sky.cpt\" file has an incorrect size.\nPlease (re)download it from www.scummvm.org", "OK", NULL); + dialog.runModal(); + error("Incorrect sky.cpt size (%d, expected: %d)", _cptFile->size(), SKY_CPT_SIZE); + } + // set the necessary data structs up... _numDataLists = _cptFile->readUint16LE(); _cptNames = (char***)malloc(_numDataLists * sizeof(char**)); |