[Scummvm-cvs-logs] CVS: scummvm/sky rnc_deco.cpp,1.11,1.12
Max Horn
fingolfin at users.sourceforge.net
Thu Mar 6 08:38:07 CET 2003
- Previous message: [Scummvm-cvs-logs] CVS: scummvm/sky rnc_deco.cpp,1.10,1.11
- Next message: [Scummvm-cvs-logs] CVS: scummvm/common config-file.cpp,1.11,1.12 engine.cpp,1.14,1.15 engine.h,1.15,1.16 file.cpp,1.23,1.24 gameDetector.cpp,1.80,1.81 gameDetector.h,1.29,1.30 list.h,1.3,1.4 main.cpp,1.19,1.20 map.h,1.6,1.7 scaler.cpp,1.7,1.8 scummsys.h,1.15,1.16 str.cpp,1.13,1.14 str.h,1.8,1.9 system.h,1.20,1.21 timer.cpp,1.5,1.6 util.cpp,1.7,1.8 util.h,1.10,1.11
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/scummvm/scummvm/sky
In directory sc8-pr-cvs1:/tmp/cvs-serv4242
Modified Files:
rnc_deco.cpp
Log Message:
more cleanup
Index: rnc_deco.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/rnc_deco.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- rnc_deco.cpp 6 Mar 2003 16:08:13 -0000 1.11
+++ rnc_deco.cpp 6 Mar 2003 16:33:29 -0000 1.12
@@ -248,13 +248,14 @@
counts = inputBits(16);
- for (;;) {
- uint32 inputBytes = inputValue(_rawTable);
+ do {
+ uint32 inputLength = inputValue(_rawTable);
+ uint32 inputOffset;
- if (inputBytes) {
- memcpy(_dstPtr, _srcPtr, inputBytes); //memcpy is allowed here
- _dstPtr += inputBytes;
- _srcPtr += inputBytes;
+ if (inputLength) {
+ memcpy(_dstPtr, _srcPtr, inputLength); //memcpy is allowed here
+ _dstPtr += inputLength;
+ _srcPtr += inputLength;
uint16 b = READ_LE_UINT16(_srcPtr);
uint16 a = ROL(b, _bitCount);
uint16 d = ((1 << _bitCount) - 1);
@@ -269,22 +270,16 @@
_bitBuffh = a;
}
- if (--counts) {
- uint32 inputOffset = inputValue(_posTable) + 1;
- uint32 inputLength = inputValue(_lenTable) + MIN_LENGTH;
-
- inputHigh = _srcPtr;
- _srcPtr = (_dstPtr-inputOffset);
-
- //Don't use memcpy here! because input and output overlap
+ if (counts > 1) {
+ inputOffset = inputValue(_posTable) + 1;
+ inputLength = inputValue(_lenTable) + MIN_LENGTH;
+
+ // Don't use memcpy here! because input and output overlap.
+ uint8 *tmpPtr = (_dstPtr-inputOffset);
while (inputLength--)
- *_dstPtr++ = *_srcPtr++;
-
- _srcPtr = inputHigh;
- } else
- break;
-
- }
+ *_dstPtr++ = *tmpPtr++;
+ }
+ } while (--counts);
} while (--blocks);
if (CHECKSUMS) {
- Previous message: [Scummvm-cvs-logs] CVS: scummvm/sky rnc_deco.cpp,1.10,1.11
- Next message: [Scummvm-cvs-logs] CVS: scummvm/common config-file.cpp,1.11,1.12 engine.cpp,1.14,1.15 engine.h,1.15,1.16 file.cpp,1.23,1.24 gameDetector.cpp,1.80,1.81 gameDetector.h,1.29,1.30 list.h,1.3,1.4 main.cpp,1.19,1.20 map.h,1.6,1.7 scaler.cpp,1.7,1.8 scummsys.h,1.15,1.16 str.cpp,1.13,1.14 str.h,1.8,1.9 system.h,1.20,1.21 timer.cpp,1.5,1.6 util.cpp,1.7,1.8 util.h,1.10,1.11
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Scummvm-git-logs
mailing list