aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/scicore/decompress01.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sci/scicore/decompress01.cpp')
-rw-r--r--engines/sci/scicore/decompress01.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/engines/sci/scicore/decompress01.cpp b/engines/sci/scicore/decompress01.cpp
index e3219d3a5f..4fb450e9a7 100644
--- a/engines/sci/scicore/decompress01.cpp
+++ b/engines/sci/scicore/decompress01.cpp
@@ -25,6 +25,7 @@
/* Reads data from a resource file and stores the result in memory */
+#include "common/util.h"
#include "sci/include/sci_memory.h"
#include "sci/include/sciresource.h"
@@ -425,7 +426,7 @@ byte *view_reorder(byte *inbuffer, int dsize) {
for (l = 0;l < loopheaders;l++) {
if (lh_mask & lb) { /* The loop is _not_ present */
if (lh_last == -1) {
- fprintf(stderr, "Error: While reordering view: Loop not present, but can't re-use last loop!\n");
+ error("Error: While reordering view: Loop not present, but can't re-use last loop");
lh_last = 0;
}
putInt16(lh_ptr, lh_last);
@@ -459,7 +460,7 @@ byte *view_reorder(byte *inbuffer, int dsize) {
}
if (celindex < cel_total) {
- fprintf(stderr, "View decompression generated too few (%d / %d) headers!\n", celindex, cel_total);
+ error("View decompression generated too few (%d / %d) headers", celindex, cel_total);
return NULL;
}
@@ -546,12 +547,12 @@ int decompress01(resource_t *result, Common::ReadStream &stream, int sci_version
#ifdef _SCI_DECOMPRESS_DEBUG
- fprintf(stderr, "Resource %s.%03hi encrypted with method SCI01/%hi at %.2f%%"
+ error("Resource %s.%03hi encrypted with method SCI01/%hi at %.2f%%"
" ratio\n",
sci_resource_types[result->type], result->number, compressionMethod,
(result->size == 0) ? -1.0 :
(100.0 * compressedLength / result->size));
- fprintf(stderr, " compressedLength = 0x%hx, actualLength=0x%hx\n",
+ error(" compressedLength = 0x%hx, actualLength=0x%hx\n",
compressedLength, result->size);
#endif
@@ -619,8 +620,8 @@ int decompress01(resource_t *result, Common::ReadStream &stream, int sci_version
break;
default:
- fprintf(stderr, "Resource %s.%03hi: Compression method SCI1/%hi not "
- "supported!\n", sci_resource_types[result->type], result->number,
+ error("Resource %s.%03hi: Compression method SCI1/%hi not "
+ "supported", sci_resource_types[result->type], result->number,
compressionMethod);
free(result->data);
result->data = 0; /* So that we know that it didn't work */