[Scummvm-cvs-logs] CVS: scummvm/scumm akos.cpp,1.116,1.117 akos.h,1.27,1.28
Max Horn
fingolfin at users.sourceforge.net
Sat Apr 3 17:24:24 CEST 2004
Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18791
Modified Files:
akos.cpp akos.h
Log Message:
Fix for bug #885466 (FT: Text gets drawn under moving bits), by making AKOS codec 16 honor the charset mask
Index: akos.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/akos.cpp,v
retrieving revision 1.116
retrieving revision 1.117
diff -u -d -r1.116 -r1.117
--- akos.cpp 3 Apr 2004 22:52:36 -0000 1.116
+++ akos.cpp 4 Apr 2004 01:11:27 -0000 1.117
@@ -882,36 +882,12 @@
}
}
-void AkosRenderer::akos16Decompress(byte *dest, int32 pitch, const byte *src, int32 t_width, int32 t_height, int32 dir, int32 numskip_before, int32 numskip_after, byte transparency) {
- byte *tmp_buf = akos16.buffer;
-
- if (dir < 0) {
- dest -= (t_width - 1);
- tmp_buf += (t_width - 1);
- }
-
- akos16SetupBitReader(src);
-
- if (numskip_before != 0) {
- akos16SkipData(numskip_before);
- }
-
- assert(t_height > 0);
- assert(t_width > 0);
- while (t_height--) {
- akos16DecodeLine(tmp_buf, t_width, dir);
- bompApplyShadow(_shadow_mode, _shadow_table, akos16.buffer, dest, t_width, transparency);
-
- if (numskip_after != 0) {
- akos16SkipData(numskip_after);
- }
- dest += pitch;
- }
-}
-
-void AkosRenderer::akos16DecompressMask(byte *dest, int32 pitch, const byte *src, int32 t_width, int32 t_height, int32 dir, int32 numskip_before, int32 numskip_after, byte transparency, byte * maskptr, int32 bitpos_start) {
+void AkosRenderer::akos16Decompress(byte *dest, int32 pitch, const byte *src, int32 t_width, int32 t_height, int32 dir,
+ int32 numskip_before, int32 numskip_after, byte transparency, int maskLeft, int maskTop, int zBuf) {
byte *tmp_buf = akos16.buffer;
int maskpitch;
+ byte *maskptr = 0, *charsetMask = 0;
+ const byte maskbit = revBitMask[maskLeft & 7];
if (dir < 0) {
dest -= (t_width - 1);
@@ -925,19 +901,27 @@
}
maskpitch = _numStrips;
+
+ charsetMask = _vm->getMaskBuffer(maskLeft, maskTop, 0);
+ if (zBuf != 0)
+ maskptr = _vm->getMaskBuffer(maskLeft, maskTop, zBuf);
assert(t_height > 0);
assert(t_width > 0);
while (t_height--) {
akos16DecodeLine(tmp_buf, t_width, dir);
- bompApplyMask(akos16.buffer, maskptr, (byte)bitpos_start, t_width, transparency);
+ bompApplyMask(akos16.buffer, charsetMask, maskbit, t_width, transparency);
+ if (maskptr) {
+ bompApplyMask(akos16.buffer, maskptr, maskbit, t_width, transparency);
+ maskptr += maskpitch;
+ }
bompApplyShadow(_shadow_mode, _shadow_table, akos16.buffer, dest, t_width, transparency);
if (numskip_after != 0) {
akos16SkipData(numskip_after);
}
dest += pitch;
- maskptr += maskpitch;
+ charsetMask += maskpitch;
}
}
@@ -1040,15 +1024,9 @@
int32 numskip_before = skip_x + (skip_y * _width);
int32 numskip_after = _width - cur_x;
- byte *dest = _outptr + width_unk + height_unk * _outwidth;
+ byte *dst = _outptr + width_unk + height_unk * _outwidth;
- if (_zbuf == 0) {
- akos16Decompress(dest, pitch, _srcptr, cur_x, out_height, dir, numskip_before, numskip_after, transparency);
- } else {
- byte *ptr = _vm->getMaskBuffer(clip.left, clip.top, _zbuf);
- akos16DecompressMask(dest, pitch, _srcptr, cur_x, out_height, dir, numskip_before, numskip_after, transparency, ptr, clip.left / 8);
- }
-
+ akos16Decompress(dst, pitch, _srcptr, cur_x, out_height, dir, numskip_before, numskip_after, transparency, clip.left, clip.top, _zbuf);
return 0;
}
Index: akos.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/akos.h,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- akos.h 6 Jan 2004 12:45:29 -0000 1.27
+++ akos.h 4 Apr 2004 01:11:27 -0000 1.28
@@ -96,8 +96,7 @@
void akos16SetupBitReader(const byte *src);
void akos16SkipData(int32 numskip);
void akos16DecodeLine(byte *buf, int32 numbytes, int32 dir);
- void akos16Decompress(byte *dest, int32 pitch, const byte *src, int32 t_width, int32 t_height, int32 dir, int32 numskip_before, int32 numskip_after, byte transparency);
- void akos16DecompressMask(byte *dest, int32 pitch, const byte *src, int32 t_width, int32 t_height, int32 dir, int32 numskip_before, int32 numskip_after, byte transparency, byte *maskptr, int32 bitpos_start);
+ void akos16Decompress(byte *dest, int32 pitch, const byte *src, int32 t_width, int32 t_height, int32 dir, int32 numskip_before, int32 numskip_after, byte transparency, int maskLeft, int maskTop, int zBuf);
};
} // End of namespace Scumm
More information about the Scummvm-git-logs
mailing list