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

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Sun Sep 17 22:23:12 CEST 2006


Revision: 23921
          http://svn.sourceforge.net/scummvm/?rev=23921&view=rev
Author:   fingolfin
Date:     2006-09-17 13:22:47 -0700 (Sun, 17 Sep 2006)

Log Message:
-----------
Changed ScummEngine::gdi to _gdi and allocate the Gdi object on the heap (i.e. _gdi is a pointer now)

Modified Paths:
--------------
    scummvm/trunk/engines/scumm/actor.cpp
    scummvm/trunk/engines/scumm/bomp.cpp
    scummvm/trunk/engines/scumm/camera.cpp
    scummvm/trunk/engines/scumm/charset.cpp
    scummvm/trunk/engines/scumm/cursor.cpp
    scummvm/trunk/engines/scumm/gfx.cpp
    scummvm/trunk/engines/scumm/he/animation_he.cpp
    scummvm/trunk/engines/scumm/he/floodfill_he.cpp
    scummvm/trunk/engines/scumm/he/script_v100he.cpp
    scummvm/trunk/engines/scumm/he/script_v72he.cpp
    scummvm/trunk/engines/scumm/he/sprite_he.cpp
    scummvm/trunk/engines/scumm/he/wiz_he.cpp
    scummvm/trunk/engines/scumm/object.cpp
    scummvm/trunk/engines/scumm/room.cpp
    scummvm/trunk/engines/scumm/saveload.cpp
    scummvm/trunk/engines/scumm/script_v8.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/verbs.cpp

Modified: scummvm/trunk/engines/scumm/actor.cpp
===================================================================
--- scummvm/trunk/engines/scumm/actor.cpp	2006-09-17 20:21:40 UTC (rev 23920)
+++ scummvm/trunk/engines/scumm/actor.cpp	2006-09-17 20:22:47 UTC (rev 23921)
@@ -1153,8 +1153,8 @@
 		bcr->_zbuf = _forceClip;
 		if (bcr->_zbuf == 100) {
 			bcr->_zbuf = _vm->getMaskFromBox(_walkbox);
-			if (bcr->_zbuf > _vm->gdi._numZBuffer-1)
-				bcr->_zbuf = _vm->gdi._numZBuffer-1;
+			if (bcr->_zbuf > _vm->_gdi->_numZBuffer-1)
+				bcr->_zbuf = _vm->_gdi->_numZBuffer-1;
 		}
 
 	} else {
@@ -1164,8 +1164,8 @@
 			bcr->_zbuf = 0;
 		else {
 			bcr->_zbuf = _vm->getMaskFromBox(_walkbox);
-			if (bcr->_zbuf > _vm->gdi._numZBuffer-1)
-				bcr->_zbuf = _vm->gdi._numZBuffer-1;
+			if (bcr->_zbuf > _vm->_gdi->_numZBuffer-1)
+				bcr->_zbuf = _vm->_gdi->_numZBuffer-1;
 		}
 
 	}
@@ -1194,7 +1194,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[0], _vm->_gdi->_numStrips, this, _drawToBackBuf) & 1) {
 		_needRedraw = (_vm->_game.version <= 6);
 	}
 
