aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/scicore/decompress11.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/decompress11.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/decompress11.cpp')
-rw-r--r--engines/sci/scicore/decompress11.cpp17
1 files changed, 5 insertions, 12 deletions
diff --git a/engines/sci/scicore/decompress11.cpp b/engines/sci/scicore/decompress11.cpp
index aff87c9fdf..cabbb5a50d 100644
--- a/engines/sci/scicore/decompress11.cpp
+++ b/engines/sci/scicore/decompress11.cpp
@@ -32,8 +32,6 @@
namespace Sci {
-#define DDEBUG if (0) printf
-
void decryptinit3();
int decrypt3(uint8* dest, uint8* src, int length, int complength);
int decrypt4(uint8* dest, uint8* src, int length, int complength);
@@ -43,8 +41,6 @@ int decompress11(Resource *result, Common::ReadStream &stream, int sci_version)
uint16 compressionMethod;
uint8 *buffer;
- DDEBUG("d1");
-
result->id = stream.readByte();
if (stream.err())
return SCI_ERROR_IO_ERROR;
@@ -90,18 +86,15 @@ int decompress11(Resource *result, Common::ReadStream &stream, int sci_version)
}
#ifdef _SCI_DECOMPRESS_DEBUG
- fprintf(stderr, "Resource %i.%s encrypted with method SCI1.1/%hi at %.2f%%"
- " ratio\n",
+ debug("Resource %i.%s encrypted with method SCI1.1/%hi at %.2f%% ratio",
result->number, getResourceTypeSuffix(result->type),
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
- DDEBUG("/%d[%d]", compressionMethod, result->size);
-
switch (compressionMethod) {
case 0: // no compression
if (result->size != compressedLength) {
@@ -130,7 +123,7 @@ int decompress11(Resource *result, Common::ReadStream &stream, int sci_version)
case 3:
case 4: // NYI
- fprintf(stderr, "Resource %d.%s: Warning: compression type #%d not yet implemented\n",
+ warning("Resource %d.%s: Warning: compression type #%d not yet implemented",
result->number, getResourceTypeSuffix(result->type), compressionMethod);
free(result->data);
result->data = NULL;
@@ -138,8 +131,8 @@ int decompress11(Resource *result, Common::ReadStream &stream, int sci_version)
break;
default:
- fprintf(stderr, "Resource %d.%s: Compression method SCI1/%hi not "
- "supported!\n", result->number, getResourceTypeSuffix(result->type),
+ warning("Resource %d.%s: Compression method SCI1/%hi not supported",
+ result->number, getResourceTypeSuffix(result->type),
compressionMethod);
free(result->data);
result->data = NULL; // So that we know that it didn't work