[Scummvm-cvs-logs] SF.net SVN: scummvm: [28877] scummvm/trunk/engines/scumm

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Sat Sep 8 13:15:27 CEST 2007


Revision: 28877
          http://scummvm.svn.sourceforge.net/scummvm/?rev=28877&view=rev
Author:   fingolfin
Date:     2007-09-08 04:15:27 -0700 (Sat, 08 Sep 2007)

Log Message:
-----------
Some cleanup (yay for whomever had the brilliant idea to let SVN work over HTTPS and hence through proxies&firewalls :)

Modified Paths:
--------------
    scummvm/trunk/engines/scumm/actor.cpp
    scummvm/trunk/engines/scumm/akos.cpp
    scummvm/trunk/engines/scumm/base-costume.cpp
    scummvm/trunk/engines/scumm/camera.cpp
    scummvm/trunk/engines/scumm/charset.cpp
    scummvm/trunk/engines/scumm/cursor.cpp
    scummvm/trunk/engines/scumm/debugger.cpp
    scummvm/trunk/engines/scumm/gfx.cpp
    scummvm/trunk/engines/scumm/gfx.h
    scummvm/trunk/engines/scumm/he/animation_he.cpp
    scummvm/trunk/engines/scumm/he/floodfill_he.cpp
    scummvm/trunk/engines/scumm/he/script_v60he.cpp
    scummvm/trunk/engines/scumm/he/sprite_he.cpp
    scummvm/trunk/engines/scumm/he/wiz_he.cpp
    scummvm/trunk/engines/scumm/input.cpp
    scummvm/trunk/engines/scumm/object.cpp
    scummvm/trunk/engines/scumm/saveload.cpp
    scummvm/trunk/engines/scumm/script_v0.cpp
    scummvm/trunk/engines/scumm/script_v2.cpp
    scummvm/trunk/engines/scumm/script_v5.cpp
    scummvm/trunk/engines/scumm/script_v6.cpp
    scummvm/trunk/engines/scumm/scumm.cpp
    scummvm/trunk/engines/scumm/scumm.h
    scummvm/trunk/engines/scumm/smush/smush_player.cpp
    scummvm/trunk/engines/scumm/string.cpp
    scummvm/trunk/engines/scumm/verbs.cpp

Modified: scummvm/trunk/engines/scumm/actor.cpp
===================================================================
--- scummvm/trunk/engines/scumm/actor.cpp	2007-09-07 20:47:31 UTC (rev 28876)
+++ scummvm/trunk/engines/scumm/actor.cpp	2007-09-08 11:15:27 UTC (rev 28877)
@@ -1446,7 +1446,7 @@
 		bcr->_actorX *= V12_X_MULTIPLIER;
 		bcr->_actorY *= V12_Y_MULTIPLIER;
 	}
-	bcr->_actorX -= _vm->virtscr[0].xstart;
+	bcr->_actorX -= _vm->_virtscr[kMainVirtScreen].xstart;
 	
 	if (_vm->_game.platform == Common::kPlatformNES) {
 		// In the NES version, when the actor is facing right,
@@ -1532,7 +1532,7 @@
 	_heNoTalkAnimation = 0;
 
 	// If the actor is partially hidden, redraw it next frame.
-	if (bcr->drawCostume(_vm->virtscr[0], _vm->_gdi->_numStrips, this, _drawToBackBuf) & 1) {
+	if (bcr->drawCostume(_vm->_virtscr[kMainVirtScreen], _vm->_gdi->_numStrips, this, _drawToBackBuf) & 1) {
 		_needRedraw = (_vm->_game.version <= 6);
 	}
 
@@ -2325,7 +2325,7 @@
 					int y = (int16)READ_LE_UINT16(axfd + 4) + dy;
 					int w = (int16)READ_LE_UINT16(axfd + 6);
 					int h = (int16)READ_LE_UINT16(axfd + 8);
-					VirtScreen *pvs = &virtscr[kMainVirtScreen];
+					VirtScreen *pvs = &_virtscr[kMainVirtScreen];
 					uint8 *dst1 = pvs->getPixels(0, pvs->topline);
 					uint8 *dst2 = pvs->getBackPixels(0, pvs->topline);
 					switch (comp) {

Modified: scummvm/trunk/engines/scumm/akos.cpp
===================================================================
--- scummvm/trunk/engines/scumm/akos.cpp	2007-09-07 20:47:31 UTC (rev 28876)
+++ scummvm/trunk/engines/scumm/akos.cpp	2007-09-08 11:15:27 UTC (rev 28877)
@@ -546,7 +546,7 @@
 
 	scaleytab = &v1.scaletable[v1.scaleYindex];
 	maskbit = revBitMask(v1.x & 7);
-	mask = _vm->getMaskBuffer(v1.x - (_vm->virtscr[0].xstart & 7), v1.y, _zbuf);
+	mask = _vm->getMaskBuffer(v1.x - (_vm->_virtscr[kMainVirtScreen].xstart & 7), v1.y, _zbuf);
 
 	if (len)
 		goto StartPos;
@@ -610,7 +610,7 @@
 					skip_column = true;
 				v1.scaleXindex += v1.scaleXstep;
 				dst = v1.destptr;
-				mask = _vm->getMaskBuffer(v1.x - (_vm->virtscr[0].xstart & 7), v1.y, _zbuf);
+				mask = _vm->getMaskBuffer(v1.x - (_vm->_virtscr[kMainVirtScreen].xstart & 7), v1.y, _zbuf);
 			}
 		StartPos:;
 		} while (--len);
@@ -982,8 +982,8 @@
 }
 
 void AkosRenderer::markRectAsDirty(Common::Rect rect) {
-	rect.left -= _vm->virtscr[0].xstart & 7;
-	rect.right -= _vm->virtscr[0].xstart & 7;
+	rect.left -= _vm->_virtscr[kMainVirtScreen].xstart & 7;
+	rect.right -= _vm->_virtscr[kMainVirtScreen].xstart & 7;
 	_vm->markRectAsDirty(kMainVirtScreen, rect, _actorID);
 }
 