@@ -1293,7 +1293,7 @@
 			_actors[j]._needRedraw = true;
 		}
 	} else {
-		for (i = 0; i < gdi._numStrips; i++) {
+		for (i = 0; i < _gdi->_numStrips; i++) {
 			int strip = _screenStartStrip + i;
 			if (testGfxAnyUsageBits(strip)) {
 				for (j = 1; j < _numActors; j++) {
@@ -1309,7 +1309,7 @@
 void ScummEngine::resetActorBgs() {
 	int i, j;
 
-	for (i = 0; i < gdi._numStrips; i++) {
+	for (i = 0; i < _gdi->_numStrips; i++) {
 		int strip = _screenStartStrip + i;
 		clearGfxUsageBit(strip, USAGE_BIT_DIRTY);
 		clearGfxUsageBit(strip, USAGE_BIT_RESTORED);
@@ -1321,7 +1321,7 @@
 				((_actors[j]._top != 0x7fffffff && _actors[j]._needRedraw) || _actors[j]._needBgReset)) {
 				clearGfxUsageBit(strip, j);
 				if ((_actors[j]._bottom - _actors[j]._top) >= 0)
-					gdi.resetBackground(_actors[j]._top, _actors[j]._bottom, i);
+					_gdi->resetBackground(_actors[j]._top, _actors[j]._bottom, i);
 			}
 		}
 	}
@@ -2095,7 +2095,7 @@
 		for (int i = 0; i < _auxBlocksNum; ++i) {
 			AuxBlock *ab = &_auxBlocks[i];
 			if (ab->r.top <= ab->r.bottom) {
-				gdi.copyVirtScreenBuffers(ab->r);
+				_gdi->copyVirtScreenBuffers(ab->r);
 			}
 		}
 	}

Modified: scummvm/trunk/engines/scumm/bomp.cpp
===================================================================
--- scummvm/trunk/engines/scumm/bomp.cpp	2006-09-17 20:21:40 UTC (rev 23920)
+++ scummvm/trunk/engines/scumm/bomp.cpp	2006-09-17 20:22:47 UTC (rev 23921)
@@ -241,7 +241,7 @@
 
 	// Mask against any additionally imposed mask
 	if (bd.maskPtr) {
-		mask = bd.maskPtr + (bd.y * gdi._numStrips) + ((bd.x + clip.left) / 8);
+		mask = bd.maskPtr + (bd.y * _gdi->_numStrips) + ((bd.x + clip.left) / 8);
 	}
 
 	// Setup vertical scaling
@@ -326,7 +326,7 @@
 
 		// Advance to the next line
 		pos_y++;
-		mask += gdi._numStrips;
+		mask += _gdi->_numStrips;
 		dst += bd.dst.pitch;
 	}
 }

Modified: scummvm/trunk/engines/scumm/camera.cpp
===================================================================
--- scummvm/trunk/engines/scumm/camera.cpp	2006-09-17 20:21:40 UTC (rev 23920)
+++ scummvm/trunk/engines/scumm/camera.cpp	2006-09-17 20:22:47 UTC (rev 23921)
@@ -186,8 +186,8 @@
 		}
 	}
 
