[Scummvm-cvs-logs] CVS: scummvm/scumm akos.cpp,1.191,1.192 charset.cpp,2.113,2.114 gfx.cpp,2.362,2.363 intern.h,2.292,2.293 script_v80he.cpp,2.48,2.49 script_v90he.cpp,2.80,2.81

Travis Howell kirben at users.sourceforge.net
Mon Oct 4 22:59:12 CEST 2004


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

Modified Files:
	akos.cpp charset.cpp gfx.cpp intern.h script_v80he.cpp 
	script_v90he.cpp 
Log Message:

HE71+ games use wizImages for charset too.


Index: akos.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/akos.cpp,v
retrieving revision 1.191
retrieving revision 1.192
diff -u -d -r1.191 -r1.192
--- akos.cpp	4 Oct 2004 06:20:10 -0000	1.191
+++ akos.cpp	5 Oct 2004 05:52:48 -0000	1.192
@@ -1238,7 +1238,9 @@
 	if (_draw_bottom < dst.bottom)
 		_draw_bottom = dst.bottom;
 
-	_vm->gdi.decompressWizImage(_outptr, _outwidth, dst, _srcptr, src);
+	byte *dstPtr = _outptr + dst.left + dst.top * _outwidth;
+
+	_vm->gdi.decompressWizImage(dstPtr, _outwidth, dst, _srcptr, src);
 	return 0;
 }
 

Index: charset.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/charset.cpp,v
retrieving revision 2.113
retrieving revision 2.114
diff -u -d -r2.113 -r2.114
--- charset.cpp	1 Oct 2004 09:06:12 -0000	2.113
+++ charset.cpp	5 Oct 2004 05:52:48 -0000	2.114
@@ -1213,6 +1213,7 @@
 
 	_vm->_charsetColorMap[1] = _color;
 
