mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-05 02:17:05 +00:00
MOHAWK: RIVEN: Optimize image decoding
This mitigates long load times between cards on low-power devices by streaming from memory. Code courtesy of Bastien Bouclet (bgK).
This commit is contained in:
parent
047545cc1b
commit
366793db22
@ -29,6 +29,7 @@
|
||||
#include "mohawk/riven_video.h"
|
||||
|
||||
#include "common/system.h"
|
||||
#include "common/memstream.h"
|
||||
|
||||
#include "engines/util.h"
|
||||
|
||||
@ -354,7 +355,11 @@ RivenGraphics::~RivenGraphics() {
|
||||
}
|
||||
|
||||
MohawkSurface *RivenGraphics::decodeImage(uint16 id) {
|
||||
MohawkSurface *surface = _bitmapDecoder->decodeImage(_vm->getResource(ID_TBMP, id));
|
||||
Common::SeekableReadStream *resourceStream = _vm->getResource(ID_TBMP, id);
|
||||
Common::SeekableReadStream *memResourceStream = resourceStream->readStream(resourceStream->size());
|
||||
delete resourceStream;
|
||||
|
||||
MohawkSurface *surface = _bitmapDecoder->decodeImage(memResourceStream);
|
||||
surface->convertToTrueColor();
|
||||
return surface;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user