[Scummvm-cvs-logs] SF.net SVN: scummvm:[40607] scummvm/trunk/engines/sci/scicore

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Fri May 15 15:52:24 CEST 2009


Revision: 40607
          http://scummvm.svn.sourceforge.net/scummvm/?rev=40607&view=rev
Author:   thebluegr
Date:     2009-05-15 13:52:22 +0000 (Fri, 15 May 2009)

Log Message:
-----------
Removed unused defines and merged several different compression errors

Modified Paths:
--------------
    scummvm/trunk/engines/sci/scicore/decompressor.cpp
    scummvm/trunk/engines/sci/scicore/resource.h

Modified: scummvm/trunk/engines/sci/scicore/decompressor.cpp
===================================================================
--- scummvm/trunk/engines/sci/scicore/decompressor.cpp	2009-05-15 12:46:53 UTC (rev 40606)
+++ scummvm/trunk/engines/sci/scicore/decompressor.cpp	2009-05-15 13:52:22 UTC (rev 40607)
@@ -199,7 +199,7 @@
 			if (token > 0xff) {
 				if (token >= _curtoken) {
 					warning("unpackLZW: Bad token %x", token);
-					return SCI_ERROR_DECOMPRESSION_INSANE;
+					return SCI_ERROR_DECOMPRESSION_ERROR;
 				} 
 				tokenlastlength = tokenlengthlist[token] + 1;
 				if (_dwWrote + tokenlastlength > _szUnpacked) {
@@ -231,7 +231,7 @@
 		}
 	}
 
-	return _dwWrote == _szUnpacked ? 0 : SCI_ERROR_DECOMPRESSION_INSANE;
+	return _dwWrote == _szUnpacked ? 0 : SCI_ERROR_DECOMPRESSION_ERROR;
 }
 
 int DecompressorLZW::unpackLZW1(Common::ReadStream *src, byte *dest, uint32 nPacked,
@@ -310,7 +310,7 @@
 			break;
 		}
 	}
-	return _dwWrote == _szUnpacked ? 0 : SCI_ERROR_DECOMPRESSION_INSANE;
+	return _dwWrote == _szUnpacked ? 0 : SCI_ERROR_DECOMPRESSION_ERROR;
 }
 
 #define PAL_SIZE 1284
@@ -853,12 +853,12 @@
 
 			if (val_length + _dwWrote > _szUnpacked) {
 				warning("DCL-INFLATE Error: Write out of bounds while copying %d bytes", val_length);
-				return SCI_ERROR_DECOMPRESSION_OVERFLOW;
+				return SCI_ERROR_DECOMPRESSION_ERROR;
 			}
 
 			if (_dwWrote < val_distance) {
 				warning("DCL-INFLATE Error: Attempt to copy from before beginning of input stream");
-				return SCI_ERROR_DECOMPRESSION_INSANE;
+				return SCI_ERROR_DECOMPRESSION_ERROR;
 			}
 
 			while (val_length) {
@@ -885,7 +885,7 @@
 		}
 	}
 
-	return _dwWrote == _szUnpacked ? 0 : SCI_ERROR_DECOMPRESSION_INSANE;
+	return _dwWrote == _szUnpacked ? 0 : SCI_ERROR_DECOMPRESSION_ERROR;
 }
 
 #ifdef ENABLE_SCI32
@@ -910,21 +910,21 @@
 					break;
 				if (!(clen = getCompLen())) {
 					warning("lzsDecomp: length mismatch");
-					return SCI_ERROR_DECOMPRESSION_INSANE;
+					return SCI_ERROR_DECOMPRESSION_ERROR;
 				}
 				copyComp(offs, clen);
 			} else { // Eleven bit offset follows 
 				offs = getBitsMSB(11);
 				if (!(clen = getCompLen())) {
 					warning("lzsDecomp: length mismatch");
-					return SCI_ERROR_DECOMPRESSION_INSANE;
+					return SCI_ERROR_DECOMPRESSION_ERROR;
 				}
 				copyComp(offs, clen);
 			}
 		} else // Literal byte follows
 			putByte(getByteMSB());
 	} // end of while ()
-	return _dwWrote == _szUnpacked ? 0 : SCI_ERROR_DECOMPRESSION_INSANE;
+	return _dwWrote == _szUnpacked ? 0 : SCI_ERROR_DECOMPRESSION_ERROR;
 }
 
 uint16 DecompressorLZS::getCompLen() {

Modified: scummvm/trunk/engines/sci/scicore/resource.h
===================================================================
--- scummvm/trunk/engines/sci/scicore/resource.h	2009-05-15 12:46:53 UTC (rev 40606)
+++ scummvm/trunk/engines/sci/scicore/resource.h	2009-05-15 13:52:22 UTC (rev 40607)
@@ -52,26 +52,19 @@
 
 /*** INITIALIZATION RESULT TYPES ***/
 #define SCI_ERROR_IO_ERROR 1
-#define SCI_ERROR_EMPTY_OBJECT 2
-#define SCI_ERROR_INVALID_RESMAP_ENTRY 3
+#define SCI_ERROR_INVALID_RESMAP_ENTRY 2
 /* Invalid resource.map entry */
-#define SCI_ERROR_RESMAP_NOT_FOUND 4
-#define SCI_ERROR_NO_RESOURCE_FILES_FOUND 5
+#define SCI_ERROR_RESMAP_NOT_FOUND 3
+#define SCI_ERROR_NO_RESOURCE_FILES_FOUND 4
 /* No resource at all was found */
-#define SCI_ERROR_UNKNOWN_COMPRESSION 6
-#define SCI_ERROR_DECOMPRESSION_OVERFLOW 7
-/* decompression failed: Buffer overflow (wrong SCI version?)  */
-#define SCI_ERROR_DECOMPRESSION_INSANE 8
+#define SCI_ERROR_UNKNOWN_COMPRESSION 5
+#define SCI_ERROR_DECOMPRESSION_ERROR 6
 /* sanity checks failed during decompression */
-#define SCI_ERROR_RESOURCE_TOO_BIG 9
+#define SCI_ERROR_RESOURCE_TOO_BIG 8
 /* Resource size exceeds SCI_MAX_RESOURCE_SIZE */
-#define SCI_ERROR_UNSUPPORTED_VERSION 10
 
-#define SCI_ERROR_CRITICAL SCI_ERROR_NO_RESOURCE_FILES_FOUND
 /* the first critical error number */
 
-#define SCI_VERSION_LAST SCI_VERSION_1_LATE /* The last supported SCI version */
-
 #define SCI_VERSION_1 SCI_VERSION_1_EARLY
 
 #define MAX_OPENED_VOLUMES 5 // Max number of simultaneously opened volumes


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list