[Scummvm-cvs-logs] CVS: scummvm/scumm akos.cpp,1.91,1.92 charset.cpp,2.74,2.75 costume.cpp,1.121,1.122 debugger.cpp,1.104,1.105 gfx.cpp,2.241,2.242 gfx.h,1.51,1.52 object.cpp,1.154,1.155 script_v5.cpp,1.216,1.217 scumm.h,1.344,1.345 verbs.cpp,1.84,1.85

Max Horn fingolfin at users.sourceforge.net
Sat Jan 3 14:46:28 CET 2004


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1:/tmp/cvs-serv895

Modified Files:
	akos.cpp charset.cpp costume.cpp debugger.cpp gfx.cpp gfx.h 
	object.cpp script_v5.cpp scumm.h verbs.cpp 
Log Message:
renamed updateDirtyRect to markRectAsDirty (because that's what it really does); used virtual screen id constants in more places

Index: akos.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/akos.cpp,v
retrieving revision 1.91
retrieving revision 1.92
diff -u -d -r1.91 -r1.92
--- akos.cpp	2 Jan 2004 04:58:39 -0000	1.91
+++ akos.cpp	3 Jan 2004 22:45:23 -0000	1.92
@@ -673,7 +673,7 @@
 		if (_actorHitX < x_left || _actorHitX >= x_right || _actorHitY < y_top || _actorHitY >= y_bottom)
 			return 0;
 	} else
-		_vm->updateDirtyRect(0, x_left, x_right, y_top, y_bottom, _dirty_id);
+		_vm->markRectAsDirty(kMainVirtScreen, x_left, x_right, y_top, y_bottom, _dirty_id);
 
 	if (y_top >= (int)_outheight || y_bottom <= 0)
 		return 0;
@@ -763,7 +763,7 @@
 	maxw = _outwidth - 1;
 	maxh = _outheight - 1;
 
