[Scummvm-cvs-logs] CVS: scummvm/scumm akos.cpp,1.63,1.64 akos.h,1.19,1.20 costume.cpp,1.48,1.49
Max Horn
fingolfin at users.sourceforge.net
Thu May 29 04:08:05 CEST 2003
Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1:/tmp/cvs-serv12566
Modified Files:
akos.cpp akos.h costume.cpp
Log Message:
merged all AKOS codec 1 decoders into one
Index: akos.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/akos.cpp,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -d -r1.63 -r1.64
--- akos.cpp 29 May 2003 10:46:06 -0000 1.63
+++ akos.cpp 29 May 2003 11:07:54 -0000 1.64
@@ -325,138 +325,6 @@
byte *dst;
byte len, maskbit;
uint y, color, height;
- const byte *scaleytab, *mask;
-
- y = v1.y;
- src = _srcptr;
- dst = v1.destptr;
- len = v1.replen;
- color = v1.repcolor;
- height = _height;
-
- scaleytab = &v1.scaletable[v1.scaleYindex];
- maskbit = revBitMask[v1.x & 7];
- mask = v1.mask_ptr + (v1.x >> 3);
-
- if (len)
- goto StartPos;
-
- do {
- len = *src++;
- color = len >> v1.shr;
- len &= v1.mask;
- if (!len)
- len = *src++;
-
- do {
- if (*scaleytab++ < _scaleY) {
- if (color && y < _outheight
- && (!v1.mask_ptr || !((mask[0] | mask[v1.imgbufoffs]) & maskbit))) {
- *dst = palette[color];
- }
- mask += _numStrips;
- dst += _outwidth;
- y++;
- }
- if (!--height) {
- if (!--v1.skip_width)
- return;
- height = _height;
- y = v1.y;
-
- scaleytab = &v1.scaletable[v1.scaleYindex];
-
- if (v1.scaletable[v1.scaleXindex] < _scaleX) {
- v1.x += v1.scaleXstep;
- if (v1.x < 0 || v1.x >= _vm->_screenWidth)
- return;
- maskbit = revBitMask[v1.x & 7];
- v1.destptr += v1.scaleXstep;
- }
- mask = v1.mask_ptr + (v1.x >> 3);
- v1.scaleXindex += v1.scaleXstep;
- dst = v1.destptr;
- }
- StartPos:;
- } while (--len);
- } while (1);
-}
-
-void AkosRenderer::codec1_spec1() {
- const byte *src;
- byte *dst;
- byte len, maskbit;
- uint y, color, height;
- byte pcolor;
- const byte *scaleytab, *mask;
-
- y = v1.y;
- src = _srcptr;
- dst = v1.destptr;
- len = v1.replen;
- color = v1.repcolor;
- height = _height;
-
- scaleytab = &v1.scaletable[v1.scaleYindex];
- maskbit = revBitMask[v1.x & 7];
- mask = v1.mask_ptr + (v1.x >> 3);
-
- if (len)
- goto StartPos;
-
- do {
- len = *src++;
- color = len >> v1.shr;
- len &= v1.mask;
- if (!len)
- len = *src++;
-
- do {
- if (*scaleytab++ < _scaleY) {
- if (color && y < _outheight
- && (!v1.mask_ptr || !((mask[0] | mask[v1.imgbufoffs]) & maskbit))) {
- pcolor = palette[color];
- if (pcolor == 13)
- pcolor = _shadow_table[*dst];
- *dst = pcolor;
- }
- mask += _numStrips;
- dst += _outwidth;
- y++;
- }
- if (!--height) {
- if (!--v1.skip_width)
- return;
- height = _height;
- y = v1.y;
-
- scaleytab = &v1.scaletable[v1.scaleYindex];
-
- if (v1.scaletable[v1.scaleXindex] < _scaleX) {
- v1.x += v1.scaleXstep;
- if (v1.x < 0 || v1.x >= _vm->_screenWidth)
- return;
- maskbit = revBitMask[v1.x & 7];
- v1.destptr += v1.scaleXstep;
- }
- mask = v1.mask_ptr + (v1.x >> 3);
- v1.scaleXindex += v1.scaleXstep;
- dst = v1.destptr;
- }
- StartPos:;
- } while (--len);
- } while (1);
-}
-
-void AkosRenderer::codec1_spec2() {
- warning("codec1_spec2"); // TODO
-}
-
-void AkosRenderer::codec1_spec3() {
- const byte *src;
- byte *dst;
- byte len, maskbit;
- uint y, color, height;
uint pcolor;
const byte *scaleytab, *mask;
@@ -486,12 +354,18 @@
if (color && y < _outheight
&& (!v1.mask_ptr || !((mask[0] | mask[v1.imgbufoffs]) & maskbit))) {
pcolor = palette[color];
- if (pcolor < 8) {
- pcolor = (pcolor << 8) + *dst;
- *dst = _shadow_table[pcolor];
- } else {
- *dst = pcolor;
+ if (_shadow_mode == 1) {
+ if (pcolor == 13)
+ pcolor = _shadow_table[*dst];
+ } else if (_shadow_mode == 2) {
+ warning("codec1_spec2"); // TODO
+ } else if (_shadow_mode == 3) {
+ if (pcolor < 8) {
+ pcolor = (pcolor << 8) + *dst;
+ pcolor = _shadow_table[pcolor];
+ }
}
+ *dst = pcolor;
}
mask += _numStrips;
dst += _outwidth;
@@ -856,20 +730,7 @@
}
}
- switch (_shadow_mode) {
- case 1:
- codec1_spec1();
- break;
- case 2:
- codec1_spec2();
- break;
- case 3:
- codec1_spec3();
- break;
- default:
- codec1_genericDecode();
- break;
- }
+ codec1_genericDecode();
return drawFlag;
}
Index: akos.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/akos.h,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- akos.h 29 May 2003 10:31:04 -0000 1.19
+++ akos.h 29 May 2003 11:07:54 -0000 1.20
@@ -75,9 +75,6 @@
byte drawLimb(const CostumeData &cost, int limb);
byte codec1(int _xmoveCur, int _ymoveCur);
- void codec1_spec1();
- void codec1_spec2();
- void codec1_spec3();
void codec1_genericDecode();
byte codec5(int _xmoveCur, int _ymoveCur);
Index: costume.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/costume.cpp,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -d -r1.48 -r1.49
--- costume.cpp 29 May 2003 10:46:07 -0000 1.48
+++ costume.cpp 29 May 2003 11:07:54 -0000 1.49
@@ -288,7 +288,7 @@
height = _height;
width = _width2;
- if (v1.replen)
+ if (len)
goto StartPos;
do {
More information about the Scummvm-git-logs
mailing list