svn-id: r7411
This commit is contained in:
Max Horn 2003-05-10 12:23:02 +00:00
parent 34456cf63e
commit 97197f95ea

View file

@ -933,12 +933,13 @@ void Gdi::drawBitmap(byte *ptr, VirtScreen *vs, int x, int y, const int h,
_vertStripNextInc = h * _vm->_realWidth - 1; _vertStripNextInc = h * _vm->_realWidth - 1;
do {
CHECK_HEAP;
sx = x; sx = x;
if (vs->scrollable) if (vs->scrollable)
sx -= vs->xstart >> 3; sx -= vs->xstart >> 3;
do {
CHECK_HEAP;
if (sx < 0) if (sx < 0)
goto next_iter; 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); _mask_ptr = _vm->getResourceAddress(rtBuffer, 9) + (y * _numStrips + x);
if (_vm->_features & GF_SMALL_HEADER) {
if (_vm->_features & GF_AFTER_V2) { if (_vm->_features & GF_AFTER_V2) {
decodeStripOldEGA(bgbak_ptr, roomptr + _vm->_egaStripOffsets[stripnr], h, stripnr); decodeStripOldEGA(bgbak_ptr, roomptr + _vm->_egaStripOffsets[stripnr], h, stripnr);
} else if (_vm->_features & GF_16COLOR) { } else if (_vm->_features & GF_16COLOR) {
decodeStripEGA(bgbak_ptr, smap_ptr + READ_LE_UINT16(smap_ptr + stripnr * 2 + 2), h); decodeStripEGA(bgbak_ptr, smap_ptr + READ_LE_UINT16(smap_ptr + stripnr * 2 + 2), h);
} else { } else if (_vm->_features & GF_SMALL_HEADER) {
useOrDecompress = decompressBitmap(bgbak_ptr, smap_ptr + READ_LE_UINT32(smap_ptr + stripnr * 4 + 4), h); useOrDecompress = decompressBitmap(bgbak_ptr, smap_ptr + READ_LE_UINT32(smap_ptr + stripnr * 4 + 4), h);
}
} else { } else {
useOrDecompress = decompressBitmap(bgbak_ptr, smap_ptr + READ_LE_UINT32(smap_ptr + stripnr * 4 + 8), h); 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: next_iter:
CHECK_HEAP; CHECK_HEAP;
x++; x++;
sx++;
stripnr++; stripnr++;
} while (--numstrip); } 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; x = 0;
y = 128; y = 128;