[Scummvm-cvs-logs] SF.net SVN: scummvm: [32074] scummvm/trunk/engines/made

john_doe at users.sourceforge.net john_doe at users.sourceforge.net
Mon May 12 23:47:38 CEST 2008


Revision: 32074
          http://scummvm.svn.sourceforge.net/scummvm/?rev=32074&view=rev
Author:   john_doe
Date:     2008-05-12 14:47:38 -0700 (Mon, 12 May 2008)

Log Message:
-----------
Implemented o1_EXCLUDEAREA for RtZ

Modified Paths:
--------------
    scummvm/trunk/engines/made/screen.cpp
    scummvm/trunk/engines/made/screen.h
    scummvm/trunk/engines/made/scriptfuncs_rtz.cpp

Modified: scummvm/trunk/engines/made/screen.cpp
===================================================================
--- scummvm/trunk/engines/made/screen.cpp	2008-05-12 21:03:26 UTC (rev 32073)
+++ scummvm/trunk/engines/made/screen.cpp	2008-05-12 21:47:38 UTC (rev 32074)
@@ -108,6 +108,56 @@
 	_needPalette = true;
 }
 
+void Screen::setExcludeArea(uint16 x1, uint16 y1, uint16 x2, uint16 y2) {
+
+	_excludeClipAreaEnabled[0] = false;
+	_excludeClipAreaEnabled[1] = false;
+	_excludeClipAreaEnabled[2] = false;
+	_excludeClipAreaEnabled[3] = false;
+
+	if (x1 == 0 && y1 == 0 && x2 == 0 && y2 == 0) {
+		_excludeClipArea[0].x = 0;
+		_excludeClipArea[0].y = 0;
+		_excludeClipArea[0].w = 320;
+		_excludeClipArea[0].h = 200;
+		_excludeClipAreaEnabled[0] = true;
+		return;
+	}
+
+	if (y1 > 0 && y2 > 0) {
+		_excludeClipArea[0].x = 0;
+		_excludeClipArea[0].y = 0;
+		_excludeClipArea[0].w = 320;
+		_excludeClipArea[0].h = y1;
+		_excludeClipAreaEnabled[0] = true;
+	}
+
+	if (y1 < 200 && y2 < 200) {
+		_excludeClipArea[1].x = 0;
+		_excludeClipArea[1].y = y2;
+		_excludeClipArea[1].w = 320;
+		_excludeClipArea[1].h = 200 - y2;
+		_excludeClipAreaEnabled[1] = true;
+	}
+
+	if (x1 > 0 && x2 > 0) {
+		_excludeClipArea[2].x = 0;
+		_excludeClipArea[2].y = y1;
+		_excludeClipArea[2].w = x1;
+		_excludeClipArea[2].h = y2 - y1;
+		_excludeClipAreaEnabled[2] = true;
+	}
+
+	if (x1 < 320 && x2 < 320) {
+		_excludeClipArea[3].x = x2;
+		_excludeClipArea[3].y = y1;
+		_excludeClipArea[3].w = 320 - x2;
+		_excludeClipArea[3].h = y2 - y1;
+		_excludeClipAreaEnabled[3] = true;
+	}
+	
+}
+
 void Screen::drawSurface(Graphics::Surface *sourceSurface, int x, int y, int16 flipX, int16 flipY, int16 mask, const ClipInfo &clipInfo) {
 
 	byte *source, *dest, *maskp;
@@ -116,16 +166,16 @@
 	int clipWidth = sourceSurface->w;
 	int clipHeight = sourceSurface->h;
 	
-	if (x < 0) {
-		startX = -x;
+	if (x < clipInfo.x) {
+		startX = clipInfo.x - x;
 		clipWidth -= startX;
-		x = 0;
+		x = clipInfo.x;
 	}
 
-	if (y < 0) {
-		startY = -y;
+	if (y < clipInfo.y) {
+		startY = clipInfo.y - y;
 		clipHeight -= startY;
-		y = 0;
+		y = clipInfo.y;
 	}
 
 	if (x + clipWidth > clipInfo.x + clipInfo.w) {
@@ -659,9 +709,9 @@
 	byte p;
 	byte *dest = (byte*)_fontDrawCtx.destSurface->getBasePtr(x, y);
 
-	for (uint16 yc = 0; yc < height; yc++) {
+	for (uint yc = 0; yc < height; yc++) {
 		p = charData[yc];
-		for (uint16 xc = 0; xc < width; xc++) {
+		for (uint xc = 0; xc < width; xc++) {
 			if (p & 0x80)
 				dest[xc] = color;
 			p <<= 1;

Modified: scummvm/trunk/engines/made/screen.h
===================================================================
--- scummvm/trunk/engines/made/screen.h	2008-05-12 21:03:26 UTC (rev 32073)
+++ scummvm/trunk/engines/made/screen.h	2008-05-12 21:47:38 UTC (rev 32074)
@@ -79,6 +79,8 @@
 		_clipArea.h = ABS(y2 - y1);
 	}
 
+	void setExcludeArea(uint16 x1, uint16 y1, uint16 x2, uint16 y2);
+
 	void setClip(int16 clip) { _clip = clip; }
 	void setExclude(int16 exclude) { _exclude = exclude; }
 	void setGround(int16 ground) { _ground = ground; }
@@ -185,6 +187,7 @@
 	
 	uint16 _channelsUsedCount;
 	SpriteChannel _channels[100];
+	
 };
 
 } // End of namespace Made

Modified: scummvm/trunk/engines/made/scriptfuncs_rtz.cpp
===================================================================
--- scummvm/trunk/engines/made/scriptfuncs_rtz.cpp	2008-05-12 21:03:26 UTC (rev 32073)
+++ scummvm/trunk/engines/made/scriptfuncs_rtz.cpp	2008-05-12 21:47:38 UTC (rev 32074)
@@ -658,7 +658,7 @@
 }
 
 int16 ScriptFunctionsRtz::o1_EXCLUDEAREA(int16 argc, int16 *argv) {
-	warning("Unimplemented opcode: o1_EXCLUDEAREA");
+	_vm->_screen->setExcludeArea(argv[3], argv[2], argv[1], argv[0]);
 	return 0;
 }
 
@@ -857,7 +857,10 @@
 }
 
 int16 ScriptFunctionsRtz::o1_SLOWSYSTEM(int16 argc, int16 *argv) {
-	warning("Unimplemented opcode: o1_SLOWSYSTEM");
+	//warning("Unimplemented opcode: o1_SLOWSYSTEM");
+	// NOTE: In the original engine this value is set via a command-line parameter
+	// I don't think it's needed here
+	// One could maybe think about returning 1 here on actually slower systems.
 	return 0;
 }
 


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