-	_screenStartStrip = camera._cur.x / 8 - gdi._numStrips / 2;
-	_screenEndStrip = _screenStartStrip + gdi._numStrips - 1;
+	_screenStartStrip = camera._cur.x / 8 - _gdi->_numStrips / 2;
+	_screenEndStrip = _screenStartStrip + _gdi->_numStrips - 1;
 
 	_screenTop = camera._cur.y - (_screenHeight / 2);
 	if (_game.features & GF_NEW_CAMERA) {

Modified: scummvm/trunk/engines/scumm/charset.cpp
===================================================================
--- scummvm/trunk/engines/scumm/charset.cpp	2006-09-17 20:21:40 UTC (rev 23920)
+++ scummvm/trunk/engines/scumm/charset.cpp	2006-09-17 20:22:47 UTC (rev 23921)
@@ -1429,7 +1429,7 @@
 
 		if (_blitAlso && vs->hasTwoBuffers) {
 			Common::Rect dst(_left, _top, _left + origWidth, _top + origHeight);
-			_vm->gdi.copyVirtScreenBuffers(dst);
+			_vm->_gdi->copyVirtScreenBuffers(dst);
 		}
 #endif
 	} else {

Modified: scummvm/trunk/engines/scumm/cursor.cpp
===================================================================
--- scummvm/trunk/engines/scumm/cursor.cpp	2006-09-17 20:21:40 UTC (rev 23920)
+++ scummvm/trunk/engines/scumm/cursor.cpp	2006-09-17 20:22:47 UTC (rev 23921)
@@ -257,10 +257,10 @@
 	drawBox(0, 0, w - 1, h - 1, 0xFF);
 
 	vs->hasTwoBuffers = false;
-	gdi.disableZBuffer();
-	gdi.drawBitmap(im, vs, _screenStartStrip, 0, w, h, 0, w / 8, 0);
+	_gdi->disableZBuffer();
+	_gdi->drawBitmap(im, vs, _screenStartStrip, 0, w, h, 0, w / 8, 0);
 	vs->hasTwoBuffers = true;
-	gdi.enableZBuffer();
+	_gdi->enableZBuffer();
 
 	// Grab the data we just drew and setup the cursor with it
 	setCursorFromBuffer(vs->getPixels(0, 0), w, h, vs->pitch);

Modified: scummvm/trunk/engines/scumm/gfx.cpp
===================================================================
--- scummvm/trunk/engines/scumm/gfx.cpp	2006-09-17 20:21:40 UTC (rev 23920)
+++ scummvm/trunk/engines/scumm/gfx.cpp	2006-09-17 20:22:47 UTC (rev 23921)
@@ -290,7 +290,7 @@
 	_screenB = b;
 	_screenH = h;
 	
-	gdi.init();
+	_gdi->init();
 }
 
 void ScummEngine::initVirtScreen(VirtScreenNumber slot, int top, int width, int height, bool twobufs,
@@ -399,12 +399,12 @@
 	lp = left / 8;
 	rp = right / 8;
 
-	if ((lp >= gdi._numStrips) || (rp < 0))
+	if ((lp >= _gdi->_numStrips) || (rp < 0))
 		return;
 	if (lp < 0)
 		lp = 0;
-	if (rp >= gdi._numStrips)
-		rp = gdi._numStrips - 1;
+	if (rp >= _gdi->_numStrips)
+		rp = _gdi->_numStrips - 1;
 
 	while (lp <= rp) {
 		if (top < vs->tdirty[lp])
@@ -485,13 +485,13 @@
 	int w = 8;
 	int start = 0;
 
-	for (i = 0; i < gdi._numStrips; i++) {
+	for (i = 0; i < _gdi->_numStrips; i++) {
 		if (vs->bdirty[i]) {
 			const int top = vs->tdirty[i];
 			const int bottom = vs->bdirty[i];
 			vs->tdirty[i] = vs->h;
 			vs->bdirty[i] = 0;
-			if (i != (gdi._numStrips - 1) && vs->bdirty[i + 1] == bottom && vs->tdirty[i + 1] == top) {
+			if (i != (_gdi->_numStrips - 1) && vs->bdirty[i + 1] == bottom && vs->tdirty[i + 1] == top) {
 				// Simple optimizations: if two or more neighbouring strips
 				// form one bigger rectangle, coalesce them.
 				w += 8;
@@ -708,49 +708,49 @@
 		room = getResourceAddress(rtRoom, _roomResource);
 
 	if (_game.version <= 3) {
-		gdi._numZBuffer = 2;
+		_gdi->_numZBuffer = 2;
 	} else if (_game.features & GF_SMALL_HEADER) {
 		int off;
 		ptr = findResourceData(MKID_BE('SMAP'), room);
-		gdi._numZBuffer = 0;
+		_gdi->_numZBuffer = 0;
 
 		if (_game.features & GF_16COLOR)
 			off = READ_LE_UINT16(ptr);
 		else
 			off = READ_LE_UINT32(ptr);
 
-		while (off && gdi._numZBuffer < 4) {
-			gdi._numZBuffer++;
+		while (off && _gdi->_numZBuffer < 4) {
+			_gdi->_numZBuffer++;
 			ptr += off;
 			off = READ_LE_UINT16(ptr);
 		}
 	} else if (_game.version == 8) {
 		// in V8 there is no RMIH and num z buffers is in RMHD
 		ptr = findResource(MKID_BE('RMHD'), room);
-		gdi._numZBuffer = READ_LE_UINT32(ptr + 24) + 1;
+		_gdi->_numZBuffer = READ_LE_UINT32(ptr + 24) + 1;
 	} else if (_game.heversion >= 70) {
 		ptr = findResource(MKID_BE('RMIH'), room);
-		gdi._numZBuffer = READ_LE_UINT16(ptr + 8) + 1;
+		_gdi->_numZBuffer = READ_LE_UINT16(ptr + 8) + 1;
 	} else {
 		ptr = findResource(MKID_BE('RMIH'), findResource(MKID_BE('RMIM'), room));
-		gdi._numZBuffer = READ_LE_UINT16(ptr + 8) + 1;
+		_gdi->_numZBuffer = READ_LE_UINT16(ptr + 8) + 1;
 	}
-	assert(gdi._numZBuffer >= 1 && gdi._numZBuffer <= 8);
+	assert(_gdi->_numZBuffer >= 1 && _gdi->_numZBuffer <= 8);
 
 	if (_game.version >= 7)
-		itemsize = (_roomHeight + 10) * gdi._numStrips;
+		itemsize = (_roomHeight + 10) * _gdi->_numStrips;
 	else
-		itemsize = (_roomHeight + 4) * gdi._numStrips;
+		itemsize = (_roomHeight + 4) * _gdi->_numStrips;
 
 
-	size = itemsize * gdi._numZBuffer;
+	size = itemsize * _gdi->_numZBuffer;
 	memset(res.createResource(rtBuffer, 9, size), 0, size);
 
-	for (i = 0; i < (int)ARRAYSIZE(gdi._imgBufOffs); i++) {
-		if (i < gdi._numZBuffer)
-			gdi._imgBufOffs[i] = i * itemsize;
+	for (i = 0; i < (int)ARRAYSIZE(_gdi->_imgBufOffs); i++) {
+		if (i < _gdi->_numZBuffer)
+			_gdi->_imgBufOffs[i] = i * itemsize;
 		else
-			gdi._imgBufOffs[i] = (gdi._numZBuffer - 1) * itemsize;
+			_gdi->_imgBufOffs[i] = (_gdi->_numZBuffer - 1) * itemsize;
 	}
 }
 
@@ -769,7 +769,7 @@
 
 	// Redraw parts of the background which are marked as dirty.
 	if (!_fullRedraw && _bgNeedsRedraw) {
-		for (i = 0; i != gdi._numStrips; i++) {
+		for (i = 0; i != _gdi->_numStrips; i++) {
 			if (testGfxUsageBit(_screenStartStrip + i, USAGE_BIT_DIRTY)) {
 				redrawBGStrip(i, 1);
 			}
@@ -778,12 +778,12 @@
 
 	if (_game.features & GF_NEW_CAMERA) {
 		diff = camera._cur.x / 8 - camera._last.x / 8;
-		if (_fullRedraw || ABS(diff) >= gdi._numStrips) {
+		if (_fullRedraw || ABS(diff) >= _gdi->_numStrips) {
 			_bgNeedsRedraw = false;
-			redrawBGStrip(0, gdi._numStrips);
+			redrawBGStrip(0, _gdi->_numStrips);
 		} else if (diff > 0) {
 			val = -diff;
-			redrawBGStrip(gdi._numStrips - diff, diff);
+			redrawBGStrip(_gdi->_numStrips - diff, diff);
 		} else if (diff < 0) {
 			val = -diff;
 			redrawBGStrip(0, -diff);
@@ -792,7 +792,7 @@
 		diff = camera._cur.x - camera._last.x;
 		if (!_fullRedraw && diff == 8) {
 			val = -1;
-			redrawBGStrip(gdi._numStrips - 1, 1);
+			redrawBGStrip(_gdi->_numStrips - 1, 1);
 		} else if (!_fullRedraw && diff == -8) {
 			val = +1;
 			redrawBGStrip(0, 1);
@@ -801,7 +801,7 @@
 				((ScummEngine_v5 *)this)->clearFlashlight();
 			}
 			_bgNeedsRedraw = false;
-			redrawBGStrip(0, gdi._numStrips);
+			redrawBGStrip(0, _gdi->_numStrips);
 		}
 	}
 
@@ -817,7 +817,7 @@
 	byte *room = getResourceAddress(rtRoomImage, _roomResource) + _IM00_offs;
 	if (_fullRedraw) {
 		_bgNeedsRedraw = false;
-		gdi.drawBMAPBg(room, &virtscr[0]);
+		_gdi->drawBMAPBg(room, &virtscr[0]);
 	}
 
 	drawRoomObjects(0);
@@ -843,7 +843,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[0], s, 0, _roomWidth, virtscr[0].h, s, num, 0);
 }
 
 void ScummEngine::restoreBG(Common::Rect rect, byte backColor) {
@@ -928,7 +928,7 @@
 }
 
 void CharsetRenderer::clearCharsetMask() {
-	memset(_vm->getResourceAddress(rtBuffer, 9), 0, _vm->gdi._imgBufOffs[1]);
+	memset(_vm->getResourceAddress(rtBuffer, 9), 0, _vm->_gdi->_imgBufOffs[1]);
 }
 
 void CharsetRenderer::clearTextSurface() {
@@ -936,7 +936,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[0].xstart) / 8, y, z);
 }
 
 byte *Gdi::getMaskBuffer(int x, int y, int z) {
@@ -1171,8 +1171,8 @@
 	// Clip the flashlight at the borders
 	if (_flashlight.x < 0)
 		_flashlight.x = 0;
-	else if (_flashlight.x + _flashlight.w > gdi._numStrips * 8)
-		_flashlight.x = gdi._numStrips * 8 - _flashlight.w;
+	else if (_flashlight.x + _flashlight.w > _gdi->_numStrips * 8)
+		_flashlight.x = _gdi->_numStrips * 8 - _flashlight.w;
 	if (_flashlight.y < 0)
 		_flashlight.y = 0;
 	else if (_flashlight.y + _flashlight.h> vs->h)
@@ -1180,7 +1180,7 @@
 
 	// Redraw any actors "under" the flashlight
 	for (i = _flashlight.x / 8; i < (_flashlight.x + _flashlight.w) / 8; i++) {
-		assert(0 <= i && i < gdi._numStrips);
+		assert(0 <= i && i < _gdi->_numStrips);
 		setGfxUsageBit(_screenStartStrip + i, USAGE_BIT_DIRTY);
 		vs->tdirty[i] = 0;
 		vs->bdirty[i] = vs->h;
@@ -3139,14 +3139,14 @@
 
 			if (t == b) {
 				while (l <= r) {
-					if (l >= 0 && l < gdi._numStrips && t < bottom) {
+					if (l >= 0 && l < _gdi->_numStrips && t < bottom) {
 						virtscr[0].tdirty[l] = _screenTop + t * 8;
 						virtscr[0].bdirty[l] = _screenTop + (b + 1) * 8;
 					}
 					l++;
 				}
 			} else {
-				if (l < 0 || l >= gdi._numStrips || b <= t)
+				if (l < 0 || l >= _gdi->_numStrips || b <= t)
 					continue;
 				if (b > bottom)
 					b = bottom;

Modified: scummvm/trunk/engines/scumm/he/animation_he.cpp
===================================================================
--- scummvm/trunk/engines/scumm/he/animation_he.cpp	2006-09-17 20:21:40 UTC (rev 23920)
+++ scummvm/trunk/engines/scumm/he/animation_he.cpp	2006-09-17 20:22:47 UTC (rev 23921)
@@ -93,7 +93,7 @@
 		copyFrameToBuffer(pvs->getBackPixels(0, 0), 0, 0, _vm->_screenWidth);
 		
 		Common::Rect imageRect(_width, _height);
-		_vm->gdi.copyVirtScreenBuffers(imageRect);
+		_vm->_gdi->copyVirtScreenBuffers(imageRect);
 	} else {
 		copyFrameToBuffer(pvs->getPixels(0, 0), 0, 0, _vm->_screenWidth);
 

Modified: scummvm/trunk/engines/scumm/he/floodfill_he.cpp
===================================================================
--- scummvm/trunk/engines/scumm/he/floodfill_he.cpp	2006-09-17 20:21:40 UTC (rev 23920)
+++ scummvm/trunk/engines/scumm/he/floodfill_he.cpp	2006-09-17 20:22:47 UTC (rev 23921)
@@ -220,7 +220,7 @@
 	
 	if (r.left <= r.right && r.top <= r.bottom) {
 		if (ffp->flags & 0x8000) {
-			vm->gdi.copyVirtScreenBuffers(r);
+			vm->_gdi->copyVirtScreenBuffers(r);
 		} else {
 			++r.bottom;
 			vm->markRectAsDirty(kMainVirtScreen, r);

Modified: scummvm/trunk/engines/scumm/he/script_v100he.cpp
===================================================================
--- scummvm/trunk/engines/scumm/he/script_v100he.cpp	2006-09-17 20:21:40 UTC (rev 23920)
+++ scummvm/trunk/engines/scumm/he/script_v100he.cpp	2006-09-17 20:22:47 UTC (rev 23921)
@@ -2151,7 +2151,7 @@
 		debug(0, "Start executable (%s)", string);
 		break;
 	case 75:
-		gdi.copyVirtScreenBuffers(Common::Rect(_screenWidth, _screenHeight));
+		_gdi->copyVirtScreenBuffers(Common::Rect(_screenWidth, _screenHeight));
 		updatePalette();
 		break;
 	default:

Modified: scummvm/trunk/engines/scumm/he/script_v72he.cpp
===================================================================
--- scummvm/trunk/engines/scumm/he/script_v72he.cpp	2006-09-17 20:21:40 UTC (rev 23920)
+++ scummvm/trunk/engines/scumm/he/script_v72he.cpp	2006-09-17 20:22:47 UTC (rev 23921)
@@ -1528,7 +1528,7 @@
 		clearDrawObjectQueue();
 		break;
 	case 26: // HE80+
-		gdi.copyVirtScreenBuffers(Common::Rect(_screenWidth, _screenHeight));
+		_gdi->copyVirtScreenBuffers(Common::Rect(_screenWidth, _screenHeight));
 		updatePalette();
 		break;
 	case 158:

Modified: scummvm/trunk/engines/scumm/he/sprite_he.cpp
===================================================================
--- scummvm/trunk/engines/scumm/he/sprite_he.cpp	2006-09-17 20:21:40 UTC (rev 23920)
+++ scummvm/trunk/engines/scumm/he/sprite_he.cpp	2006-09-17 20:22:47 UTC (rev 23921)
@@ -1066,7 +1066,7 @@
 		resetGroup(curGrp);
 
 	if (refreshScreen) {
-		_vm->gdi.copyVirtScreenBuffers(Common::Rect(_vm->_screenWidth, _vm->_screenHeight));
+		_vm->_gdi->copyVirtScreenBuffers(Common::Rect(_vm->_screenWidth, _vm->_screenHeight));
 	}
 	_numSpritesToProcess = 0;
 }
@@ -1084,7 +1084,7 @@
 			spi->flags &= ~kSFChanged;
 			if (spi->bbox.left <= spi->bbox.right && spi->bbox.top <= spi->bbox.bottom) {
 				if (spi->flags & kSFBlitDirectly) {
-					_vm->gdi.copyVirtScreenBuffers(spi->bbox, USAGE_BIT_RESTORED);
+					_vm->_gdi->copyVirtScreenBuffers(spi->bbox, USAGE_BIT_RESTORED);
 				} else if (firstLoop) {
 					xmin = spi->bbox.left;
 					ymin = spi->bbox.top;
@@ -1113,7 +1113,7 @@
 		}
 	}
 	if (refreshScreen) {
-		_vm->gdi.copyVirtScreenBuffers(Common::Rect(xmin, ymin, xmax, ymax), USAGE_BIT_RESTORED);
+		_vm->_gdi->copyVirtScreenBuffers(Common::Rect(xmin, ymin, xmax, ymax), USAGE_BIT_RESTORED);
 	}
 }
 
@@ -1125,10 +1125,10 @@
 			if ((!checkZOrder || spi->priority >= 0) && (spi->flags & kSFMarkDirty)) {
 				int32 lp = spi->bbox.left / 8;
 				lp = MAX((int32)0, lp);
-				lp = MIN(lp, _vm->gdi._numStrips);
+				lp = MIN(lp, _vm->_gdi->_numStrips);
 				int32 rp = (spi->bbox.right + 7) / 8;
 				rp = MAX((int32)0, rp);
-				rp = MIN(rp, _vm->gdi._numStrips);
+				rp = MIN(rp, _vm->_gdi->_numStrips);
 				for (; lp < rp; lp++) {
 					if (vs->tdirty[lp] < vs->h && spi->bbox.bottom >= vs->tdirty[lp] && spi->bbox.top <= vs->bdirty[lp]) {
 						spi->flags |= kSFNeedRedraw;

Modified: scummvm/trunk/engines/scumm/he/wiz_he.cpp
===================================================================
--- scummvm/trunk/engines/scumm/he/wiz_he.cpp	2006-09-17 20:21:40 UTC (rev 23920)
+++ scummvm/trunk/engines/scumm/he/wiz_he.cpp	2006-09-17 20:22:47 UTC (rev 23921)
@@ -1226,7 +1226,7 @@
 				++rImage.bottom;
 				_vm->markRectAsDirty(kMainVirtScreen, rImage);
 			} else {
-				_vm->gdi.copyVirtScreenBuffers(rImage);
+				_vm->_gdi->copyVirtScreenBuffers(rImage);
 			}
 		}
 	}
@@ -1485,7 +1485,7 @@
 		if (flags & kWIFMarkBufferDirty) {
 			_vm->markRectAsDirty(kMainVirtScreen, bound);
 		} else {
-			_vm->gdi.copyVirtScreenBuffers(bound);
+			_vm->_gdi->copyVirtScreenBuffers(bound);
 		}
 
 		free(srcWizBuf);

Modified: scummvm/trunk/engines/scumm/object.cpp
===================================================================
--- scummvm/trunk/engines/scumm/object.cpp	2006-09-17 20:21:40 UTC (rev 23920)
+++ scummvm/trunk/engines/scumm/object.cpp	2006-09-17 20:22:47 UTC (rev 23921)
@@ -475,9 +475,9 @@
 			flags |= Gdi::dbDrawMaskOnAll;
 
 		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[0], obj, od.x_pos, od.y_pos, od.width, od.height);
 		else
-			gdi.drawBitmap(ptr, &virtscr[0], x, ypos, width * 8, height, x - xpos, numstrip, flags);
+			_gdi->drawBitmap(ptr, &virtscr[0], x, ypos, width * 8, height, x - xpos, numstrip, flags);
 	}
 }
 
@@ -1705,10 +1705,10 @@
 
 	if (left_strip < 0)
 		left_strip = 0;
-	if (right_strip > gdi._numStrips - 1)
-		right_strip = gdi._numStrips - 1;
+	if (right_strip > _gdi->_numStrips - 1)
+		right_strip = _gdi->_numStrips - 1;
 	for (i = left_strip; i <= right_strip; i++)
-		gdi.resetBackground(r.top, r.bottom, i);
+		_gdi->resetBackground(r.top, r.bottom, i);
 
 	markRectAsDirty(kMainVirtScreen, r, USAGE_BIT_RESTORED);
 }

Modified: scummvm/trunk/engines/scumm/room.cpp
===================================================================
--- scummvm/trunk/engines/scumm/room.cpp	2006-09-17 20:21:40 UTC (rev 23920)
+++ scummvm/trunk/engines/scumm/room.cpp	2006-09-17 20:22:47 UTC (rev 23921)
@@ -440,7 +440,7 @@
 		putClass(182, kObjectClassUntouchable, 0);
 	}
 
-	gdi.roomChanged(roomptr, _IM00_offs, trans);
+	_gdi->roomChanged(roomptr, _IM00_offs, trans);
 }
 
 /**
@@ -694,7 +694,7 @@
 		}
 	}
 
-	gdi.roomChanged(roomptr, _IM00_offs, 255);
+	_gdi->roomChanged(roomptr, _IM00_offs, 255);
 }
 
 void ScummEngine_v3old::resetRoomSubBlocks() {

Modified: scummvm/trunk/engines/scumm/saveload.cpp
===================================================================
--- scummvm/trunk/engines/scumm/saveload.cpp	2006-09-17 20:21:40 UTC (rev 23920)
+++ scummvm/trunk/engines/scumm/saveload.cpp	2006-09-17 20:22:47 UTC (rev 23921)
@@ -712,7 +712,7 @@
 		MKLINE(ScummEngine, _userPut, sleByte, VER(8)),
 		MKLINE(ScummEngine, _userState, sleUint16, VER(17)),
 		MKLINE(ScummEngine, _cursor.state, sleByte, VER(8)),
-		MK_OBSOLETE(ScummEngine, gdi._cursorActive, sleByte, VER(8), VER(20)),
+		MK_OBSOLETE(ScummEngine, _gdi->_cursorActive, sleByte, VER(8), VER(20)),
 		MKLINE(ScummEngine, _currentCursor, sleByte, VER(8)),
 		MKARRAY(ScummEngine, _grabbedCursor[0], sleByte, 8192, VER(20)),
 		MKLINE(ScummEngine, _cursor.width, sleInt16, VER(20)),
@@ -741,7 +741,7 @@
 		MKARRAY_OLD(ScummEngine, gfxUsageBits[0], sleUint32, 410, VER(10), VER(13)),
 		MKARRAY(ScummEngine, gfxUsageBits[0], sleUint32, 3 * 410, VER(14)),
 
-		MK_OBSOLETE(ScummEngine, gdi._transparentColor, sleByte, VER(8), VER(50)),
+		MK_OBSOLETE(ScummEngine, _gdi->_transparentColor, sleByte, VER(8), VER(50)),
 		MKARRAY(ScummEngine, _currentPalette[0], sleByte, 768, VER(8)),
 		MKARRAY(ScummEngine, _darkenPalette[0], sleByte, 768, VER(53)),
 
@@ -752,13 +752,13 @@
 
 		MKLINE(ScummEngine, _egoPositioned, sleByte, VER(8)),
 
-		// gdi._imgBufOffs grew from 4 to 5 entries. Then one day we realized
+		// _gdi->_imgBufOffs grew from 4 to 5 entries. Then one day we realized
 		// that we don't have to store it since initBGBuffers() recomputes it.
-		MK_OBSOLETE_ARRAY(ScummEngine, gdi._imgBufOffs[0], sleUint16, 4, VER(8), VER(9)),
-		MK_OBSOLETE_ARRAY(ScummEngine, gdi._imgBufOffs[0], sleUint16, 5, VER(10), VER(26)),
+		MK_OBSOLETE_ARRAY(ScummEngine, _gdi->_imgBufOffs[0], sleUint16, 4, VER(8), VER(9)),
+		MK_OBSOLETE_ARRAY(ScummEngine, _gdi->_imgBufOffs[0], sleUint16, 5, VER(10), VER(26)),
 
 		// See _imgBufOffs: _numZBuffer is recomputed by initBGBuffers().
-		MK_OBSOLETE(ScummEngine, gdi._numZBuffer, sleByte, VER(8), VER(26)),
+		MK_OBSOLETE(ScummEngine, _gdi->_numZBuffer, sleByte, VER(8), VER(26)),
 
 		MKLINE(ScummEngine, _screenEffectFlag, sleByte, VER(8)),
 

Modified: scummvm/trunk/engines/scumm/script_v8.cpp
===================================================================
--- scummvm/trunk/engines/scumm/script_v8.cpp	2006-09-17 20:21:40 UTC (rev 23920)
+++ scummvm/trunk/engines/scumm/script_v8.cpp	2006-09-17 20:22:47 UTC (rev 23921)
@@ -1419,8 +1419,8 @@
 	int z = a->_forceClip;
 	if (z == 100) {
 		z = getMaskFromBox(a->_walkbox);
-		if (z > gdi._numZBuffer - 1)
-			z = gdi._numZBuffer - 1;
+		if (z > _gdi->_numZBuffer - 1)
+			z = _gdi->_numZBuffer - 1;
 	}
 
 	push(z);

Modified: scummvm/trunk/engines/scumm/scumm.cpp
===================================================================
--- scummvm/trunk/engines/scumm/scumm.cpp	2006-09-17 20:21:40 UTC (rev 23920)
+++ scummvm/trunk/engines/scumm/scumm.cpp	2006-09-17 20:22:47 UTC (rev 23921)
@@ -84,10 +84,12 @@
 	  _language(dr.language),
 	  _debugger(0),
 	  _currentScript(0xFF), // Let debug() work on init stage
-	  gdi(this),
 	  res(this),
 	  _pauseDialog(0), _mainMenuDialog(0), _versionDialog(0) {
 
+	_gdi = new Gdi(this);
+	//_res = new ResourceManager(this);
+
 	// Copy MD5 checksum
 	memcpy(_gameMD5, dr.md5sum, 16);
 	
@@ -702,6 +704,8 @@
 	free(_herculesBuf);
 
 	delete _debugger;
+	
+	delete _gdi;
 }
 
 ScummEngine_v5::ScummEngine_v5(OSystem *syst, const DetectorResult &dr)

Modified: scummvm/trunk/engines/scumm/scumm.h
===================================================================
--- scummvm/trunk/engines/scumm/scumm.h	2006-09-17 20:21:40 UTC (rev 23920)
+++ scummvm/trunk/engines/scumm/scumm.h	2006-09-17 20:22:47 UTC (rev 23921)
@@ -443,7 +443,7 @@
 	Common::RandomSource _rnd;
 
 	/** Graphics manager */
-	Gdi gdi;
+	Gdi *_gdi;
 
 	/** Central resource data. */
 	ResourceManager res;

Modified: scummvm/trunk/engines/scumm/smush/smush_player.cpp
===================================================================
--- scummvm/trunk/engines/scumm/smush/smush_player.cpp	2006-09-17 20:21:40 UTC (rev 23920)
+++ scummvm/trunk/engines/scumm/smush/smush_player.cpp	2006-09-17 20:22:47 UTC (rev 23921)
@@ -296,9 +296,9 @@
 	// 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;
-	_origNumStrips = _vm->gdi._numStrips;
+	_origNumStrips = _vm->_gdi->_numStrips;
 	_vm->virtscr[0].pitch = _vm->virtscr[0].w;
-	_vm->gdi._numStrips = _vm->virtscr[0].w / 8;
+	_vm->_gdi->_numStrips = _vm->virtscr[0].w / 8;
 
 	_vm->_smixer->stop();
 
@@ -348,7 +348,7 @@
 	// HACK HACK HACK: This is an *evil* trick, beware! See above for
 	// some explanation.
 	_vm->virtscr[0].pitch = _origPitch;
-	_vm->gdi._numStrips = _origNumStrips;
+	_vm->_gdi->_numStrips = _origNumStrips;
 
 	_initDone = false;
 }

Modified: scummvm/trunk/engines/scumm/verbs.cpp
===================================================================
--- scummvm/trunk/engines/scumm/verbs.cpp	2006-09-17 20:21:40 UTC (rev 23920)
+++ scummvm/trunk/engines/scumm/verbs.cpp	2006-09-17 20:22:47 UTC (rev 23921)
@@ -815,7 +815,7 @@
 	if ((vs = findVirtScreen(y)) == NULL)
 		return;
 
-	gdi.disableZBuffer();
+	_gdi->disableZBuffer();
 
 	twobufs = vs->hasTwoBuffers;
 	vs->hasTwoBuffers = false;
@@ -849,7 +849,7 @@
 	assert(imptr);
 	for (i = 0; i < imgw; i++) {
 		tmp = xstrip + i;
-		gdi.drawBitmap(imptr, vs, tmp, ydiff, imgw * 8, imgh * 8, i, 1, Gdi::dbAllowMaskOr | Gdi::dbObjectMode);
+		_gdi->drawBitmap(imptr, vs, tmp, ydiff, imgw * 8, imgh * 8, i, 1, Gdi::dbAllowMaskOr | Gdi::dbObjectMode);
 	}
 
 	vst = &_verbs[verb];
@@ -857,7 +857,7 @@
 	vst->curRect.bottom = vst->curRect.top + imgh * 8;
 	vst->oldRect = vst->curRect;
 
-	gdi.enableZBuffer();
+	_gdi->enableZBuffer();
 
 	vs->hasTwoBuffers = twobufs;
 }


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