Modified: scummvm/trunk/engines/scumm/base-costume.cpp
===================================================================
--- scummvm/trunk/engines/scumm/base-costume.cpp	2007-09-07 20:47:31 UTC (rev 28876)
+++ scummvm/trunk/engines/scumm/base-costume.cpp	2007-09-08 11:15:27 UTC (rev 28877)
@@ -39,9 +39,9 @@
 	else
 		_out.pixels = vs.getPixels(0, 0);
 
-	_actorX += _vm->virtscr[0].xstart & 7;
+	_actorX += _vm->_virtscr[kMainVirtScreen].xstart & 7;
 	_out.w = _out.pitch;
-	_out.pixels = (byte *)_out.pixels - (_vm->virtscr[0].xstart & 7);
+	_out.pixels = (byte *)_out.pixels - (_vm->_virtscr[kMainVirtScreen].xstart & 7);
 
 	_numStrips = numStrips;
 

Modified: scummvm/trunk/engines/scumm/camera.cpp
===================================================================
--- scummvm/trunk/engines/scumm/camera.cpp	2007-09-07 20:47:31 UTC (rev 28876)
+++ scummvm/trunk/engines/scumm/camera.cpp	2007-09-08 11:15:27 UTC (rev 28877)
@@ -199,7 +199,7 @@
 		screenLeft = _screenStartStrip * 8;
 	}
 
