diff options
| author | Max Horn | 2004-09-24 07:36:29 +0000 | 
|---|---|---|
| committer | Max Horn | 2004-09-24 07:36:29 +0000 | 
| commit | 4db6f8ffd41b1e7cf656ae46ff8da68d7c84efa2 (patch) | |
| tree | 4beb6863666d8a35cebc4dbe4235e4242688d056 /scumm | |
| parent | 9aa01251ffdab6efb03593b7f66c62c20b9c3333 (diff) | |
| download | scummvm-rg350-4db6f8ffd41b1e7cf656ae46ff8da68d7c84efa2.tar.gz scummvm-rg350-4db6f8ffd41b1e7cf656ae46ff8da68d7c84efa2.tar.bz2 scummvm-rg350-4db6f8ffd41b1e7cf656ae46ff8da68d7c84efa2.zip  | |
More V7_SMOOTH_SCROLLING_HACK hackery
svn-id: r15247
Diffstat (limited to 'scumm')
| -rw-r--r-- | scumm/base-costume.cpp | 2 | ||||
| -rw-r--r-- | scumm/gfx.cpp | 18 | 
2 files changed, 17 insertions, 3 deletions
diff --git a/scumm/base-costume.cpp b/scumm/base-costume.cpp index 63dae0686c..f52f92038a 100644 --- a/scumm/base-costume.cpp +++ b/scumm/base-costume.cpp @@ -34,7 +34,7 @@ byte BaseCostumeRenderer::drawCostume(const VirtScreen &vs, const Actor *a, bool  	else  		_outptr = vs.getPixels(0, 0); -	_outwidth = vs.w; +	_outwidth = vs.pitch;  	_outheight = vs.h;  	_numStrips = _outwidth / 8; diff --git a/scumm/gfx.cpp b/scumm/gfx.cpp index 0643f73a24..f7663d63bd 100644 --- a/scumm/gfx.cpp +++ b/scumm/gfx.cpp @@ -231,6 +231,16 @@ void Gdi::init() {  	_textSurface.bytesPerPixel = 1;  	_numStrips = _vm->_screenWidth / 8; +#ifdef V7_SMOOTH_SCROLLING_HACK +	if (_vm->_version >= 7) +		_numStrips += 1; +	// TODO: Just increasing _numStrips isn't sufficient, and will cause +	// problems in some cases. For example in In rooms which are *exactly* of +	// width equal to _screenWidth, we now may cause an out-of-bounds access. +	// One possible soution might be to replace _numStrips by a method +	// Gdi::getNumStrips() which then returns the proper value, computed +	// dynamically. +#endif  } @@ -256,6 +266,10 @@ void ScummEngine::initVirtScreen(VirtScreenNumber slot, int number, int top, int  	vs->backBuf = NULL;  	vs->bytesPerPixel = 1;  	vs->pitch = width; +#ifdef V7_SMOOTH_SCROLLING_HACK +	if (_version >= 7) +		vs->pitch += 8; +#endif  	size = vs->pitch * vs->h;  	if (scrollable) { @@ -438,7 +452,7 @@ void Gdi::drawStripToScreen(VirtScreen *vs, int x, int width, int top, int botto  		return;  	assert(top >= 0 && bottom <= vs->h);	// Paranoia checks -	assert(x >= 0 && width <= vs->w); +	assert(x >= 0 && width <= vs->pitch);  	assert(_textSurface.pixels);  	assert(_compositeBuf); @@ -577,7 +591,7 @@ void ScummEngine::redrawBGAreas() {  		if (findResource(MKID('BMAP'), room) != NULL) {  			if (_fullRedraw) {  				_bgNeedsRedraw = false; -				gdi.drawBMAPBg(room, &virtscr[0], _screenStartStrip, _screenWidth); +				gdi.drawBMAPBg(room, &virtscr[0], _screenStartStrip, virtscr[0].w);  			}  			cont = false;  		} else if (findResource(MKID('SMAP'), room) == NULL) {  | 
