aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/scicore/decompress11.cpp
diff options
context:
space:
mode:
authorMax Horn2009-03-01 22:03:37 +0000
committerMax Horn2009-03-01 22:03:37 +0000
commit4f2f82adc2d9ce83407d2decf2fc2f8526d01b1c (patch)
tree0fa819669b272b690651125db9c0a3ad1d531795 /engines/sci/scicore/decompress11.cpp
parentf509f65023d79e7f609a683c2614f9623552dcb7 (diff)
downloadscummvm-rg350-4f2f82adc2d9ce83407d2decf2fc2f8526d01b1c.tar.gz
scummvm-rg350-4f2f82adc2d9ce83407d2decf2fc2f8526d01b1c.tar.bz2
scummvm-rg350-4f2f82adc2d9ce83407d2decf2fc2f8526d01b1c.zip
SCI: Unified some of the decompression funcs (they share so much code, would be nice to reduce the code duplication)
svn-id: r39057
Diffstat (limited to 'engines/sci/scicore/decompress11.cpp')
-rw-r--r--engines/sci/scicore/decompress11.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/engines/sci/scicore/decompress11.cpp b/engines/sci/scicore/decompress11.cpp
index cabbb5a50d..d1b7cd1f73 100644
--- a/engines/sci/scicore/decompress11.cpp
+++ b/engines/sci/scicore/decompress11.cpp
@@ -32,8 +32,6 @@
namespace Sci {
-void decryptinit3();
-int decrypt3(uint8* dest, uint8* src, int length, int complength);
int decrypt4(uint8* dest, uint8* src, int length, int complength);
int decompress11(Resource *result, Common::ReadStream &stream, int sci_version) {
@@ -48,6 +46,7 @@ int decompress11(Resource *result, Common::ReadStream &stream, int sci_version)
uint16 type = result->id & 0x7f;
if (type > kResourceTypeInvalid)
return SCI_ERROR_DECOMPRESSION_INSANE;
+
result->type = (ResourceType)type;
result->number = stream.readUint16LE();
@@ -72,8 +71,8 @@ int decompress11(Resource *result, Common::ReadStream &stream, int sci_version)
return SCI_ERROR_EMPTY_OBJECT;
}
- buffer = (uint8*)sci_malloc(compressedLength);
- result->data = (unsigned char*)sci_malloc(result->size);
+ buffer = (uint8 *)sci_malloc(compressedLength);
+ result->data = (unsigned char *)sci_malloc(result->size);
if (stream.read(buffer, compressedLength) != compressedLength) {
free(result->data);
@@ -135,7 +134,7 @@ int decompress11(Resource *result, Common::ReadStream &stream, int sci_version)
result->number, getResourceTypeSuffix(result->type),
compressionMethod);
free(result->data);
- result->data = NULL; // So that we know that it didn't work
+ result->data = 0; // So that we know that it didn't work
result->status = SCI_STATUS_NOMALLOC;
free(buffer);
return SCI_ERROR_UNKNOWN_COMPRESSION;