[Scummvm-cvs-logs] CVS: scummvm/sky compact.cpp,1.40,1.41
Joost Peters
joostp at users.sourceforge.net
Thu Feb 2 04:54:07 CET 2006
Update of /cvsroot/scummvm/scummvm/sky
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25667/sky
Modified Files:
compact.cpp
Log Message:
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.
Index: compact.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/compact.cpp,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -d -r1.40 -r1.41
--- compact.cpp 18 Jan 2006 17:39:52 -0000 1.40
+++ compact.cpp 2 Feb 2006 12:53:42 -0000 1.41
@@ -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 @@
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**));
More information about the Scummvm-git-logs
mailing list