diff options
| author | Max Horn | 2003-05-10 12:23:02 +0000 | 
|---|---|---|
| committer | Max Horn | 2003-05-10 12:23:02 +0000 | 
| commit | 97197f95ea5159e3b8caa5cc7f92fdbf0523a9ed (patch) | |
| tree | b58476f3b41834e614bfdd05cf67b186b7794f8e | |
| parent | 34456cf63e3296405cc96aa7ba93e798e199bc71 (diff) | |
| download | scummvm-rg350-97197f95ea5159e3b8caa5cc7f92fdbf0523a9ed.tar.gz scummvm-rg350-97197f95ea5159e3b8caa5cc7f92fdbf0523a9ed.tar.bz2 scummvm-rg350-97197f95ea5159e3b8caa5cc7f92fdbf0523a9ed.zip  | |
cleanup
svn-id: r7411
| -rw-r--r-- | scumm/gfx.cpp | 26 | 
1 files changed, 15 insertions, 11 deletions
diff --git a/scumm/gfx.cpp b/scumm/gfx.cpp index 6108d448f4..7d14145949 100644 --- a/scumm/gfx.cpp +++ b/scumm/gfx.cpp @@ -933,11 +933,12 @@ void Gdi::drawBitmap(byte *ptr, VirtScreen *vs, int x, int y, const int h,  	_vertStripNextInc = h * _vm->_realWidth - 1; +	sx = x; +	if (vs->scrollable) +		sx -= vs->xstart >> 3; +  	do {  		CHECK_HEAP; -		sx = x; -		if (vs->scrollable) -			sx -= vs->xstart >> 3;  		if (sx < 0)  			goto next_iter; @@ -959,14 +960,12 @@ void Gdi::drawBitmap(byte *ptr, VirtScreen *vs, int x, int y, const int h,  		_mask_ptr = _vm->getResourceAddress(rtBuffer, 9) + (y * _numStrips + x); -		if (_vm->_features & GF_SMALL_HEADER) { -			if (_vm->_features & GF_AFTER_V2) { -				decodeStripOldEGA(bgbak_ptr, roomptr + _vm->_egaStripOffsets[stripnr], h, stripnr); -			} else if (_vm->_features & GF_16COLOR) { -				decodeStripEGA(bgbak_ptr, smap_ptr + READ_LE_UINT16(smap_ptr + stripnr * 2 + 2), h); -			} else { -				useOrDecompress = decompressBitmap(bgbak_ptr, smap_ptr + READ_LE_UINT32(smap_ptr + stripnr * 4 + 4), h); -			} +		if (_vm->_features & GF_AFTER_V2) { +			decodeStripOldEGA(bgbak_ptr, roomptr + _vm->_egaStripOffsets[stripnr], h, stripnr); +		} else if (_vm->_features & GF_16COLOR) { +			decodeStripEGA(bgbak_ptr, smap_ptr + READ_LE_UINT16(smap_ptr + stripnr * 2 + 2), h); +		} else if (_vm->_features & GF_SMALL_HEADER) { +			useOrDecompress = decompressBitmap(bgbak_ptr, smap_ptr + READ_LE_UINT32(smap_ptr + stripnr * 4 + 4), h);  		} else {  			useOrDecompress = decompressBitmap(bgbak_ptr, smap_ptr + READ_LE_UINT32(smap_ptr + stripnr * 4 + 8), h);  		} @@ -1061,6 +1060,7 @@ void Gdi::drawBitmap(byte *ptr, VirtScreen *vs, int x, int y, const int h,  next_iter:  		CHECK_HEAP;  		x++; +		sx++;  		stripnr++;  	} while (--numstrip);  } @@ -1158,6 +1158,10 @@ void Scumm::buildStripOffsets() {  		}  	} +	// Note - at this point, "bitmap" will be equal to "zplane" +	// This is true for any V2 bitmap data. We can make use of that fact to write +	// a generic drawBitmapV2, which will work for objects, too, and not need this +	// function and the tables it computes at all.  	x = 0;  	y = 128;  | 
