[Scummvm-cvs-logs] CVS: scummvm/scumm bomp.cpp,2.22,2.23 bomp.h,2.9,2.10 object.cpp,1.198,1.199 gfx.h,1.92,1.93 akos.cpp,1.193,1.194

Max Horn fingolfin at users.sourceforge.net
Thu Oct 7 09:13:03 CEST 2004


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

Modified Files:
	bomp.cpp bomp.h object.cpp gfx.h akos.cpp 
Log Message:
Simplify calling drawBomp a littl

Index: bomp.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/bomp.cpp,v
retrieving revision 2.22
retrieving revision 2.23
diff -u -d -r2.22 -r2.23
--- bomp.cpp	24 Sep 2004 20:37:24 -0000	2.22
+++ bomp.cpp	7 Oct 2004 16:10:51 -0000	2.23
@@ -27,6 +27,8 @@
 
 namespace Scumm {
 
+static int32 setupBompScale(byte *scaling, int32 size, byte scale);
+
 static void bompScaleFuncX(byte *line_buffer, byte *scaling_x_ptr, byte skip, int32 size);
 
 static void bompApplyShadow0(const byte *shadowPalette, const byte *line_buffer, byte *dst, int32 size, byte transparency, byte HE7Check);
@@ -200,10 +202,12 @@
 	byte *dst;
 	byte *mask = 0;
 	Common::Rect clip;
-	byte *scalingYPtr = bd.scalingYPtr;
+	byte *scalingYPtr = 0;
 	byte skip_y_bits = 0x80;
 	byte skip_y_new = 0;
 	byte tmp;
+	byte bomp_scaling_x[64];
+	byte bomp_scaling_y[64];
 
 
 	if (bd.x < 0) {
@@ -240,21 +244,23 @@
 
 	// Setup vertical scaling
 	if (bd.scale_y != 255) {
-		assert(scalingYPtr);
+		int scaleBottom = setupBompScale(bomp_scaling_y, bd.srcheight, bd.scale_y);
+		scalingYPtr = bomp_scaling_y;
 
 		skip_y_new = *scalingYPtr++;
 		skip_y_bits = 0x80;
 
-		if (clip.bottom > bd.scaleBottom) {
-			clip.bottom = bd.scaleBottom;
+		if (clip.bottom > scaleBottom) {
+			clip.bottom = scaleBottom;
 		}
 	}
 
 	// Setup horizontal scaling
 	if (bd.scale_x != 255) {
-		assert(bd.scalingXPtr);
-		if (clip.right > bd.scaleRight) {
-			clip.right = bd.scaleRight;
+		int scaleRight = setupBompScale(bomp_scaling_x, bd.srcwidth, bd.scale_x);
+
+		if (clip.right > scaleRight) {
+			clip.right = scaleRight;
 		}
 	}
 
@@ -296,7 +302,7 @@
 
 		// Perform horizontal scaling
 		if (bd.scale_x != 255) {
-			bompScaleFuncX(line_buffer, bd.scalingXPtr, 0x80, bd.srcwidth);
+			bompScaleFuncX(line_buffer, bomp_scaling_x, 0x80, bd.srcwidth);
 		}
 
 		// The first clip.top lines are to be clipped, i.e. not drawn

Index: bomp.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/bomp.h,v
retrieving revision 2.9
retrieving revision 2.10
diff -u -d -r2.9 -r2.10
--- bomp.h	27 Jun 2004 23:54:53 -0000	2.9
+++ bomp.h	7 Oct 2004 16:10:51 -0000	2.10
@@ -26,8 +26,6 @@
 
 namespace Scumm {
 
-int32 setupBompScale(byte *scaling, int32 size, byte scale);
-
 void bompApplyMask(byte *line_buffer, byte *mask, byte maskbit, int32 size, byte transparency);
 void bompApplyShadow(int shadowMode, const byte *shadowPalette, const byte *line_buffer, byte *dst, int32 size, byte transparency, byte HE7Check = false);
 

Index: object.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/object.cpp,v
retrieving revision 1.198
retrieving revision 1.199
diff -u -d -r1.198 -r1.199
--- object.cpp	7 Oct 2004 15:42:39 -0000	1.198
+++ object.cpp	7 Oct 2004 16:10:51 -0000	1.199
@@ -1519,21 +1519,11 @@
 	bdd.maskPtr = NULL;
 
 	if ((bdd.scale_x != 255) || (bdd.scale_y != 255)) {
-		byte bomp_scaling_x[64], bomp_scaling_y[64];
-		bdd.scalingXPtr = bomp_scaling_x;
-		bdd.scalingYPtr = bomp_scaling_y;
-		bdd.scaleRight = setupBompScale(bomp_scaling_x, bdd.srcwidth, bdd.scale_x);
-		bdd.scaleBottom = setupBompScale(bomp_scaling_y, bdd.srcheight, bdd.scale_y);
 		bdd.shadowMode = 0;
-		drawBomp(bdd, false);
 	} else {
-		bdd.scalingXPtr = NULL;
-		bdd.scalingYPtr = NULL;
-		bdd.scaleRight = 0;
-		bdd.scaleBottom = 0;
 		bdd.shadowMode = eo->mode;
-		drawBomp(bdd, false);
 	}
+	drawBomp(bdd, false);
 
 	markRectAsDirty(vs->number, bdd.x, bdd.x + bdd.srcwidth, bdd.y, bdd.y + bdd.srcheight);
 }

Index: gfx.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/gfx.h,v
retrieving revision 1.92
retrieving revision 1.93
diff -u -d -r1.92 -r1.93
--- gfx.h	5 Oct 2004 09:39:39 -0000	1.92
+++ gfx.h	7 Oct 2004 16:10:51 -0000	1.93
@@ -193,8 +193,6 @@
 	int srcwidth, srcheight;
 	uint16 shadowMode;
 
-	int32 scaleRight, scaleBottom;
-	byte *scalingXPtr, *scalingYPtr;
 	byte *maskPtr;
 	
 	BompDrawData() { memset(this, 0, sizeof(*this)); }

Index: akos.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/akos.cpp,v
retrieving revision 1.193
retrieving revision 1.194
diff -u -d -r1.193 -r1.194
--- akos.cpp	5 Oct 2004 14:05:23 -0000	1.193
+++ akos.cpp	7 Oct 2004 16:10:51 -0000	1.194
@@ -983,11 +983,6 @@
 	bdd.scale_y = 255;
 	bdd.shadowMode = _shadow_mode;
 
-	bdd.scalingXPtr = NULL;
-	bdd.scalingYPtr = NULL;
-	bdd.scaleRight = 0;
-	bdd.scaleBottom = 0;
-
 	if (!_mirror) {
 		bdd.x = (_actorX - xmoveCur - _width) + 1;
 	} else {





More information about the Scummvm-git-logs mailing list