diff options
Diffstat (limited to 'engines/mohawk/graphics.cpp')
-rw-r--r-- | engines/mohawk/graphics.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/engines/mohawk/graphics.cpp b/engines/mohawk/graphics.cpp index 2ddfb47575..35691c36aa 100644 --- a/engines/mohawk/graphics.cpp +++ b/engines/mohawk/graphics.cpp @@ -78,8 +78,9 @@ MystGraphics::MystGraphics(MohawkEngine_Myst* vm) : _vm(vm) { error("Myst requires greater than 256 colors to run"); if (_vm->getFeatures() & GF_ME) { - _jpegDecoder = new Graphics::JPEGDecoder(); - _pictDecoder = new Graphics::PictDecoder(_pixelFormat); + // We want to delete our own JPEG surfaces, so don't free after use. + _jpegDecoder = new JPEGDecoder(false); + _pictDecoder = new MystPICT(_jpegDecoder); } else { _jpegDecoder = NULL; _pictDecoder = NULL; @@ -151,10 +152,9 @@ void MystGraphics::copyImageSectionToScreen(uint16 image, Common::Rect src, Comm if (_vm->getFeatures() & GF_ME && _vm->getPlatform() == Common::kPlatformMacintosh && _pictureFile.picFile.isOpen()) { for (uint32 i = 0; i < _pictureFile.pictureCount; i++) if (_pictureFile.entries[i].id == image) { - if (_pictureFile.entries[i].type == 0) { - Graphics::Surface *jpegSurface = _jpegDecoder->decodeImage(new Common::SeekableSubReadStream(&_pictureFile.picFile, _pictureFile.entries[i].offset, _pictureFile.entries[i].offset + _pictureFile.entries[i].size)); - surface->copyFrom(*jpegSurface); - } else if (_pictureFile.entries[i].type == 1) + if (_pictureFile.entries[i].type == 0) + surface = _jpegDecoder->decodeImage(new Common::SeekableSubReadStream(&_pictureFile.picFile, _pictureFile.entries[i].offset, _pictureFile.entries[i].offset + _pictureFile.entries[i].size)); + else if (_pictureFile.entries[i].type == 1) surface = _pictDecoder->decodeImage(new Common::SeekableSubReadStream(&_pictureFile.picFile, _pictureFile.entries[i].offset, _pictureFile.entries[i].offset + _pictureFile.entries[i].size)); else error ("Unknown Picture File type %d", _pictureFile.entries[i].type); |