[Scummvm-cvs-logs] CVS: scummvm/scumm/smush codec37.cpp,1.6,1.7 codec37.h,1.4,1.5

Pawel Kolodziejski aquadran at users.sourceforge.net
Sat Dec 21 12:06:04 CET 2002


Update of /cvsroot/scummvm/scummvm/scumm/smush
In directory sc8-pr-cvs1:/tmp/cvs-serv14213/smush

Modified Files:
	codec37.cpp codec37.h 
Log Message:
fix smush for compatible with dig demo

Index: codec37.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/smush/codec37.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- codec37.cpp	31 Aug 2002 13:29:10 -0000	1.6
+++ codec37.cpp	21 Dec 2002 20:05:40 -0000	1.7
@@ -318,7 +318,7 @@
 	} while (--bh);
 }
 
-void Codec37Decoder::proc4(Blitter & dst, Chunk & src, int32 next_offs, int32 bw, int32 bh) {
+void Codec37Decoder::proc4WithFDFE(Blitter & dst, Chunk & src, int32 next_offs, int32 bw, int32 bh) {
 	do {
 		int32 i = bw;
 		do {
@@ -370,6 +370,46 @@
 	} while (--bh);
 }
 
+void Codec37Decoder::proc4WithoutFDFE(Blitter & dst, Chunk & src, int32 next_offs, int32 bw, int32 bh) {
+	do {
+		int32 i = bw;
+		do {
+			int32 code = src.getByte();
+			if (code == 0xFF) {
+#ifdef USE_COLOR_CODE_FOR_BLOCK
+				dst.putBlock(expand(9));
+#else
+				dst.putBlock(src);
+#endif
+			} else if (code == 0x00) {
+				int32 length = src.getByte() + 1;
+				for (int32 l = 0; l < length; l++) {
+#ifdef USE_COLOR_CODE_FOR_BLOCK
+					dst.putBlock(expand(10));
+#else
+					dst.blockCopy(next_offs);
+#endif
+					i--;
+					if (i == 0) {
+						dst.advance(0, 3); // advance 3 lines
+						bh--;
+						i = bw;
+					}
+				}
+				if(bh == 0) return;
+				i++;
+			} else {
+#ifdef USE_COLOR_CODE_FOR_BLOCK
+				dst.putBlock(expand(11));
+#else
+				dst.blockCopy(_offsetTable[code] + next_offs); // copy from an offset !
+#endif
+			}
+		} while (--i);
+		dst.advance(0, 3); // advance 3 lines
+	} while (--bh);
+}
+
 bool Codec37Decoder::decode(Blitter & dst, Chunk & src) {
 	int32 width = getRect().width();
 	int32 height = getRect().height();
@@ -414,13 +454,16 @@
 		proc2(blit, src, decoded_size);
 		break;
 	case 3:
-		if(mask_flag & 1)
+		if(mask_flag & 4)
 			proc3WithFDFE(blit, src, _deltaBufs[_curtable ^ 1] - _deltaBufs[_curtable], bw, bh);
 		else
 			proc3WithoutFDFE(blit, src, _deltaBufs[_curtable ^ 1] - _deltaBufs[_curtable], bw, bh);
 		break;
 	case 4:
-		proc4(blit, src, _deltaBufs[_curtable ^ 1] - _deltaBufs[_curtable], bw, bh);
+		if(mask_flag & 4)
+			proc4WithFDFE(blit, src, _deltaBufs[_curtable ^ 1] - _deltaBufs[_curtable], bw, bh);
+		else
+			proc4WithoutFDFE(blit, src, _deltaBufs[_curtable ^ 1] - _deltaBufs[_curtable], bw, bh);
 		break;
 	default:
 #ifdef DEBUG_CODEC37

Index: codec37.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/smush/codec37.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- codec37.h	30 Aug 2002 07:24:45 -0000	1.4
+++ codec37.h	21 Dec 2002 20:05:40 -0000	1.5
@@ -78,7 +78,8 @@
 	void proc2(Blitter &, Chunk &, int32);
 	void proc3WithFDFE(Blitter &, Chunk &, int32, int32, int32);
 	void proc3WithoutFDFE(Blitter &, Chunk &, int32, int32, int32);
-	void proc4(Blitter &, Chunk &, int32, int32, int32);
+	void proc4WithFDFE(Blitter &, Chunk &, int32, int32, int32);
+	void proc4WithoutFDFE(Blitter &, Chunk &, int32, int32, int32);
 public:
 	bool decode(Blitter &, Chunk &);
 };





More information about the Scummvm-git-logs mailing list