diff options
author | Matthew Hoops | 2010-11-18 13:31:12 +0000 |
---|---|---|
committer | Matthew Hoops | 2010-11-18 13:31:12 +0000 |
commit | 48416a7f038dba69a72aa9de2fef1dc1e9087405 (patch) | |
tree | b56a8dd064b259a571b545f7f3b25a04861f6349 /engines/mohawk/graphics.cpp | |
parent | 51a954c1dd07c475b01c898ac8614f5a2a83185b (diff) | |
download | scummvm-rg350-48416a7f038dba69a72aa9de2fef1dc1e9087405.tar.gz scummvm-rg350-48416a7f038dba69a72aa9de2fef1dc1e9087405.tar.bz2 scummvm-rg350-48416a7f038dba69a72aa9de2fef1dc1e9087405.zip |
MOHAWK: Implement the old Mohawk bitmap format (thanks to fuzzie)
svn-id: r54319
Diffstat (limited to 'engines/mohawk/graphics.cpp')
-rw-r--r-- | engines/mohawk/graphics.cpp | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/engines/mohawk/graphics.cpp b/engines/mohawk/graphics.cpp index e0dce6369a..c1c41e21e7 100644 --- a/engines/mohawk/graphics.cpp +++ b/engines/mohawk/graphics.cpp @@ -759,26 +759,26 @@ LBGraphics::~LBGraphics() { } void LBGraphics::copyImageToScreen(uint16 image, uint16 left, uint16 right) { - if (_vm->getGameType() == GType_LIVINGBOOKSV1) { - // Drawing images in the old format isn't supported (yet) - ImageData *imageData = _bmpDecoder->decodeImage(_vm->wrapStreamEndian(ID_BMAP, image)); - delete imageData; - } else { - ImageData *imageData = _bmpDecoder->decodeImage(_vm->getRawData(ID_TBMP, image)); - imageData->_palette = _palette; - Graphics::Surface *surface = imageData->getSurface(); - imageData->_palette = NULL; // Unset the palette so it doesn't get deleted - delete imageData; - - uint16 width = MIN<int>(surface->w, 640); - uint16 height = MIN<int>(surface->h, 480); - _vm->_system->copyRectToScreen((byte *)surface->pixels, surface->pitch, left, right, width, height); - surface->free(); - delete surface; + ImageData *imageData; - // FIXME: Remove this and update only at certain points - _vm->_system->updateScreen(); - } + if (_vm->getGameType() == GType_LIVINGBOOKSV1) + imageData = _bmpDecoder->decodeImage(_vm->wrapStreamEndian(ID_BMAP, image)); + else + imageData = _bmpDecoder->decodeImage(_vm->getRawData(ID_TBMP, image)); + + imageData->_palette = _palette; + Graphics::Surface *surface = imageData->getSurface(); + imageData->_palette = NULL; // Unset the palette so it doesn't get deleted + delete imageData; + + uint16 width = MIN<int>(surface->w, _vm->_system->getWidth()); + uint16 height = MIN<int>(surface->h, _vm->_system->getHeight()); + _vm->_system->copyRectToScreen((byte *)surface->pixels, surface->pitch, left, right, width, height); + surface->free(); + delete surface; + + // FIXME: Remove this and update only at certain points + _vm->_system->updateScreen(); } void LBGraphics::setPalette(uint16 id) { |