aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/scicore/decompress0.cpp
diff options
context:
space:
mode:
authorFilippos Karapetis2009-03-06 13:09:10 +0000
committerFilippos Karapetis2009-03-06 13:09:10 +0000
commitc4a09af0afd5a4599a45366a47a8a5f90f20f067 (patch)
tree57a07dc5eca5c021d65005adb75d77f85077c465 /engines/sci/scicore/decompress0.cpp
parentb8a2b38e4168c34813aa8ab6f3b8d371e799fbad (diff)
downloadscummvm-rg350-c4a09af0afd5a4599a45366a47a8a5f90f20f067.tar.gz
scummvm-rg350-c4a09af0afd5a4599a45366a47a8a5f90f20f067.tar.bz2
scummvm-rg350-c4a09af0afd5a4599a45366a47a8a5f90f20f067.zip
Cleanup and unification. Merged decryptinit3() inside decrypt3()
svn-id: r39155
Diffstat (limited to 'engines/sci/scicore/decompress0.cpp')
-rw-r--r--engines/sci/scicore/decompress0.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/engines/sci/scicore/decompress0.cpp b/engines/sci/scicore/decompress0.cpp
index 36129e896f..6aaa6fc063 100644
--- a/engines/sci/scicore/decompress0.cpp
+++ b/engines/sci/scicore/decompress0.cpp
@@ -238,19 +238,20 @@ int decompress0(Resource *result, Common::ReadStream &stream, int sci_version) {
uint16 compressedLength;
uint16 compressionMethod;
uint8 *buffer;
+ uint8 type;
result->id = stream.readUint16LE();
if (stream.err())
return SCI_ERROR_IO_ERROR;
result->number = result->id & 0x07ff;
- uint8 type = result->id >> 11;
+ type = result->id >> 11;
+
+ result->type = (ResourceType)type;
if ((result->number > sci_max_resource_nr[sci_version]) || (type > kResourceTypeInvalid))
return SCI_ERROR_DECOMPRESSION_INSANE;
- result->type = (ResourceType)type;
-
compressedLength = stream.readUint16LE();
result->size = stream.readUint16LE();
compressionMethod = stream.readUint16LE();
@@ -259,7 +260,6 @@ int decompress0(Resource *result, Common::ReadStream &stream, int sci_version) {
if (result->size > SCI_MAX_RESOURCE_SIZE)
return SCI_ERROR_RESOURCE_TOO_BIG;
- // With SCI0, this simply cannot happen.
if (compressedLength > 4)
compressedLength -= 4;