-	_vm->updateDirtyRect(0, clip_left, clip_right + 1, clip_top, clip_bottom + 1, _dirty_id);
+	_vm->markRectAsDirty(kMainVirtScreen, clip_left, clip_right + 1, clip_top, clip_bottom + 1, _dirty_id);
 
 	if (clip_top < 0) {
 		clip_top = 0;
@@ -980,7 +980,7 @@
 	cur_x = _width - 1;
 	cur_y = _height - 1;
 
-	_vm->updateDirtyRect(0, clip_left, clip_right + 1, clip_top, clip_bottom + 1, _dirty_id);
+	_vm->markRectAsDirty(kMainVirtScreen, clip_left, clip_right + 1, clip_top, clip_bottom + 1, _dirty_id);
 
 	if (clip_left < 0) {
 		skip_x = -clip_left;

Index: charset.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/charset.cpp,v
retrieving revision 2.74
retrieving revision 2.75
diff -u -d -r2.74 -r2.75
--- charset.cpp	27 Dec 2003 14:03:07 -0000	2.74
+++ charset.cpp	3 Jan 2004 22:45:23 -0000	2.75
@@ -977,7 +977,7 @@
 	mask_ptr = _vm->getMaskBuffer(_left, drawTop, 0);
 	useMask = (vs->number == 0 && !_ignoreCharsetMask);
 
-	_vm->updateDirtyRect(vs->number, _left, _left + w, drawTop, drawTop + h, 0);
+	_vm->markRectAsDirty(vs->number, _left, _left + w, drawTop, drawTop + h, 0);
 	if (vs->number == 0)
 		_hasMask = true;
 
@@ -1082,7 +1082,7 @@
 
 	int drawTop = _top - vs->topline;
 
-	_vm->updateDirtyRect(vs->number, _left, _left + width, drawTop, drawTop + height + offsY, 0);
+	_vm->markRectAsDirty(vs->number, _left, _left + width, drawTop, drawTop + height + offsY, 0);
 
 	if (vs->number != 0)
 		_blitAlso = false;
@@ -1296,7 +1296,7 @@
 
 	_hasMask = true;
 	_current->drawShadowChar(chr, _left, _top - _vm->_screenTop, _color, !_ignoreCharsetMask);
-	_vm->updateDirtyRect(0, shadow_left, shadow_right, shadow_top, shadow_bottom, 0);
+	_vm->markRectAsDirty(kMainVirtScreen, shadow_left, shadow_right, shadow_top, shadow_bottom, 0);
 
 	_left += width;
 

Index: costume.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/costume.cpp,v
retrieving revision 1.121
retrieving revision 1.122
diff -u -d -r1.121 -r1.122
--- costume.cpp	23 Nov 2003 07:59:45 -0000	1.121
+++ costume.cpp	3 Jan 2004 22:45:23 -0000	1.122
@@ -202,9 +202,9 @@
 
 	if (_vm->_version == 1)
 		//HACK: it fix gfx glitches leaved by actor costume in V1 games, when actor moving to left
-		_vm->updateDirtyRect(0, x_left, x_right + 8, y_top, y_bottom, _dirty_id);
+		_vm->markRectAsDirty(kMainVirtScreen, x_left, x_right + 8, y_top, y_bottom, _dirty_id);
 	else
-		_vm->updateDirtyRect(0, x_left, x_right + 1, y_top, y_bottom, _dirty_id);
+		_vm->markRectAsDirty(kMainVirtScreen, x_left, x_right + 1, y_top, y_bottom, _dirty_id);
 
 	if (y_top >= (int)_outheight || y_bottom <= 0)
 		return 0;

Index: debugger.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/debugger.cpp,v
retrieving revision 1.104
retrieving revision 1.105
diff -u -d -r1.104 -r1.105
--- debugger.cpp	30 Dec 2003 23:05:34 -0000	1.104
+++ debugger.cpp	3 Jan 2004 22:45:23 -0000	1.105
@@ -709,7 +709,7 @@
 
 	VirtScreen *vs = _vm->findVirtScreen(coords.ul.y);
 	if (vs != NULL)
-		_vm->updateDirtyRect(vs->number, 0, _vm->_screenWidth, 0, _vm->_screenHeight, 0);
+		_vm->markRectAsDirty(vs->number, 0, _vm->_screenWidth, 0, _vm->_screenHeight, 0);
 	_vm->drawDirtyScreenParts();
 	_vm->_system->update_screen();
 }

Index: gfx.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/gfx.cpp,v
retrieving revision 2.241
retrieving revision 2.242
diff -u -d -r2.241 -r2.242
--- gfx.cpp	3 Jan 2004 22:21:56 -0000	2.241
+++ gfx.cpp	3 Jan 2004 22:45:23 -0000	2.242
@@ -31,6 +31,14 @@
 
 namespace Scumm {
 
+struct StripTable {
+	int offsets[160];
+	int run[160];
+	int color[160];
+	int zoffsets[120];	// FIXME: Why only 120 here?
+	int zrun[120];		// FIXME: Why only 120 here?
+};
+
 enum {
 	kScrolltime = 500,  // ms scrolling is supposed to take
 	kPictureDelay = 20
@@ -223,9 +231,9 @@
 		// Since the size of screen 3 is fixed, there is no need to reallocate it
 		// if its size changed.
 		if (_version >= 7) {
-			initVirtScreen(3, 0, (_screenHeight / 2) - 10, _screenWidth, 13, false, false);
+			initVirtScreen(kUnkVirtScreen, 0, (_screenHeight / 2) - 10, _screenWidth, 13, false, false);
 		} else {
-			initVirtScreen(3, 0, 80, _screenWidth, 13, false, false);
+			initVirtScreen(kUnkVirtScreen, 0, 80, _screenWidth, 13, false, false);
 		}
 	}
 	initVirtScreen(kMainVirtScreen, 0, b, _screenWidth, h - b, true, true);
@@ -236,7 +244,7 @@
 	_screenH = h;
 }
 
-void ScummEngine::initVirtScreen(int slot, int number, int top, int width, int height, bool twobufs,
+void ScummEngine::initVirtScreen(VirtScreenNumber slot, int number, int top, int width, int height, bool twobufs,
 													 bool scrollable) {
 	VirtScreen *vs = &virtscr[slot];
 	int size;
@@ -292,7 +300,7 @@
 	return NULL;
 }
 
-void ScummEngine::updateDirtyRect(int virt, int left, int right, int top, int bottom, int dirtybit) {
+void ScummEngine::markRectAsDirty(VirtScreenNumber virt, int left, int right, int top, int bottom, int dirtybit) {
 	VirtScreen *vs = &virtscr[virt];
 	int lp, rp;
 
@@ -306,7 +314,7 @@
 	if (bottom > vs->height)
 		bottom = vs->height;
 
-	if (virt == 0 && dirtybit) {
+	if (virt == kMainVirtScreen && dirtybit) {
 		lp = left / 8 + _screenStartStrip;
 		if (lp < 0)
 			lp = 0;
@@ -382,7 +390,7 @@
 	}
 }
 
-void ScummEngine::updateDirtyScreen(int slot) {
+void ScummEngine::updateDirtyScreen(VirtScreenNumber slot) {
 	gdi.updateDirtyScreen(&virtscr[slot]);
 }
 
@@ -451,12 +459,6 @@
 	_vm->_system->copy_rect(ptr, _vm->_screenWidth, x, vs->topline + t, w, height);
 }
 
-void Gdi::clearCharsetMask() {
-	memset(_vm->getResourceAddress(rtBuffer, 9), 0, _imgBufOffs[1]);
-	_mask.top = _mask.left = 32767;
-	_mask.right = _mask.bottom = 0;
-}
-
 /**
  * Reset the background behind an actor or blast object.
  */
@@ -550,14 +552,14 @@
 	else if (y2 > vs->height)
 		y2 = vs->height;
 	
-	updateDirtyRect(vs->number, x, x2, y, y2, 0);
+	markRectAsDirty(vs->number, x, x2, y, y2, 0);
 
 	backbuff = vs->screenPtr + vs->xstart + y * _screenWidth + x;
 
 	width = x2 - x;
 	height = y2 - y;
 	if (color == -1) {
-		if (vs->number != 0)
+		if (vs->number != kMainVirtScreen)
 			error("can only copy bg to main window");
 		bgbuff = getResourceAddress(rtBuffer, vs->number + 5) + vs->xstart + y * _screenWidth + x;
 		blit(backbuff, bgbuff, width, height);
@@ -630,7 +632,7 @@
 
 	// Remove the flash light first if it was previously drawn
 	if (_flashlight.isDrawn) {
-		updateDirtyRect(0, _flashlight.x, _flashlight.x + _flashlight.w,
+		markRectAsDirty(kMainVirtScreen, _flashlight.x, _flashlight.x + _flashlight.w,
 										_flashlight.y, _flashlight.y + _flashlight.h, USAGE_BIT_DIRTY);
 		
 		if (_flashlight.buffer) {
@@ -820,7 +822,7 @@
 	if (rect.bottom >= height)
 		rect.bottom = height;
 
-	updateDirtyRect(vs->number, rect.left, rect.right, rect.top - topline, rect.bottom - topline, USAGE_BIT_RESTORED);
+	markRectAsDirty(vs->number, rect.left, rect.right, rect.top - topline, rect.bottom - topline, USAGE_BIT_RESTORED);
 
 	int offset = (rect.top - topline) * _screenWidth + vs->xstart + rect.left;
 	backbuff = vs->screenPtr + offset;
@@ -830,11 +832,11 @@
 	width = rect.width();
 
 	// Check whether lights are turned on or not
-	lightsOn = (_features & GF_NEW_OPCODES) || (vs->number != 0) || (VAR(VAR_CURRENT_LIGHTS) & LIGHTMODE_screen);
+	lightsOn = (_features & GF_NEW_OPCODES) || (vs->number != kMainVirtScreen) || (VAR(VAR_CURRENT_LIGHTS) & LIGHTMODE_screen);
 
 	if (vs->alloctwobuffers && _currentRoom != 0 && lightsOn ) {
 		blit(backbuff, bgbak, width, height);
-		if (vs->number == 0 && _charset->_hasMask && height) {
+		if (vs->number == kMainVirtScreen && _charset->_hasMask && height) {
 			byte *mask;
 			// Note: At first sight it may look as if this could
 			// be optimized to (rect.right - rect.left) / 8 and
@@ -846,7 +848,7 @@
 				mask_width++;
 
 			mask = getMaskBuffer(rect.left, rect.top, 0);
-			if (vs->number == 0)
+			if (vs->number == kMainVirtScreen)
 				mask += vs->topline * gdi._numStrips;
 
 			do {
@@ -862,6 +864,12 @@
 	}
 }
 
+void Gdi::clearCharsetMask() {
+	memset(_vm->getResourceAddress(rtBuffer, 9), 0, _imgBufOffs[1]);
+	_mask.top = _mask.left = 32767;
+	_mask.right = _mask.bottom = 0;
+}
+
 bool ScummEngine::hasCharsetMask(int left, int top, int right, int bottom) {
 	Common::Rect rect(left, top, right, bottom);
 	
@@ -901,7 +909,7 @@
 	bool useOrDecompress = false;
 
 	// Check whether lights are turned on or not
-	lightsOn = (_vm->_features & GF_NEW_OPCODES) || (vs->number != 0) || (_vm->VAR(_vm->VAR_CURRENT_LIGHTS) & LIGHTMODE_screen);
+	lightsOn = (_vm->_features & GF_NEW_OPCODES) || (vs->number != kMainVirtScreen) || (_vm->VAR(_vm->VAR_CURRENT_LIGHTS) & LIGHTMODE_screen);
 
 	CHECK_HEAP;
 	if (_vm->_features & GF_SMALL_HEADER)

Index: gfx.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/gfx.h,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -d -r1.51 -r1.52
--- gfx.h	3 Jan 2004 22:21:56 -0000	1.51
+++ gfx.h	3 Jan 2004 22:45:23 -0000	1.52
@@ -48,15 +48,16 @@
 };
 
 /** Virtual screen identifiers */
-enum {
+enum VirtScreenNumber {
 	kMainVirtScreen = 0,	// The 'stage'
 	kTextVirtScreen = 1,	// In V1-V3 games: the area where text is printed
-	kVerbVirtScreen = 2		// The verb area
+	kVerbVirtScreen = 2,	// The verb area
+	kUnkVirtScreen = 3		// ?? Not sure what this one is good for...
 };
 
 /** Virtual screen areas */
 struct VirtScreen {
-	int number;
+	VirtScreenNumber number;
 	uint16 topline;
 	uint16 width, height;
 	byte alloctwobuffers;
@@ -111,13 +112,7 @@
 	BompDrawData() { memset(this, 0, sizeof(*this)); }
 };
 
-struct StripTable {
-	int offsets[160];
-	int run[160];
-	int color[160];
-	int zoffsets[120];	// FIXME: Why only 120 here?
-	int zrun[120];		// FIXME: Why only 120 here?
-};
+struct StripTable;
 
 class Gdi {
 	friend class ScummEngine;	// Mostly for the code in saveload.cpp ...

Index: object.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/object.cpp,v
retrieving revision 1.154
retrieving revision 1.155
diff -u -d -r1.154 -r1.155
--- object.cpp	26 Dec 2003 23:11:33 -0000	1.154
+++ object.cpp	3 Jan 2004 22:45:23 -0000	1.155
@@ -1515,7 +1515,7 @@
 		drawBomp(bdd, false);
 	}
 
-	updateDirtyRect(vs->number, bdd.x, bdd.x + bdd.srcwidth, bdd.y, bdd.y + bdd.srcheight, 0);
+	markRectAsDirty(vs->number, bdd.x, bdd.x + bdd.srcwidth, bdd.y, bdd.y + bdd.srcheight, 0);
 }
 
 void ScummEngine::removeBlastObjects() {
@@ -1569,7 +1569,7 @@
 	for (i = left_strip; i <= right_strip; i++)
 		gdi.resetBackground(top, bottom, i);
 
-	updateDirtyRect(0, left, right, top, bottom, USAGE_BIT_RESTORED);
+	markRectAsDirty(kMainVirtScreen, left, right, top, bottom, USAGE_BIT_RESTORED);
 }
 
 int ScummEngine::findLocalObjectSlot() {

Index: script_v5.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v5.cpp,v
retrieving revision 1.216
retrieving revision 1.217
diff -u -d -r1.216 -r1.217
--- script_v5.cpp	3 Jan 2004 21:26:44 -0000	1.216
+++ script_v5.cpp	3 Jan 2004 22:45:23 -0000	1.217
@@ -2854,7 +2854,7 @@
 				VirtScreen *vs = &virtscr[0];
 				restoreBG(Common::Rect(0,vs->topline, vs->width, vs->topline + vs->height));
 				virtscr[0].setDirtyRange(0, virtscr[0].height);
-				updateDirtyScreen(0);
+				updateDirtyScreen(kMainVirtScreen);
 				
 				if (byte_2FCCF) {
 					// Here now "sub_1C44" is called, which sets byte_2FCCF to 0 then

Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.h,v
retrieving revision 1.344
retrieving revision 1.345
diff -u -d -r1.344 -r1.345
--- scumm.h	3 Jan 2004 22:21:56 -0000	1.344
+++ scumm.h	3 Jan 2004 22:45:23 -0000	1.345
@@ -792,7 +792,7 @@
 	StripTable *_roomStrips;
 
 	void initScreens(int b, int w, int h);
-	void initVirtScreen(int slot, int number, int top, int width, int height, bool twobufs, bool scrollable);
+	void initVirtScreen(VirtScreenNumber slot, int number, int top, int width, int height, bool twobufs, bool scrollable);
 	void initBGBuffers(int height);
 	void initCycl(const byte *ptr);	// Color cycle
 
@@ -855,10 +855,10 @@
 
 
 public:
-	void updateDirtyRect(int virt, int left, int right, int top, int bottom, int dirtybit);
+	void markRectAsDirty(VirtScreenNumber virt, int left, int right, int top, int bottom, int dirtybit);
 protected:
 	void drawDirtyScreenParts();
-	void updateDirtyScreen(int slot);
+	void updateDirtyScreen(VirtScreenNumber slot);
 
 public:
 	VirtScreen *findVirtScreen(int y);

Index: verbs.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/verbs.cpp,v
retrieving revision 1.84
retrieving revision 1.85
diff -u -d -r1.84 -r1.85
--- verbs.cpp	26 Dec 2003 23:11:35 -0000	1.84
+++ verbs.cpp	3 Jan 2004 22:45:23 -0000	1.85
@@ -137,7 +137,7 @@
 				dst += _screenWidth;
 			}
 
-			updateDirtyRect(2, rect.left, rect.right, rect.top, rect.bottom, 0);
+			markRectAsDirty(kVerbVirtScreen, rect.left, rect.right, rect.top, rect.bottom, 0);
 		}
 
 		if (new_box != -1) {
@@ -154,7 +154,7 @@
 				dst += _screenWidth;
 			}
 
-			updateDirtyRect(2, rect.left, rect.right, rect.top, rect.bottom, 0);
+			markRectAsDirty(kVerbVirtScreen, rect.left, rect.right, rect.top, rect.bottom, 0);
 		}
 
 		v2_mouseover_box = new_box;





More information about the Scummvm-git-logs mailing list