aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/scicore/decompress0.cpp
diff options
context:
space:
mode:
authorMax Horn2009-03-01 21:48:39 +0000
committerMax Horn2009-03-01 21:48:39 +0000
commit8022122bb921c5b04dbbb5a2675aa5a5538a4592 (patch)
tree9573144e13966fd8bdd01c69d6320a2b27b2a3ea /engines/sci/scicore/decompress0.cpp
parent81943a9f8ccec40fbed7326556dcd4c0b4e869a7 (diff)
downloadscummvm-rg350-8022122bb921c5b04dbbb5a2675aa5a5538a4592.tar.gz
scummvm-rg350-8022122bb921c5b04dbbb5a2675aa5a5538a4592.tar.bz2
scummvm-rg350-8022122bb921c5b04dbbb5a2675aa5a5538a4592.zip
SCI: Added kDebugLevelDclInflate; changed decompressors to *not* use fprintf or printf
svn-id: r39055
Diffstat (limited to 'engines/sci/scicore/decompress0.cpp')
-rw-r--r--engines/sci/scicore/decompress0.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/engines/sci/scicore/decompress0.cpp b/engines/sci/scicore/decompress0.cpp
index 1e9c263845..997f30ee87 100644
--- a/engines/sci/scicore/decompress0.cpp
+++ b/engines/sci/scicore/decompress0.cpp
@@ -102,7 +102,7 @@ int decrypt1(uint8 *dest, uint8 *src, int length, int complength) {
if (token > 0xff) {
if (token >= tokenctr) {
#ifdef _SCI_DECOMPRESS_DEBUG
- fprintf(stderr, "decrypt1: Bad token %x!\n", token);
+ warning("decrypt1: Bad token %x", token);
#endif
// Well this is really bad
// May be it should throw something like SCI_ERROR_DECOMPRESSION_INSANE
@@ -111,7 +111,7 @@ int decrypt1(uint8 *dest, uint8 *src, int length, int complength) {
if (destctr + tokenlastlength > length) {
#ifdef _SCI_DECOMPRESS_DEBUG
// For me this seems a normal situation, It's necessary to handle it
- printf("decrypt1: Trying to write beyond the end of array(len=%d, destctr=%d, tok_len=%d)!\n",
+ warning("decrypt1: Trying to write beyond the end of array(len=%d, destctr=%d, tok_len=%d)",
length, destctr, tokenlastlength);
#endif
i = 0;
@@ -128,7 +128,7 @@ int decrypt1(uint8 *dest, uint8 *src, int length, int complength) {
tokenlastlength = 1;
if (destctr >= length) {
#ifdef _SCI_DECOMPRESS_DEBUG
- printf("decrypt1: Try to write single byte beyond end of array!\n");
+ warning("decrypt1: Try to write single byte beyond end of array");
#endif
} else
dest[destctr++] = (byte)token;
@@ -280,12 +280,11 @@ int decompress0(Resource *result, Common::ReadStream &stream, int sci_version) {
#ifdef _SCI_DECOMPRESS_DEBUG
- fprintf(stderr, "Resource %s.%03hi encrypted with method %hi at %.2f%%"
- " ratio\n",
+ debug("Resource %s.%03hi encrypted with method %hi at %.2f%% ratio",
getResourceTypeName(result->type), result->number, compressionMethod,
(result->size == 0) ? -1.0 :
(100.0 * compressedLength / result->size));
- fprintf(stderr, " compressedLength = 0x%hx, actualLength=0x%hx\n",
+ debug(" compressedLength = 0x%hx, actualLength=0x%hx",
compressedLength, result->size);
#endif
@@ -325,8 +324,8 @@ int decompress0(Resource *result, Common::ReadStream &stream, int sci_version) {
break;
default:
- fprintf(stderr, "Resource %s.%03hi: Compression method %hi not "
- "supported!\n", getResourceTypeName(result->type), result->number,
+ warning("Resource %s.%03hi: Compression method %hi not supported",
+ getResourceTypeName(result->type), result->number,
compressionMethod);
free(result->data);
result->data = 0; // So that we know that it didn't work