+	int charUnk = *_fontPtr;
 	if (is2byte) {
 		_dropShadow = true;
 		charPtr = _vm->get2byteCharPtr(chr);
@@ -1282,7 +1283,7 @@
 
 	_vm->markRectAsDirty(vs->number, _left, _left + width, drawTop, drawTop + height + offsY);
 
-	byte *dst;
+	byte *dstPtr;
 	byte *back = NULL;
 
 	if (!_ignoreCharsetMask) {
@@ -1294,64 +1295,90 @@
 	Graphics::Surface backSurface;
 	if (_ignoreCharsetMask || !vs->hasTwoBuffers) {
 		dstSurface = *vs;
-		dst = vs->getPixels(_left, drawTop);
+		dstPtr = vs->getPixels(_left, drawTop);
 	} else {
 		dstSurface = _vm->gdi._textSurface;
-		dst = (byte *)_vm->gdi._textSurface.pixels + (_top - _vm->_screenTop) * _vm->gdi._textSurface.pitch + _left;
+		dstPtr = (byte *)_vm->gdi._textSurface.pixels + (_top - _vm->_screenTop) * _vm->gdi._textSurface.pitch + _left;
 	}
 
 	if (_blitAlso && vs->hasTwoBuffers) {
 		backSurface = dstSurface;
-		back = dst;
+		back = dstPtr;
 		dstSurface = *vs;
-		dst = vs->getBackPixels(_left, drawTop);
+		dstPtr = vs->getBackPixels(_left, drawTop);
 	}
 
 	if (!_ignoreCharsetMask && vs->hasTwoBuffers) {
 		drawTop = _top - _vm->_screenTop;
 	}
 
-	if (is2byte) {
-		drawBits1(dstSurface, dst, charPtr, drawTop, origWidth, origHeight);
-	} else {
-		drawBitsN(dstSurface, dst, charPtr, *_fontPtr, drawTop, origWidth, origHeight);
-	}
+	if (_vm->_heversion >= 71 && charUnk >= 8) {
+		Common::Rect clip, src, dst;
 
-	if (_blitAlso && vs->hasTwoBuffers) {
-		// FIXME: Revisiting this code, I think the _blitAlso mode is likely broken
-		// right now -- we are copying stuff from "dst" to "back", but "dst" really
-		// only conatains charset data... 
-		// One way to fix this: don't copy etc.; rather simply render the char twice,
-		// once to each of the two buffers. That should hypothetically yield
-		// identical results, though I didn't try it and right now I don't know
-		// any spots where I can test this...
-		if (!_ignoreCharsetMask)
-			warning("This might be broken -- please report where you encountered this to Fingolfin");
+		clip.top = clip.left = 0;
+		clip.right = vs->w - 1;
+		clip.bottom = vs->h - 1;
 
-		// Perform some clipping
-		int w = MIN(width, dstSurface.w - _left);
-		int h = MIN(height, dstSurface.h - drawTop);
-		if (_left < 0) {
-			w += _left;
-			back -= _left;
-			dst -= _left;
-		}
-		if (drawTop < 0) {
-			h += drawTop;
-			back -= drawTop * backSurface.pitch;
-			dst -= drawTop * dstSurface.pitch;
+		dst.left = _left;
+		dst.top = _top;
+		dst.right = dst.left + width;
+		dst.bottom = dst.top + height;
+
+		dst.clip(clip);
+		if ((dst.left >= dst.right) || (dst.top >= dst.bottom))
+			return;
+
+		src = dst;
+		src.moveTo(0, 0);
+
+		_vm->gdi.decompressWizImage(dstPtr, vs->w, dst, charPtr, src);
+
+		if (_blitAlso && vs->hasTwoBuffers)
+			_vm->gdi.copyVirtScreenBuffers(dst);
+
+	} else {
+		if (is2byte) {
+			drawBits1(dstSurface, dstPtr, charPtr, drawTop, origWidth, origHeight);
+		} else {
+			drawBitsN(dstSurface, dstPtr, charPtr, *_fontPtr, drawTop, origWidth, origHeight);
 		}
+
+		if (_blitAlso && vs->hasTwoBuffers) {
+			// FIXME: Revisiting this code, I think the _blitAlso mode is likely broken
+			// right now -- we are copying stuff from "dstPtr" to "back", but "dstPtr" really
+			// only conatains charset data... 
+			// One way to fix this: don't copy etc.; rather simply render the char twice,
+			// once to each of the two buffers. That should hypothetically yield
+			// identical results, though I didn't try it and right now I don't know
+			// any spots where I can test this...
+			if (!_ignoreCharsetMask)
+				warning("This might be broken -- please report where you encountered this to Fingolfin");
+
+			// Perform some clipping
+			int w = MIN(width, dstSurface.w - _left);
+			int h = MIN(height, dstSurface.h - drawTop);
+			if (_left < 0) {
+				w += _left;
+				back -= _left;
+				dstPtr -= _left;
+			}
+			if (drawTop < 0) {
+				h += drawTop;
+				back -= drawTop * backSurface.pitch;
+				dstPtr -= drawTop * dstSurface.pitch;
+			}
 		
-		// Blit the image data
-		if (w > 0) {
-			while (h-- > 0) {
-				memcpy(back, dst, w);
-				back += backSurface.pitch;
-				dst += dstSurface.pitch;
+			// Blit the image data
+			if (w > 0) {
+				while (h-- > 0) {
+					memcpy(back, dstPtr, w);
+					back += backSurface.pitch;
+					dstPtr += dstSurface.pitch;
+				}
 			}
 		}
-	}
-	
+	}	
+
 	_left += origWidth;
 
 	if (_str.right < _left) {

Index: gfx.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/gfx.cpp,v
retrieving revision 2.362
retrieving revision 2.363
diff -u -d -r2.362 -r2.363
--- gfx.cpp	4 Oct 2004 14:39:42 -0000	2.362
+++ gfx.cpp	5 Oct 2004 05:52:48 -0000	2.363
@@ -1478,7 +1478,8 @@
 	Common::Rect r1, r2;
 	if (calcClipRects(dstw, dsth, srcx, srcy, srcw, srch, rect, r1, r2)) {
 		if (r1.isValidRect() && r2.isValidRect()) {
-			decompressWizImage(dst, dstw, r2, src, r1);
+			uint8 *dstPtr = dst + r2.left + r2.top * dstw;
+			decompressWizImage(dstPtr, dstw, r2, src, r1);
 		}
 	}
 }
@@ -1491,7 +1492,7 @@
 	int h, w, xoff;
 	uint16 off;
 	
-	dstPtr = dst + dstRect.left + dstRect.top * dstPitch;
+	dstPtr = dst;
 	dataPtr = src;
 	
 	// Skip over the first 'srcRect->top' lines in the data

Index: intern.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/intern.h,v
retrieving revision 2.292
retrieving revision 2.293
diff -u -d -r2.292 -r2.293
--- intern.h	4 Oct 2004 04:04:36 -0000	2.292
+++ intern.h	5 Oct 2004 05:52:48 -0000	2.293
@@ -809,6 +809,7 @@
 	void o80_writeConfigFile();
 	void o80_cursorCommand();
 	void o80_setState();
+	void o80_drawBox();
 	void o80_drawWizPolygon();
 	void o80_unknownE0();
 	void o80_pickVarRandom();

Index: script_v80he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v80he.cpp,v
retrieving revision 2.48
retrieving revision 2.49
diff -u -d -r2.48 -r2.49
--- script_v80he.cpp	4 Oct 2004 01:34:29 -0000	2.48
+++ script_v80he.cpp	5 Oct 2004 05:52:48 -0000	2.49
@@ -251,7 +251,7 @@
 		/* A4 */
 		OPCODE(o72_arrayOps),
 		OPCODE(o6_invalid),
-		OPCODE(o6_drawBox),
+		OPCODE(o80_drawBox),
 		OPCODE(o6_pop),
 		/* A8 */
 		OPCODE(o6_getActorWidth),
@@ -611,6 +611,20 @@
 	removeObjectFromDrawQue(obj);
 }
 
+void ScummEngine_v80he::o80_drawBox() {
+	int x, y, x2, y2, color;
+	color = pop();
+	y2 = pop();
+	x2 = pop();
+	y = pop();
+	x = pop();
+
+	if (color & 0x8000)
+		color &= 0x7FFF;
+
+	drawBox(x, y, x2, y2, color);
+}
+
 void ScummEngine_v80he::o80_drawWizPolygon() {
 	WizImage wi;
 	wi.x1 = wi.y1 = pop();

Index: script_v90he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v90he.cpp,v
retrieving revision 2.80
retrieving revision 2.81
diff -u -d -r2.80 -r2.81
--- script_v90he.cpp	4 Oct 2004 04:04:37 -0000	2.80
+++ script_v90he.cpp	5 Oct 2004 05:52:48 -0000	2.81
@@ -251,7 +251,7 @@
 		/* A4 */
 		OPCODE(o72_arrayOps),
 		OPCODE(o90_unknownA5),
-		OPCODE(o6_drawBox),
+		OPCODE(o80_drawBox),
 		OPCODE(o6_pop),
 		/* A8 */
 		OPCODE(o6_getActorWidth),





More information about the Scummvm-git-logs mailing list