[Scummvm-cvs-logs] CVS: scummvm/simon simon.h,1.153,1.154 vga.cpp,1.142,1.143

kirben kirben at users.sourceforge.net
Tue Nov 8 03:36:29 CET 2005


Update of /cvsroot/scummvm/scummvm/simon
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31771/simon

Modified Files:
	simon.h vga.cpp 
Log Message:

Cleanup.


Index: simon.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/simon.h,v
retrieving revision 1.153
retrieving revision 1.154
diff -u -d -r1.153 -r1.154
--- simon.h	5 Nov 2005 18:47:03 -0000	1.153
+++ simon.h	8 Nov 2005 11:34:56 -0000	1.154
@@ -788,8 +788,8 @@
 	void quick_load_or_save();
 	void shutdown();
 
-	byte *vc10_depack_swap(const byte *src, uint w, uint h);
-	byte *vc10_no_depack_swap(const byte *src, uint w, uint h);
+	byte *vc10_uncompressFlip(const byte *src, uint w, uint h);
+	byte *vc10_flip(const byte *src, uint w, uint h);
 
 	Item *getNextItemPtrStrange();
 

Index: vga.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/vga.cpp,v
retrieving revision 1.142
retrieving revision 1.143
diff -u -d -r1.142 -r1.143
--- vga.cpp	5 Nov 2005 18:47:03 -0000	1.142
+++ vga.cpp	8 Nov 2005 11:34:56 -0000	1.143
@@ -503,96 +503,97 @@
 	}
 }
 
-byte *SimonEngine::vc10_depack_swap(const byte *src, uint w, uint h) {
-	w <<= 3;
+byte *SimonEngine::vc10_uncompressFlip(const byte *src, uint w, uint h) {
+	w *= 8;
 
-	{
-		byte *dst_org = _videoBuf1 + w;
-		byte color;
-		int8 cur = -0x80;
-		uint w_cur = w;
+	byte *src_org, *dst_org;
+	byte color;
+	int8 cur = -0x80;
+	uint i, w_cur = w;
 
-		do {
-			byte *dst = dst_org;
-			uint h_cur = h;
+	dst_org = _videoBuf1 + w;
 
-			if (cur == -0x80)
-				cur = *src++;
+	do {
+		byte *dst = dst_org;
+		uint h_cur = h;
 
-			for (;;) {
-				if (cur >= 0) {
-					/* rle_same */
-					color = *src++;
-					do {
-						*dst = color;
-						dst += w;
-						if (!--h_cur) {
-							if (--cur < 0)
-								cur = -0x80;
-							else
-								src--;
-							goto next_line;
-						}
-					} while (--cur >= 0);
-				} else {
-					/* rle_diff */
-					do {
-						*dst = *src++;
-						dst += w;
-						if (!--h_cur) {
-							if (++cur == 0)
-								cur = -0x80;
-							goto next_line;
-						}
-					} while (++cur != 0);
-				}
-				cur = *src++;
-			}
-		next_line:
-			dst_org++;
-		} while (--w_cur);
-	}
+		if (cur == -0x80)
+			cur = *src++;
 
-	{
-		byte *dst_org, *src_org;
-		uint i;
+		for (;;) {
+			if (cur >= 0) {
+				/* rle_same */
+				color = *src++;
+				do {
+					*dst = color;
+					dst += w;
+					if (!--h_cur) {
+						if (--cur < 0)
+							cur = -0x80;
+						else
+							src--;
+						goto next_line;
+					}
+				} while (--cur >= 0);
+			} else {
+				/* rle_diff */
+				do {
+					*dst = *src++;
+					dst += w;
+					if (!--h_cur) {
+						if (++cur == 0)
+							cur = -0x80;
+						goto next_line;
+					}
+				} while (++cur != 0);
+			}
+			cur = *src++;
+		}
+	next_line:
+		dst_org++;
+	} while (--w_cur);
 
-		src_org = dst_org = _videoBuf1 + w;
 
-		do {
-			byte *dst = dst_org;
-			for (i = 0; i != w; ++i) {
-				byte b = src_org[i];
-				b = (b >> 4) | (b << 4);
-				*--dst = b;
-			}
+	src_org = dst_org = _videoBuf1 + w;
 
-			src_org += w;
-			dst_org += w;
-		} while (--h);
+	do {
+		byte *dst = dst_org;
+		for (i = 0; i != w; ++i) {
+			byte b = src_org[i];
+			b = (b >> 4) | (b << 4);
+			*--dst = b;
+		}
 
-	}
+		src_org += w;
+		dst_org += w;
+	} while (--h);
 
 	return _videoBuf1;
 }
 
-byte *SimonEngine::vc10_no_depack_swap(const byte *src, uint w, uint h) {
+byte *SimonEngine::vc10_flip(const byte *src, uint w, uint h) {
 	if (src == _vc10BasePtrOld)
 		return _videoBuf1;
 
 	_vc10BasePtrOld = src;
-	h *= 8;
-	byte *dst = _videoBuf1 + h - 1;
 
-	uint h_cur = h;
+	byte *dst_org, *src_org;
+	uint i;
+
+	w *= 8;
+	src_org = dst_org = _videoBuf1 + w;
+
 	do {
-		do {
-			*dst = *src << 4;
-			(*dst--) |= (*src++) >> 4;
-		} while (--h_cur != 0);
-		h_cur = h;
-		dst += h * 2;
-	} while (--w != 0);
+		byte *dst = dst_org;
+		for (i = 0; i != w; ++i) {
+			byte b = src_org[i];
+			b = (b >> 4) | (b << 4);
+			*--dst = b;
+		}
+
+		src_org += w;
+		dst_org += w;
+	} while (--h);
 
 	return _videoBuf1;
 }
@@ -686,14 +687,17 @@
 	state.depack_src = _curVgaFile2 + READ_BE_UINT32(p2);
 
 	if (_game == GAME_FEEBLEFILES) {
+		state.depack_src = _curVgaFile2 + READ_LE_UINT32(p2);
 		width = READ_LE_UINT16(p2 + 6);
+		height = p2[4];
+		flags = p2[5];
 	} else {
+		state.depack_src = _curVgaFile2 + READ_BE_UINT32(p2);
 		width = READ_BE_UINT16(p2 + 6) >> 4;
+		height = p2[5];
+		flags = p2[4];
 	}
 
-	height = p2[5];
-	flags = p2[4];
-
 	debug(1, "Width %d Height %d Flags 0x%x", width, height, flags);
 
 	if (height == 0 || width == 0)
@@ -746,9 +750,9 @@
 	}
 
 	if (state.flags & 0x10) {
-		state.depack_src = vc10_depack_swap(state.depack_src, width, height);
+		state.depack_src = vc10_uncompressFlip(state.depack_src, width, height);
 	} else if (state.flags & 1) {
-		state.depack_src = vc10_no_depack_swap(state.depack_src, width, height);
+		state.depack_src = vc10_flip(state.depack_src, width, height);
 	}
 
 	vlut = &_video_windows[_windowNum * 4];





More information about the Scummvm-git-logs mailing list