-	virtscr[0].xstart = screenLeft;
+	_virtscr[kMainVirtScreen].xstart = screenLeft;
 }
 
 void ScummEngine::panCameraTo(int x, int y) {

Modified: scummvm/trunk/engines/scumm/charset.cpp
===================================================================
--- scummvm/trunk/engines/scumm/charset.cpp	2007-09-07 20:47:31 UTC (rev 28876)
+++ scummvm/trunk/engines/scumm/charset.cpp	2007-09-08 11:15:27 UTC (rev 28877)
@@ -1758,7 +1758,7 @@
 
 	int drawTop = _top;
 	if (ignoreCharsetMask) {
-		VirtScreen *vs = &_vm->virtscr[kMainVirtScreen];
+		VirtScreen *vs = &_vm->_virtscr[kMainVirtScreen];
 		s = *vs;
 		s.pixels = vs->getPixels(0, 0);
 	} else {

Modified: scummvm/trunk/engines/scumm/cursor.cpp
===================================================================
--- scummvm/trunk/engines/scumm/cursor.cpp	2007-09-07 20:47:31 UTC (rev 28876)
+++ scummvm/trunk/engines/scumm/cursor.cpp	2007-09-08 11:15:27 UTC (rev 28877)
@@ -236,7 +236,7 @@
 }
 
 void ScummEngine_v6::useIm01Cursor(const byte *im, int w, int h) {
-	VirtScreen *vs = &virtscr[0];
+	VirtScreen *vs = &_virtscr[kMainVirtScreen];
 	byte *buf, *dst;
 	const byte *src;
 	int i;

Modified: scummvm/trunk/engines/scumm/debugger.cpp
===================================================================
--- scummvm/trunk/engines/scumm/debugger.cpp	2007-09-07 20:47:31 UTC (rev 28876)
+++ scummvm/trunk/engines/scumm/debugger.cpp	2007-09-08 11:15:27 UTC (rev 28877)
@@ -652,7 +652,7 @@
 
 
 static void hlineColor(ScummEngine *scumm, int x1, int x2, int y, byte color) {
-	VirtScreen *vs = &scumm->virtscr[0];
+	VirtScreen *vs = &scumm->_virtscr[kMainVirtScreen];
 	byte *ptr;
 
 	// Clip y

Modified: scummvm/trunk/engines/scumm/gfx.cpp
===================================================================
--- scummvm/trunk/engines/scumm/gfx.cpp	2007-09-07 20:47:31 UTC (rev 28876)
+++ scummvm/trunk/engines/scumm/gfx.cpp	2007-09-08 11:15:27 UTC (rev 28877)
@@ -51,6 +51,7 @@
 static void clear8Col(byte *dst, int dstPitch, int height);
 
 static void ditherHerc(byte *src, byte *hercbuf, int srcPitch, int *x, int *y, int *width, int *height);
+static void scale2x(byte *dst, int dstPitch, const byte *src, int srcPitch, int w, int h);
 
 struct StripTable {
 	int offsets[160];
@@ -318,7 +319,7 @@
 
 void ScummEngine::initVirtScreen(VirtScreenNumber slot, int top, int width, int height, bool twobufs,
 													 bool scrollable) {
-	VirtScreen *vs = &virtscr[slot];
+	VirtScreen *vs = &_virtscr[slot];
 	int size;
 
 	assert(height >= 0);
@@ -374,7 +375,7 @@
 }
 
 VirtScreen *ScummEngine::findVirtScreen(int y) {
-	VirtScreen *vs = virtscr;
+	VirtScreen *vs = _virtscr;
 	int i;
 
 	for (i = 0; i < 3; i++, vs++) {
@@ -386,7 +387,7 @@
 }
 
 void ScummEngine::markRectAsDirty(VirtScreenNumber virt, int left, int right, int top, int bottom, int dirtybit) {
-	VirtScreen *vs = &virtscr[virt];
+	VirtScreen *vs = &_virtscr[virt];
 	int lp, rp;
 
 	if (left > right || top > bottom)
@@ -452,7 +453,7 @@
 	// Update game area ("stage")
 	if (camera._last.x != camera._cur.x || (_game.version >= 7 && (camera._cur.y != camera._last.y))) {
 		// Camera moved: redraw everything
-		VirtScreen *vs = &virtscr[kMainVirtScreen];
+		VirtScreen *vs = &_virtscr[kMainVirtScreen];
 		drawStripToScreen(vs, 0, vs->w, 0, vs->h);
 		vs->setDirtyRange(vs->h, 0);
 	} else {
@@ -497,7 +498,7 @@
  * a full blit is done, otherwise only the visible dirty areas are updated.
  */
 void ScummEngine::updateDirtyScreen(VirtScreenNumber slot) {
-	VirtScreen *vs = &virtscr[slot];
+	VirtScreen *vs = &_virtscr[slot];
 
 	// Do nothing for unused virtual screens
 	if (vs->h == 0)
@@ -741,7 +742,7 @@
 	*height = dsty - *y;
 }
 
-void ScummEngine::scale2x(byte *dst, int dstPitch, const byte *src, int srcPitch, int w, int h) {
+void scale2x(byte *dst, int dstPitch, const byte *src, int srcPitch, int w, int h) {
 	byte *dstL1 = dst;
 	byte *dstL2 = dst + dstPitch;
 
@@ -775,7 +776,7 @@
 		// Resize main virtual screen in V7 games. This is necessary
 		// because in V7, rooms may be higher than one screen, so we have
 		// to accomodate for that.
-		initVirtScreen(kMainVirtScreen, virtscr[0].topline, _screenWidth, height, true, true);
+		initVirtScreen(kMainVirtScreen, _virtscr[kMainVirtScreen].topline, _screenWidth, height, true, true);
 	}
 
 	if (_game.heversion >= 70)
@@ -899,7 +900,7 @@
 	byte *room = getResourceAddress(rtRoomImage, _roomResource) + _IM00_offs;
 	if (_fullRedraw) {
 		_bgNeedsRedraw = false;
-		_gdi->drawBMAPBg(room, &virtscr[0]);
+		_gdi->drawBMAPBg(room, &_virtscr[kMainVirtScreen]);
 	}
 
 	drawRoomObjects(0);
@@ -925,7 +926,7 @@
 	else
 		room = getResourceAddress(rtRoom, _roomResource);
 
-	_gdi->drawBitmap(room + _IM00_offs, &virtscr[0], s, 0, _roomWidth, virtscr[0].h, s, num, 0);
+	_gdi->drawBitmap(room + _IM00_offs, &_virtscr[kMainVirtScreen], s, 0, _roomWidth, _virtscr[kMainVirtScreen].h, s, num, 0);
 }
 
 void ScummEngine::restoreBackground(Common::Rect rect, byte backColor) {
@@ -983,7 +984,7 @@
 		// restoreBackground(), but was changed to only restore those parts which are
 		// currently covered by the charset mask.
 
-		VirtScreen *vs = &virtscr[_charset->_textScreenID];
+		VirtScreen *vs = &_virtscr[_charset->_textScreenID];
 		if (!vs->h)
 			return;
 
@@ -1018,7 +1019,7 @@
 }
 
 byte *ScummEngine::getMaskBuffer(int x, int y, int z) {
-	return _gdi->getMaskBuffer((x + virtscr[0].xstart) / 8, y, z);
+	return _gdi->getMaskBuffer((x + _virtscr[kMainVirtScreen].xstart) / 8, y, z);
 }
 
 byte *Gdi::getMaskBuffer(int x, int y, int z) {
@@ -1219,7 +1220,7 @@
 
 void ScummEngine_v5::drawFlashlight() {
 	int i, j, x, y;
-	VirtScreen *vs = &virtscr[kMainVirtScreen];
+	VirtScreen *vs = &_virtscr[kMainVirtScreen];
 
 	// Remove the flash light first if it was previously drawn
 	if (_flashlight.isDrawn) {
@@ -1919,7 +1920,7 @@
 
 	if (code == 8 || code == 9) {
 		Common::Rect rScreen(0, 0, vs->w, vs->h);
-		byte *dst = (byte *)_vm->virtscr[0].backBuf + scrX;
+		byte *dst = (byte *)_vm->_virtscr[kMainVirtScreen].backBuf + scrX;
 		Wiz::copyWizImage(dst, bmap_ptr, vs->w, vs->h, x - scrX, y, w, h, &rScreen);
 	}
 
@@ -1939,7 +1940,7 @@
 
 void ScummEngine_v70he::restoreBackgroundHE(Common::Rect rect, int dirtybit) {
 	byte *src, *dst;
-	VirtScreen *vs = &virtscr[0];
+	VirtScreen *vs = &_virtscr[kMainVirtScreen];
 
 	if (rect.top > vs->h || rect.bottom < 0)
 		return;
@@ -1965,12 +1966,12 @@
 	if (rw == 0 || rh == 0)
 		return;
 
-	src = virtscr[0].getBackPixels(rect.left, rect.top);
-	dst = virtscr[0].getPixels(rect.left, rect.top);
+	src = _virtscr[kMainVirtScreen].getBackPixels(rect.left, rect.top);
+	dst = _virtscr[kMainVirtScreen].getPixels(rect.left, rect.top);
 	
 	assert(rw <= _screenWidth && rw > 0);
 	assert(rh <= _screenHeight && rh > 0);
-	blit(dst, virtscr[0].pitch, src, virtscr[0].pitch, rw, rh);
+	blit(dst, _virtscr[kMainVirtScreen].pitch, src, _virtscr[kMainVirtScreen].pitch, rw, rh);
 	markRectAsDirty(kMainVirtScreen, rect, dirtybit);
 }
 #endif
@@ -1979,7 +1980,7 @@
  * Reset the background behind an actor or blast object.
  */
 void Gdi::resetBackground(int top, int bottom, int strip) {
-	VirtScreen *vs = &_vm->virtscr[0];
+	VirtScreen *vs = &_vm->_virtscr[kMainVirtScreen];
 	byte *backbuff_ptr, *bgbak_ptr;
 	int numLinesToProcess;
 	
@@ -3158,7 +3159,7 @@
 		// that broke the FOA intro. Probably other things as well.
 		//
 		// Hopefully it's safe to do it at this point, at least.
-		virtscr[0].setDirtyRange(0, 0);
+		_virtscr[kMainVirtScreen].setDirtyRange(0, 0);
  		transitionEffect(effect - 1);
 		break;
 	case 128:
@@ -3176,7 +3177,7 @@
 		dissolveEffect(1, 1);
 		break;
 	case 135:
-		dissolveEffect(1, virtscr[0].h);
+		dissolveEffect(1, _virtscr[kMainVirtScreen].h);
 		break;
 	default:
 		error("Unknown screen effect, %d", effect);
@@ -3185,7 +3186,7 @@
 }
 
 void ScummEngine::fadeOut(int effect) {
-	VirtScreen *vs = &virtscr[0];
+	VirtScreen *vs = &_virtscr[kMainVirtScreen];
 
 	vs->setDirtyRange(0, 0);
 	if (_game.version < 7)
@@ -3222,7 +3223,7 @@
 			dissolveEffect(1, 1);
 			break;
 		case 135:
-			dissolveEffect(1, virtscr[0].h);
+			dissolveEffect(1, _virtscr[kMainVirtScreen].h);
 			break;
 		default:
 			error("fadeOut: default case %d", effect);
@@ -3252,7 +3253,7 @@
 	int i, j;
 	int bottom;
 	int l, t, r, b;
-	const int height = MIN((int)virtscr[0].h, _screenHeight);
+	const int height = MIN((int)_virtscr[kMainVirtScreen].h, _screenHeight);
 	const int delay = (VAR_FADE_DELAY != 0xFF) ? VAR(VAR_FADE_DELAY) * kFadeDelay : kPictureDelay;
 
 	for (i = 0; i < 16; i++) {
@@ -3274,8 +3275,8 @@
 			if (t == b) {
 				while (l <= r) {
 					if (l >= 0 && l < _gdi->_numStrips && t < bottom) {
-						virtscr[0].tdirty[l] = _screenTop + t * 8;
-						virtscr[0].bdirty[l] = _screenTop + (b + 1) * 8;
+						_virtscr[kMainVirtScreen].tdirty[l] = _screenTop + t * 8;
+						_virtscr[kMainVirtScreen].bdirty[l] = _screenTop + (b + 1) * 8;
 					}
 					l++;
 				}
@@ -3286,8 +3287,8 @@
 					b = bottom;
 				if (t < 0)
 					t = 0;
- 				virtscr[0].tdirty[l] = _screenTop + t * 8;
-				virtscr[0].bdirty[l] = _screenTop + (b + 1) * 8;
+ 				_virtscr[kMainVirtScreen].tdirty[l] = _screenTop + t * 8;
+				_virtscr[kMainVirtScreen].bdirty[l] = _screenTop + (b + 1) * 8;
 			}
 			updateDirtyScreen(kMainVirtScreen);
 		}
@@ -3310,7 +3311,7 @@
  * dissolveEffect(virtsrc[0].width, 1) produces a line-by-line dissolve
  */
 void ScummEngine::dissolveEffect(int width, int height) {
-	VirtScreen *vs = &virtscr[0];
+	VirtScreen *vs = &_virtscr[kMainVirtScreen];
 	int *offsets;
 	int blits_before_refresh, blits;
 	int x, y;
@@ -3419,7 +3420,7 @@
 }
 
 void ScummEngine::scrollEffect(int dir) {
-	VirtScreen *vs = &virtscr[0];
+	VirtScreen *vs = &_virtscr[kMainVirtScreen];
 
 	int x, y;
 	int step;

Modified: scummvm/trunk/engines/scumm/gfx.h
===================================================================
--- scummvm/trunk/engines/scumm/gfx.h	2007-09-07 20:47:31 UTC (rev 28876)
+++ scummvm/trunk/engines/scumm/gfx.h	2007-09-08 11:15:27 UTC (rev 28877)
@@ -84,7 +84,7 @@
 struct VirtScreen : Graphics::Surface {
 	/**
 	 * The unique id of this screen (corresponds to its position in the
-	 * ScummEngine:virtscr array).
+	 * ScummEngine:_virtscr array).
 	 */
 	VirtScreenNumber number;
 

Modified: scummvm/trunk/engines/scumm/he/animation_he.cpp
===================================================================
--- scummvm/trunk/engines/scumm/he/animation_he.cpp	2007-09-07 20:47:31 UTC (rev 28876)
+++ scummvm/trunk/engines/scumm/he/animation_he.cpp	2007-09-08 11:15:27 UTC (rev 28877)
@@ -89,7 +89,7 @@
 		return;
 	}
 
-	VirtScreen *pvs = &_vm->virtscr[kMainVirtScreen];
+	VirtScreen *pvs = &_vm->_virtscr[kMainVirtScreen];
 
 	decodeNextFrame();
 

Modified: scummvm/trunk/engines/scumm/he/floodfill_he.cpp
===================================================================
--- scummvm/trunk/engines/scumm/he/floodfill_he.cpp	2007-09-07 20:47:31 UTC (rev 28876)
+++ scummvm/trunk/engines/scumm/he/floodfill_he.cpp	2007-09-08 11:15:27 UTC (rev 28877)
@@ -179,7 +179,7 @@
 
 void floodFill(FloodFillParameters *ffp, ScummEngine_v90he *vm) {
 	uint8 *dst;
-	VirtScreen *vs = &vm->virtscr[kMainVirtScreen];
+	VirtScreen *vs = &vm->_virtscr[kMainVirtScreen];
 	if (ffp->flags & 0x8000) {
 		dst = vs->getBackPixels(0, vs->topline);
 	} else {

Modified: scummvm/trunk/engines/scumm/he/script_v60he.cpp
===================================================================
--- scummvm/trunk/engines/scumm/he/script_v60he.cpp	2007-09-07 20:47:31 UTC (rev 28876)
+++ scummvm/trunk/engines/scumm/he/script_v60he.cpp	2007-09-08 11:15:27 UTC (rev 28877)
@@ -801,7 +801,7 @@
 void ScummEngine_v60he::virtScreenLoad(int resIdx, int x1, int y1, int x2, int y2) {
 	vsUnpackCtx ctx;
 	memset(&ctx, 0, sizeof(ctx));
-	VirtScreen &vs = virtscr[kMainVirtScreen];
+	VirtScreen &vs = _virtscr[kMainVirtScreen];
 
 	ArrayHeader *ah = (ArrayHeader *)getResourceAddress(rtString, resIdx);
 	virtScreenLoadUnpack(&ctx, ah->data);
@@ -875,7 +875,7 @@
 
 int ScummEngine_v60he::virtScreenSave(byte *dst, int x1, int y1, int x2, int y2) {
 	int packedSize = 0;
-	VirtScreen &vs = virtscr[kMainVirtScreen];
+	VirtScreen &vs = _virtscr[kMainVirtScreen];
 
 	for (int j = y1; j <= y2; ++j) {
 		uint8 *p = vs.getBackPixels(x1, j - vs.topline);

Modified: scummvm/trunk/engines/scumm/he/sprite_he.cpp
===================================================================
--- scummvm/trunk/engines/scumm/he/sprite_he.cpp	2007-09-07 20:47:31 UTC (rev 28876)
+++ scummvm/trunk/engines/scumm/he/sprite_he.cpp	2007-09-08 11:15:27 UTC (rev 28877)
@@ -1120,7 +1120,7 @@
 }
 
 void Sprite::setRedrawFlags(bool checkZOrder) {
-	VirtScreen *vs = &_vm->virtscr[kMainVirtScreen];
+	VirtScreen *vs = &_vm->_virtscr[kMainVirtScreen];
 	for (int i = 0; i < _numSpritesToProcess; ++i) {
 		SpriteInfo *spi = _activeSpritesTable[i];
 		if (!(spi->flags & kSFNeedRedraw)) {

Modified: scummvm/trunk/engines/scumm/he/wiz_he.cpp
===================================================================
--- scummvm/trunk/engines/scumm/he/wiz_he.cpp	2007-09-07 20:47:31 UTC (rev 28876)
+++ scummvm/trunk/engines/scumm/he/wiz_he.cpp	2007-09-08 11:15:27 UTC (rev 28877)
@@ -1009,7 +1009,7 @@
 void Wiz::captureWizImage(int resNum, const Common::Rect& r, bool backBuffer, int compType) {
 	debug(5, "ScummEngine_v72he::captureWizImage(%d, %d, [%d,%d,%d,%d])", resNum, compType, r.left, r.top, r.right, r.bottom);
 	uint8 *src = NULL;
-	VirtScreen *pvs = &_vm->virtscr[kMainVirtScreen];
+	VirtScreen *pvs = &_vm->_virtscr[kMainVirtScreen];
 	if (backBuffer) {
 		src = pvs->getBackPixels(0, 0);
 	} else {
@@ -1182,7 +1182,7 @@
 			assert(dst);
 			getWizImageDim(dstResNum, 0, cw, ch);
 		} else {
-			VirtScreen *pvs = &_vm->virtscr[kMainVirtScreen];
+			VirtScreen *pvs = &_vm->_virtscr[kMainVirtScreen];
 			if (flags & kWIFMarkBufferDirty) {
 				dst = pvs->getPixels(0, pvs->topline);
 			} else {
@@ -1377,7 +1377,7 @@
 	if (srcWizBuf) {
 		uint8 *dst;
 		int32 dstw, dsth, dstpitch, wizW, wizH;
-		VirtScreen *pvs = &_vm->virtscr[kMainVirtScreen];
+		VirtScreen *pvs = &_vm->_virtscr[kMainVirtScreen];
 		int transColor = (_vm->VAR_WIZ_TCOLOR != 0xFF) ? _vm->VAR(_vm->VAR_WIZ_TCOLOR) : 5;
 
 		if (dstResNum) {

Modified: scummvm/trunk/engines/scumm/input.cpp
===================================================================
--- scummvm/trunk/engines/scumm/input.cpp	2007-09-07 20:47:31 UTC (rev 28876)
+++ scummvm/trunk/engines/scumm/input.cpp	2007-09-08 11:15:27 UTC (rev 28877)
@@ -249,14 +249,15 @@
 	if (_mouse.y > _screenHeight-1)
 		_mouse.y = _screenHeight-1;
 
-	_virtualMouse.x = _mouse.x + virtscr[0].xstart;
-	_virtualMouse.y = _mouse.y - virtscr[0].topline;
+	VirtScreen *vs = &_virtscr[kMainVirtScreen];
+	_virtualMouse.x = _mouse.x + vs->xstart;
+	_virtualMouse.y = _mouse.y - vs->topline;
 	if (_game.version >= 7)
 		_virtualMouse.y += _screenTop;
 
 	if (_virtualMouse.y < 0)
 		_virtualMouse.y = -1;
-	if (_virtualMouse.y >= virtscr[0].h)
+	if (_virtualMouse.y >= vs->h)
 		_virtualMouse.y = -1;
 
 	//

Modified: scummvm/trunk/engines/scumm/object.cpp
===================================================================
--- scummvm/trunk/engines/scumm/object.cpp	2007-09-07 20:47:31 UTC (rev 28876)
+++ scummvm/trunk/engines/scumm/object.cpp	2007-09-08 11:15:27 UTC (rev 28877)
@@ -619,10 +619,10 @@
 
 #ifndef DISABLE_HE
 		if (_game.heversion >= 70 && findResource(MKID_BE('SMAP'), ptr) == NULL)
-			_gdi->drawBMAPObject(ptr, &virtscr[0], obj, od.x_pos, od.y_pos, od.width, od.height);
+			_gdi->drawBMAPObject(ptr, &_virtscr[kMainVirtScreen], obj, od.x_pos, od.y_pos, od.width, od.height);
 		else
 #endif
-			_gdi->drawBitmap(ptr, &virtscr[0], x, ypos, width * 8, height, x - xpos, numstrip, flags);
+			_gdi->drawBitmap(ptr, &_virtscr[kMainVirtScreen], x, ypos, width * 8, height, x - xpos, numstrip, flags);
 	}
 }
 
@@ -1626,7 +1626,7 @@
 	int objnum;
 	BompDrawData bdd;
 
-	vs = &virtscr[0];
+	vs = &_virtscr[kMainVirtScreen];
 
 	assertRange(30, eo->number, _numGlobalObjects - 1, "blast object");
 
@@ -1704,7 +1704,7 @@
 }
 
 void ScummEngine_v6::removeBlastObject(BlastObject *eo) {
-	VirtScreen *vs = &virtscr[0];
+	VirtScreen *vs = &_virtscr[kMainVirtScreen];
 
 	Common::Rect r;
 	int left_strip, right_strip;

Modified: scummvm/trunk/engines/scumm/saveload.cpp
===================================================================
--- scummvm/trunk/engines/scumm/saveload.cpp	2007-09-07 20:47:31 UTC (rev 28876)
+++ scummvm/trunk/engines/scumm/saveload.cpp	2007-09-08 11:15:27 UTC (rev 28877)
@@ -344,7 +344,7 @@
 	// Restore the virtual screens and force a fade to black.
 	initScreens(0, _screenHeight);
 
-	VirtScreen *vs = &virtscr[kMainVirtScreen];
+	VirtScreen *vs = &_virtscr[kMainVirtScreen];
 	memset(vs->getPixels(0, 0), 0, vs->pitch * vs->h);
 	vs->setDirtyRange(0, vs->h);
 	updateDirtyScreen(kMainVirtScreen);

Modified: scummvm/trunk/engines/scumm/script_v0.cpp
===================================================================
--- scummvm/trunk/engines/scumm/script_v0.cpp	2007-09-07 20:47:31 UTC (rev 28876)
+++ scummvm/trunk/engines/scumm/script_v0.cpp	2007-09-08 11:15:27 UTC (rev 28877)
@@ -527,9 +527,9 @@
 	}
 
 	_string[2].charset = 1;
-	_string[2].ypos = virtscr[kVerbVirtScreen].topline;
+	_string[2].ypos = _virtscr[kVerbVirtScreen].topline;
 	_string[2].xpos = 0;
-	_string[2].right = virtscr[kVerbVirtScreen].w - 1;
+	_string[2].right = _virtscr[kVerbVirtScreen].w - 1;
 	_string[2].color = 16;
 
 	byte string[80];
@@ -550,10 +550,10 @@
 	}
 	string[i] = 0;
 
-	sentenceline.top = virtscr[kVerbVirtScreen].topline;
-	sentenceline.bottom = virtscr[kVerbVirtScreen].topline + 8;
+	sentenceline.top = _virtscr[kVerbVirtScreen].topline;
+	sentenceline.bottom = _virtscr[kVerbVirtScreen].topline + 8;
 	sentenceline.left = 0;
-	sentenceline.right = virtscr[kVerbVirtScreen].w - 1;
+	sentenceline.right = _virtscr[kVerbVirtScreen].w - 1;
 	restoreBackground(sentenceline);
 
 	drawString(2, (byte*)string);

Modified: scummvm/trunk/engines/scumm/script_v2.cpp
===================================================================
--- scummvm/trunk/engines/scumm/script_v2.cpp	2007-09-07 20:47:31 UTC (rev 28876)
+++ scummvm/trunk/engines/scumm/script_v2.cpp	2007-09-08 11:15:27 UTC (rev 28877)
@@ -1053,9 +1053,9 @@
 	}
 
 	_string[2].charset = 1;
-	_string[2].ypos = virtscr[kVerbVirtScreen].topline;
+	_string[2].ypos = _virtscr[kVerbVirtScreen].topline;
 	_string[2].xpos = 0;
-	_string[2].right = virtscr[kVerbVirtScreen].w - 1;
+	_string[2].right = _virtscr[kVerbVirtScreen].w - 1;
 	if (_game.platform == Common::kPlatformNES) {
 		_string[2].xpos = 16;
 		_string[2].color = 0;
@@ -1087,15 +1087,15 @@
 	string[i] = 0;
 
 	if (_game.platform == Common::kPlatformNES) {
-		sentenceline.top = virtscr[kVerbVirtScreen].topline;
-		sentenceline.bottom = virtscr[kVerbVirtScreen].topline + 16;
+		sentenceline.top = _virtscr[kVerbVirtScreen].topline;
+		sentenceline.bottom = _virtscr[kVerbVirtScreen].topline + 16;
 		sentenceline.left = 16;
-		sentenceline.right = virtscr[kVerbVirtScreen].w - 1;
+		sentenceline.right = _virtscr[kVerbVirtScreen].w - 1;
 	} else {
-		sentenceline.top = virtscr[kVerbVirtScreen].topline;
-		sentenceline.bottom = virtscr[kVerbVirtScreen].topline + 8;
+		sentenceline.top = _virtscr[kVerbVirtScreen].topline;
+		sentenceline.bottom = _virtscr[kVerbVirtScreen].topline + 8;
 		sentenceline.left = 0;
-		sentenceline.right = virtscr[kVerbVirtScreen].w - 1;
+		sentenceline.right = _virtscr[kVerbVirtScreen].w - 1;
 	}
 	restoreBackground(sentenceline);
 
@@ -1590,9 +1590,9 @@
 
 	// Hide all verbs and inventory
 	Common::Rect rect;
-	rect.top = virtscr[kVerbVirtScreen].topline;
-	rect.bottom = virtscr[kVerbVirtScreen].topline + 8 * 88;
-	rect.right = virtscr[kVerbVirtScreen].w - 1;
+	rect.top = _virtscr[kVerbVirtScreen].topline;
+	rect.bottom = _virtscr[kVerbVirtScreen].topline + 8 * 88;
+	rect.right = _virtscr[kVerbVirtScreen].w - 1;
 	if (_game.platform == Common::kPlatformNES) {
 		rect.left = 16;
 	} else {

Modified: scummvm/trunk/engines/scumm/script_v5.cpp
===================================================================
--- scummvm/trunk/engines/scumm/script_v5.cpp	2007-09-07 20:47:31 UTC (rev 28876)
+++ scummvm/trunk/engines/scumm/script_v5.cpp	2007-09-08 11:15:27 UTC (rev 28877)
@@ -2929,8 +2929,8 @@
 
 				// For now, we force a redraw of the screen background. This
 				// way the Zak end credits seem to work mostly correct.
-				VirtScreen *vs = &virtscr[0];
-				restoreBackground(Common::Rect(0,vs->topline, vs->w, vs->topline + vs->h));
+				VirtScreen *vs = &_virtscr[kMainVirtScreen];
+				restoreBackground(Common::Rect(0, vs->topline, vs->w, vs->topline + vs->h));
 				vs->setDirtyRange(0, vs->h);
 				updateDirtyScreen(kMainVirtScreen);
 

Modified: scummvm/trunk/engines/scumm/script_v6.cpp
===================================================================
--- scummvm/trunk/engines/scumm/script_v6.cpp	2007-09-07 20:47:31 UTC (rev 28876)
+++ scummvm/trunk/engines/scumm/script_v6.cpp	2007-09-08 11:15:27 UTC (rev 28877)
@@ -2715,7 +2715,7 @@
 	int i;
 	int slot;
 	Actor *a;
-	VirtScreen *vs = &virtscr[0];
+	VirtScreen *vs = &_virtscr[kMainVirtScreen];
 
 	getStackList(args, ARRAYSIZE(args));
 

Modified: scummvm/trunk/engines/scumm/scumm.cpp
===================================================================
--- scummvm/trunk/engines/scumm/scumm.cpp	2007-09-07 20:47:31 UTC (rev 28876)
+++ scummvm/trunk/engines/scumm/scumm.cpp	2007-09-08 11:15:27 UTC (rev 28877)
@@ -228,7 +228,7 @@
 	_roomWidth = 0;
 	_screenHeight = 0;
 	_screenWidth = 0;
-	memset(virtscr, 0, sizeof(virtscr));
+	memset(_virtscr, 0, sizeof(_virtscr));
 	memset(&camera, 0, sizeof(CameraData));
 	memset(_colorCycle, 0, sizeof(_colorCycle));
 	memset(_colorUsedByCycle, 0, sizeof(_colorUsedByCycle));
@@ -1377,7 +1377,7 @@
 	}
 	camera._follows = 0;
 
-	virtscr[0].xstart = 0;
+	_virtscr[0].xstart = 0;
 
 	_mouse.x = 104;
 	_mouse.y = 56;

Modified: scummvm/trunk/engines/scumm/scumm.h
===================================================================
--- scummvm/trunk/engines/scumm/scumm.h	2007-09-07 20:47:31 UTC (rev 28876)
+++ scummvm/trunk/engines/scumm/scumm.h	2007-09-08 11:15:27 UTC (rev 28877)
@@ -917,7 +917,7 @@
 public:
 	int _roomHeight, _roomWidth;
 	int _screenHeight, _screenWidth;
-	VirtScreen virtscr[4];		// Virtual screen areas
+	VirtScreen _virtscr[4];		// Virtual screen areas
 	CameraData camera;			// 'Camera' - viewport
 
 	int _screenStartStrip, _screenEndStrip;
@@ -1031,7 +1031,6 @@
 	void updateDirtyScreen(VirtScreenNumber slot);
 	void drawStripToScreen(VirtScreen *vs, int x, int w, int t, int b);
 	void ditherCGA(byte *dst, int dstPitch, int x, int y, int width, int height) const;
-	void scale2x(byte *dst, int dstPitch, const byte *src, int srcPitch, int w, int h);
 
 public:
 	VirtScreen *findVirtScreen(int y);

Modified: scummvm/trunk/engines/scumm/smush/smush_player.cpp
===================================================================
--- scummvm/trunk/engines/scumm/smush/smush_player.cpp	2007-09-07 20:47:31 UTC (rev 28876)
+++ scummvm/trunk/engines/scumm/smush/smush_player.cpp	2007-09-08 11:15:27 UTC (rev 28877)
@@ -265,6 +265,8 @@
 }
 
 void SmushPlayer::init(int32 speed) {
+	VirtScreen *vs = &_vm->_virtscr[kMainVirtScreen];
+
 	_frame = 0;
 	_speed = speed;
 	_endOfFile = false;
@@ -273,7 +275,7 @@
 	_vm->_smushActive = true;
 
 	_vm->setDirtyColors(0, 255);
-	_dst = _vm->virtscr[0].getPixels(0, 0);
+	_dst = vs->getPixels(0, 0);
 
 	// HACK HACK HACK: This is an *evil* trick, beware!
 	// We do this to fix bug #1037052. A proper solution would change all the
@@ -281,10 +283,10 @@
 	// However, since a lot of the SMUSH code currently assumes the screen
 	// width and pitch to be equal, this will require lots of changes. So
 	// we resort to this hackish solution for now.
-	_origPitch = _vm->virtscr[0].pitch;
+	_origPitch = vs->pitch;
 	_origNumStrips = _vm->_gdi->_numStrips;
-	_vm->virtscr[0].pitch = _vm->virtscr[0].w;
-	_vm->_gdi->_numStrips = _vm->virtscr[0].w / 8;
+	vs->pitch = vs->w;
+	_vm->_gdi->_numStrips = vs->w / 8;
 
 	_vm->_mixer->stopHandle(_compressedFileSoundHandle);
 	_vm->_mixer->stopHandle(_IACTchannel);
@@ -319,7 +321,7 @@
 
 	// HACK HACK HACK: This is an *evil* trick, beware! See above for
 	// some explanation.
-	_vm->virtscr[0].pitch = _origPitch;
+	_vm->_virtscr[kMainVirtScreen].pitch = _origPitch;
 	_vm->_gdi->_numStrips = _origNumStrips;
 
 	delete _codec37;

Modified: scummvm/trunk/engines/scumm/string.cpp
===================================================================
--- scummvm/trunk/engines/scumm/string.cpp	2007-09-07 20:47:31 UTC (rev 28876)
+++ scummvm/trunk/engines/scumm/string.cpp	2007-09-08 11:15:27 UTC (rev 28877)
@@ -456,7 +456,7 @@
 	if (a && _string[0].overhead) {
 		int s;
 
-		_string[0].xpos = a->getPos().x - virtscr[0].xstart;
+		_string[0].xpos = a->getPos().x - _virtscr[kMainVirtScreen].xstart;
 		_string[0].ypos = a->getPos().y - a->getElevation() - _screenTop;
 
 		if (_game.version <= 5) {
@@ -678,7 +678,7 @@
 	if (a && _string[0].overhead) {
 		int s;
 
-		_string[0].xpos = a->getPos().x - virtscr[0].xstart;
+		_string[0].xpos = a->getPos().x - _virtscr[kMainVirtScreen].xstart;
 		s = a->_scalex * a->_talkPosX / 255;
 		_string[0].xpos += (a->_talkPosX - s) / 2 + s;
 

Modified: scummvm/trunk/engines/scumm/verbs.cpp
===================================================================
--- scummvm/trunk/engines/scumm/verbs.cpp	2007-09-07 20:47:31 UTC (rev 28876)
+++ scummvm/trunk/engines/scumm/verbs.cpp	2007-09-08 11:15:27 UTC (rev 28877)
@@ -86,7 +86,7 @@
 };
 
 void ScummEngine_v0::resetVerbs() {
-	VirtScreen *virt = &virtscr[kVerbVirtScreen];
+	VirtScreen *virt = &_virtscr[kVerbVirtScreen];
 	VerbSlot *vs;
 	int i;
 
@@ -121,7 +121,7 @@
 }
 
 void ScummEngine_v0::setNewKidVerbs() {
-	VirtScreen *virt = &virtscr[kVerbVirtScreen];
+	VirtScreen *virt = &_virtscr[kVerbVirtScreen];
 	VerbSlot *vs;
 	int i;
 
@@ -283,7 +283,7 @@
 }
 
 void ScummEngine_v2::checkV2MouseOver(Common::Point pos) {
-	VirtScreen *vs = &virtscr[kVerbVirtScreen];
+	VirtScreen *vs = &_virtscr[kVerbVirtScreen];
 	Common::Rect rect;
 	byte *ptr, *dst;
 	int i, x, y, new_box = -1;
@@ -346,7 +346,7 @@
 	int inventoryArea = (_game.platform == Common::kPlatformNES) ? 48: 32;
 	int object = 0;
 
-	y -= virtscr[kVerbVirtScreen].topline;
+	y -= _virtscr[kVerbVirtScreen].topline;
 
 	if ((y < inventoryArea) || !(_mouseAndKeyboardStat & MBS_LEFT_CLICK))
 		return;
@@ -391,7 +391,7 @@
 }
 
 void ScummEngine_v2::redrawV2Inventory() {
-	VirtScreen *vs = &virtscr[kVerbVirtScreen];
+	VirtScreen *vs = &_virtscr[kVerbVirtScreen];
 	int i;
 	int max_inv;
 	Common::Rect inventoryBox;
@@ -405,7 +405,7 @@
 
 	// Clear on all invocations
 	inventoryBox.top = vs->topline + inventoryArea;
-	inventoryBox.bottom = vs->topline + virtscr[kVerbVirtScreen].h;
+	inventoryBox.bottom = vs->topline + vs->h;
 	inventoryBox.left = 0;
 	inventoryBox.right = vs->w;
 	restoreBackground(inventoryBox);


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