[Scummvm-cvs-logs] CVS: scummvm/sky rnc_deco.cpp,1.12,1.13
Max Horn
fingolfin at users.sourceforge.net
Thu Mar 6 08:56:06 CET 2003
- Previous 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
- Next message: [Scummvm-cvs-logs] CVS: scummvm/simon simon.h,1.47,1.48
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/scummvm/scummvm/sky
In directory sc8-pr-cvs1:/tmp/cvs-serv13979
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.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- rnc_deco.cpp 6 Mar 2003 16:33:29 -0000 1.12
+++ rnc_deco.cpp 6 Mar 2003 16:55:15 -0000 1.13
@@ -20,13 +20,11 @@
*/
#include <string.h>
+#include <stdio.h>
+#include <assert.h>
#include "common/scummsys.h"
#include "sky/rnc_deco.h"
-#define ROL(x, n) (((x) << (n)) | ((x) >> (16 - (n))))
-#define ROR(x, n) (((x) << (16 - (n))) | ((x) >> (n)))
-#define XCHG(a, b) (a ^=b, b ^= a, a ^= b)
-
//conditional flags
#define CHECKSUMS 1
#define PROTECTED 0
@@ -105,18 +103,16 @@
if (newBitCount < 0) {
newBitCount += amount;
- XCHG(newBitCount, amount);
- remBits = ROR((uint16)(((1 << amount) - 1) & newBitBuffh), amount);
- newBitBuffh >>= amount;
- newBitBuffl >>= amount;
+ remBits = (newBitBuffh << (16-newBitCount));
+ newBitBuffh >>= newBitCount;
+ newBitBuffl >>= newBitCount;
newBitBuffl |= remBits;
_srcPtr += 2;
newBitBuffh = READ_LE_UINT16(_srcPtr);
- XCHG(newBitCount, amount);
amount -= newBitCount;
newBitCount = 16 - amount;
}
- remBits = ROR((uint16)(((1 << amount) - 1) & newBitBuffh), amount);
+ remBits = (newBitBuffh << (16-amount));
_bitBuffh = newBitBuffh >> amount;
_bitBuffl = (newBitBuffl >> amount) | remBits;
_bitCount = (uint8)newBitCount;
@@ -256,18 +252,12 @@
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);
- _bitBuffl &= d;
- d &= a;
+ uint16 a = READ_LE_UINT16(_srcPtr);
+ uint16 b = READ_LE_UINT16(_srcPtr + 2);
- a = READ_LE_UINT16((_srcPtr + 2));
- b = (b << _bitCount);
- a = (a << _bitCount);
- a |= d;
- _bitBuffl |= b;
- _bitBuffh = a;
+ _bitBuffl &= ((1 << _bitCount) - 1);
+ _bitBuffl |= (a << _bitCount);
+ _bitBuffh = (a >> (16 - _bitCount)) | (b << _bitCount);
}
if (counts > 1) {
- Previous 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
- Next message: [Scummvm-cvs-logs] CVS: scummvm/simon simon.h,1.47,1.48
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Scummvm-git-logs
mailing list