[Scummvm-cvs-logs] CVS: scummvm/scumm/smush codec37.cpp,1.26.2.1,1.26.2.2 codec37.h,1.14,1.14.2.1

Travis Howell kirben at users.sourceforge.net
Thu Aug 12 18:53:51 CEST 2004


Update of /cvsroot/scummvm/scummvm/scumm/smush
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21273/scumm/smush

Modified Files:
      Tag: branch-0-6-0
	codec37.cpp codec37.h 
Log Message:

Back port:
V1 costume fixes
INSANE and smush support for PC FT demo


Index: codec37.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/smush/codec37.cpp,v
retrieving revision 1.26.2.1
retrieving revision 1.26.2.2
diff -u -d -r1.26.2.1 -r1.26.2.2
--- codec37.cpp	22 Apr 2004 12:27:22 -0000	1.26.2.1
+++ codec37.cpp	13 Aug 2004 01:52:07 -0000	1.26.2.2
@@ -338,6 +338,71 @@
 		dst += 4;						  \
 	} while (0)
 
+void Codec37Decoder::proc1(byte *dst, const byte *src, int32 next_offs, int bw, int bh, int pitch, int16 *offset_table) {
+	uint8 code;
+	bool filling, skipCode;
+	int32 len;
+	int i, p;
+	uint32 pitches[16];
+
+	i = bw;
+	for (p = 0; p < 16; ++p) {
+		pitches[p] = (p >> 2) * pitch + (p & 0x3);
+	}
+	code = 0;
+	filling = false;
+	len = -1;
+	while (1) {
+		if (len < 0) {
+			filling = (*src & 1) == 1;
+			len = *src++ >> 1;
+			skipCode = false;
+		} else {
+			skipCode = true;
+		}
+		if (!filling || !skipCode) {
+			code = *src++;
+			if (code == 0xFF) {
+				--len;
+				for (p = 0; p < 0x10; ++p) {
+					if (len < 0) {
+						filling = (*src & 1) == 1;
+						len = *src++ >> 1;
+						if (filling) {
+							code = *src++;
+						}
+					}
+					if (filling) {
+						*(dst + pitches[p]) = code;
+					} else {
+						*(dst + pitches[p]) = *src++;
+					}
+					--len;
+				}
+				dst += 4;
+				--i;
+				if (i == 0) {
+					dst += pitch * 3;
+					--bh;
+					if (bh == 0) return;
+					i = bw;
+				}
+				continue;
+			}
+		}
+		byte *dst2 = dst + offset_table[code] + next_offs;
+		COPY_4X4(dst2, dst, pitch);
+		--i;
+		if (i == 0) {
+			dst += pitch * 3;
+			--bh;
+			if (bh == 0) return;
+			i = bw;
+		}
+		--len;
+	}
+}
+
 void Codec37Decoder::proc3WithFDFE(byte *dst, const byte *src, int32 next_offs, int bw, int bh, int pitch, int16 *offset_table) {
 	do {
 		int32 i = bw;
@@ -464,7 +529,11 @@
 		memcpy(_deltaBufs[_curtable], src + 16, decoded_size);
 		break;
 	case 1:
-		warning("codec37: missing opcode 1");
+		if ((seq_nb & 1) || !(mask_flags & 1)) {
+			_curtable ^= 1;
+		}
+		proc1(_deltaBufs[_curtable], src + 16, _deltaBufs[_curtable ^ 1] - _deltaBufs[_curtable], 
+										bw, bh, pitch, _offsetTable);
 		break;
 	case 2:
 		bompDecodeLine(_deltaBufs[_curtable], src + 16, decoded_size);

Index: codec37.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/smush/codec37.h,v
retrieving revision 1.14
retrieving revision 1.14.2.1
diff -u -d -r1.14 -r1.14.2.1
--- codec37.h	6 Jan 2004 12:45:31 -0000	1.14
+++ codec37.h	13 Aug 2004 01:52:07 -0000	1.14.2.1
@@ -47,6 +47,7 @@
 	void deinit();
 protected:
 	void maketable(int, int);
+	void proc1(byte *dst, const byte *src, int32, int, int, int, int16 *);
 	void proc3WithFDFE(byte *dst, const byte *src, int32, int, int, int, int16 *);
 	void proc3WithoutFDFE(byte *dst, const byte *src, int32, int, int, int, int16 *);
 	void proc4WithFDFE(byte *dst, const byte *src, int32, int, int, int, int16 *);





More information about the Scummvm-git-logs mailing list