[Scummvm-cvs-logs] CVS: scummvm/scumm costume.cpp,1.59,1.60 costume.h,1.18,1.19 gfx.h,1.42,1.43

Pawel Kolodziejski aquadran at users.sourceforge.net
Thu Jun 19 03:47:20 CEST 2003


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

Modified Files:
	costume.cpp costume.h gfx.h 
Log Message:
added initial form of v1 costume codec (NOT WORKING, i think)

Index: costume.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/costume.cpp,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -d -r1.59 -r1.60
--- costume.cpp	7 Jun 2003 10:44:54 -0000	1.59
+++ costume.cpp	19 Jun 2003 10:45:21 -0000	1.60
@@ -197,7 +197,10 @@
 			skip = -v1.x;
 		if (skip > 0) {
 			v1.skip_width -= skip;
-			codec1_ignorePakCols(skip);
+			if (_vm->_version != 1)
+				codec1_ignorePakCols(skip);
+			else 
+				warning ("TODO: ignore columns for v1 gfx costume codec");
 			v1.x = 0;
 		} else {
 			skip = x_right - _vm->_screenWidth;
@@ -212,7 +215,10 @@
 			skip = x_right - _vm->_screenWidth;
 		if (skip > 0) {
 			v1.skip_width -= skip;
-			codec1_ignorePakCols(skip);
+			if (_vm->_version != 1)
+				codec1_ignorePakCols(skip);
+			else 
+				warning ("TODO: ignore columns for v1 gfx costume codec");
 			v1.x = _vm->_screenWidth - 1;
 		} else {
 			skip = -1 - x_left;
@@ -252,13 +258,46 @@
 
 	CHECK_HEAP
 
-	if (_vm->_features & GF_AMIGA && (_vm->_gameId == GID_INDY4 || _vm->_gameId == GID_MONKEY2))
+	if (_vm->_version == 1)
+		procC64();
+	else if (_vm->_features & GF_AMIGA && (_vm->_gameId == GID_INDY4 || _vm->_gameId == GID_MONKEY2))
 		proc3_ami();
 	else
 		proc3();
 
 	CHECK_HEAP
 	return drawFlag;
+}
+
+void CostumeRenderer::procC64() {
+	const byte *src;
+	byte *dst;
+	byte color;
+	byte len;
+
+	int y = 0;
+	src = _srcptr;
+	dst = v1.destptr;
+
+	for (int x = 0; x < (_width >> 3); x++) {
+		color = *src++;
+		if (color & 0x80) {
+			len &= 0x7f;
+			color = *src++;
+			for (int z = 0; z < len; z++) {
+				dst[0] = dst[1] = _vm->gdi._C64Colors[(color >> 6) & 3];
+				dst[2] = dst[3] = _vm->gdi._C64Colors[(color >> 4) & 3];
+				dst[4] = dst[5] = _vm->gdi._C64Colors[(color >> 2) & 3];
+				dst[6] = dst[7] = _vm->gdi._C64Colors[(color >> 0) & 3];
+				dst += _outwidth;
+				y++;
+				if (y >= (_height >> 3)) {
+					y = 0;
+					dst = v1.destptr + (x << 3);
+				}
+			}
+		}
+	}
 }
 
 void CostumeRenderer::proc3() {

Index: costume.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/costume.h,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- costume.h	30 May 2003 21:37:58 -0000	1.18
+++ costume.h	19 Jun 2003 10:45:21 -0000	1.19
@@ -62,6 +62,7 @@
 	byte drawLimb(const CostumeData &cost, int limb);
 
 	void proc3();
+	void procC64();
 	void proc3_ami();
 	byte mainRoutine(int xmoveCur, int ymoveCur);
 };

Index: gfx.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/gfx.h,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -d -r1.42 -r1.43
--- gfx.h	6 Jun 2003 05:27:45 -0000	1.42
+++ gfx.h	19 Jun 2003 10:45:21 -0000	1.43
@@ -113,6 +113,7 @@
 	int _imgBufOffs[8];
 	int32 _numStrips;
 	ScummVM::Rect _mask;
+	byte _C64Colors[4];
 
 protected:
 	byte _palette_mod;
@@ -122,7 +123,7 @@
 
 	bool _zbufferDisabled;
 
-	byte _C64Colors[4], _C64CharMap[2048], _C64ObjectMap[2048], _C64PicMap[4096], _C64ColorMap[4096];
+	byte _C64CharMap[2048], _C64ObjectMap[2048], _C64PicMap[4096], _C64ColorMap[4096];
 	byte _C64MaskMap[4096], _C64MaskChar[4096];
 	bool _C64ObjectMode;
 





More information about the Scummvm-git-logs mailing list