[Scummvm-cvs-logs] SF.net SVN: scummvm: [21324] scummvm/trunk/engines/simon

kirben at users.sourceforge.net kirben at users.sourceforge.net
Wed Mar 15 19:49:07 CET 2006


Revision: 21324
Author:   kirben
Date:     2006-03-15 19:48:42 -0800 (Wed, 15 Mar 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=21324&view=rev

Log Message:
-----------
Rename flags used for drawing images

Modified Paths:
--------------
    scummvm/trunk/engines/simon/vga.cpp
    scummvm/trunk/engines/simon/vga.h
Modified: scummvm/trunk/engines/simon/vga.cpp
===================================================================
--- scummvm/trunk/engines/simon/vga.cpp	2006-03-16 03:19:55 UTC (rev 21323)
+++ scummvm/trunk/engines/simon/vga.cpp	2006-03-16 03:48:42 UTC (rev 21324)
@@ -707,17 +707,18 @@
 	if (_dumpImages)
 		dump_single_bitmap(_vgaCurFileId, state.image, state.depack_src, width * 16, height,
 											 state.palette);
+	// Check if image is compressed
 	if (getGameType() == GType_FF) {
 		if (flags & 0x80) {
-			state.flags |= 0x8;
+			state.flags |= kDFCompressed;
 		}
 	} else {
-		if (flags & 0x80 && !(state.flags & 0x10)) {
-			if (state.flags & 1) {
-				state.flags &= ~1;
-				state.flags |= 0x10;
+		if (flags & 0x80 && !(state.flags & kDFCompressedFlip)) {
+			if (state.flags & kDFFlip) {
+				state.flags &= ~kDFFlip;
+				state.flags |= kDFCompressedFlip;
 			} else {
-				state.flags |= 0x8;
+				state.flags |= kDFCompressed;
 			}
 		}
 	}
@@ -760,9 +761,9 @@
 	}
 
 	if (getGameType() == GType_SIMON1 || getGameType() == GType_SIMON2) {
-		if (state.flags & 0x10) {
+		if (state.flags & kDFCompressedFlip) {
 			state.depack_src = vc10_uncompressFlip(state.depack_src, width, height);
-		} else if (state.flags & 1) {
+		} else if (state.flags & kDFFlip) {
 			state.depack_src = vc10_flip(state.depack_src, width, height);
 		}
 	}
@@ -845,8 +846,8 @@
 }
 
 void SimonEngine::drawImages_Feeble(VC10_state *state) {
-	if (state->flags & 0x8) {
-		if (state->flags & 0x40) {
+	if (state->flags & kDFCompressed) {
+		if (state->flags & kDFScaled) {
 			state->surf_addr = dx_lock_scaled();
 			state->surf_pitch = _dxSurfacePitch;
 
@@ -885,7 +886,7 @@
 			} else {
 				scaleClip(state->height, state->width, state->y, state->x, _scrollY);
 			}
-		} else 	if (state->flags & 0x10) {
+		} else 	if (state->flags & kDFOverlayed) {
 			state->surf_addr = dx_lock_scaled();
 			state->surf_pitch = _dxSurfacePitch;
 			state->surf_addr += state->x + state->y * state->surf_pitch;
@@ -931,7 +932,7 @@
 			uint w, h;
 			byte *src, *dst, *dst_org;
 
-			if (state->flags & 0x20) {
+			if (state->flags & kDFMasked) {
 				if (vcGetBit(81) == false) {
 					if (state->x  > _feebleRect.right)
 						return;
@@ -983,7 +984,7 @@
 					h = 0;
 					do {
 						color = *src;
-						if ((state->flags & 2) || color != 0)
+						if ((state->flags & kDFNonTrans) || color != 0)
 							*dst = color;
 						dst += _screenWidth;
 						src++;
@@ -1010,7 +1011,7 @@
 				byte color;
 				color = src[count + state->x_skip];
 				if (color) {
-					if ((state->flags & 0x80) && color == 220)
+					if ((state->flags & kDFShaded) && color == 220)
 						color = 244;
 
 					dst[count] = color;
@@ -1078,7 +1079,7 @@
 	state->surf2_addr += offs + offs2 * state->surf2_pitch;
 	state->surf_addr += offs + offs2 * state->surf_pitch;
 
-	if (state->flags & 0x20) {
+	if (state->flags & kDFMasked) {
 		byte *mask, *src, *dst;
 		byte h;
 		uint w;
@@ -1131,13 +1132,13 @@
 		byte *dst;
 		uint h, i;
 
-		if (!(state->flags & 8)) {
+		if (!(state->flags & kDFCompressed)) {
 			src = state->depack_src + (state->width * state->y_skip * 16) + (state->x_skip * 8);
 			dst = state->surf_addr;
 
 			state->draw_width *= 2;
 
-			if (state->flags & 2) {
+			if (state->flags & kDFNonTrans) {
 				/* no transparency */
 				h = state->draw_height;
 				do {
@@ -1164,7 +1165,7 @@
 			 * aaaaabbb bbcccccd ddddeeee efffffgg ggghhhhh
 			 */
 
-			if (state->flags & 2) {
+			if (state->flags & kDFNonTrans) {
 				/* no transparency */
 				do {
 					uint count = state->draw_width / 4;
@@ -1242,7 +1243,7 @@
 			state->surf_pitch = state->surf2_pitch;
 		}
 
-		if (state->flags & 0x8) {
+		if (state->flags & kDFCompressed) {
 			uint w, h;
 			byte *src, *dst, *dst_org;
 
@@ -1253,7 +1254,7 @@
 
 			vc10_skip_cols(state);
 
-			if (state->flags & 2) {
+			if (state->flags & kDFNonTrans) {
 				dst_org = state->surf_addr;
 				w = 0;
 				do {
@@ -1304,7 +1305,7 @@
 			src = state->depack_src + (state->width * state->y_skip) * 8;
 			dst = state->surf_addr;
 			state->x_skip *= 4;
-			if (state->flags & 2) {
+			if (state->flags & kDFNonTrans) {
 				do {
 					for (count = 0; count != state->draw_width; count++) {
 						dst[count * 2] = (src[count + state->x_skip] / 16) | state->palette;

Modified: scummvm/trunk/engines/simon/vga.h
===================================================================
--- scummvm/trunk/engines/simon/vga.h	2006-03-16 03:19:55 UTC (rev 21323)
+++ scummvm/trunk/engines/simon/vga.h	2006-03-16 03:48:42 UTC (rev 21324)
@@ -97,6 +97,19 @@
 	#pragma END_PACK_STRUCTS
 #endif
 
+enum DrawFlags {
+	kDFFlip           = 0x1,
+	kDFNonTrans       = 0x2,
+	kDFCompressed     = 0x8,
+	kDFCompressedFlip = 0x10,
+	kDFMasked         = 0x20,
+
+	// Feeble specific
+	kDFOverlayed      = 0x10,
+	kDFScaled         = 0x40,
+	kDFShaded         = 0x80
+};
+
 struct VC10_state {
 	int image;
 	uint16 flags;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.





More information about the Scummvm-git-logs mailing list