aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/glk/picture.cpp1
-rw-r--r--engines/groovie/roq.cpp5
-rw-r--r--engines/titanic/support/image_decoders.cpp13
3 files changed, 12 insertions, 7 deletions
diff --git a/engines/glk/picture.cpp b/engines/glk/picture.cpp
index a47d8bf3d6..306444449c 100644
--- a/engines/glk/picture.cpp
+++ b/engines/glk/picture.cpp
@@ -125,6 +125,7 @@ Picture *Pictures::load(uint32 id) {
palette = png.getPalette();
palCount = png.getPaletteColorCount();
} else if (f.open(Common::String::format("pic%u.jpg", id))) {
+ jpg.setOutputPixelFormat(g_system->getScreenFormat());
jpg.loadStream(f);
img = jpg.getSurface();
} else if (f.open(Common::String::format("pic%u.raw", id))) {
diff --git a/engines/groovie/roq.cpp b/engines/groovie/roq.cpp
index c1b6c44c4d..2e9a394c53 100644
--- a/engines/groovie/roq.cpp
+++ b/engines/groovie/roq.cpp
@@ -470,6 +470,7 @@ bool ROQPlayer::processBlockStill(ROQBlockHeader &blockHeader) {
debugC(5, kDebugVideo, "Groovie::ROQ: Processing still (JPEG) block");
Image::JPEGDecoder jpg;
+ jpg.setOutputPixelFormat(_vm->_pixelFormat);
uint32 startPos = _file->pos();
Common::SeekableSubReadStream subStream(_file, startPos, startPos + blockHeader.size, DisposeAfterUse::NO);
@@ -478,7 +479,9 @@ bool ROQPlayer::processBlockStill(ROQBlockHeader &blockHeader) {
const Graphics::Surface *srcSurf = jpg.getSurface();
_currBuf->free();
delete _currBuf;
- _currBuf = srcSurf->convertTo(_vm->_pixelFormat);
+
+ _currBuf = new Graphics::Surface();
+ _currBuf->copyFrom(*srcSurf);
_file->seek(startPos + blockHeader.size);
return true;
diff --git a/engines/titanic/support/image_decoders.cpp b/engines/titanic/support/image_decoders.cpp
index 3819b85116..7c902b2c6d 100644
--- a/engines/titanic/support/image_decoders.cpp
+++ b/engines/titanic/support/image_decoders.cpp
@@ -20,6 +20,7 @@
*
*/
+#include "common/system.h"
#include "titanic/support/image_decoders.h"
namespace Titanic {
@@ -29,7 +30,8 @@ void CJPEGDecode::decode(OSVideoSurface &surface, const CString &name) {
StdCWadFile file;
file.open(name);
- // Use the ScucmmVM deoder to decode it
+ // Use the ScummVM decoder to decode it
+ setOutputPixelFormat(g_system->getScreenFormat());
loadStream(*file.readStream());
const Graphics::Surface *srcSurf = getSurface();
@@ -38,15 +40,14 @@ void CJPEGDecode::decode(OSVideoSurface &surface, const CString &name) {
|| surface.getHeight() != srcSurf->h)
surface.recreate(srcSurf->w, srcSurf->h, 16);
- // Convert the decoded surface to the correct pixel format, and then copy it over
+ // Copy the decoded surface
surface.lock();
- Graphics::Surface *convertedSurface = srcSurf->convertTo(surface._rawSurface->format);
- Common::copy((byte *)convertedSurface->getPixels(), (byte *)convertedSurface->getPixels() +
+ assert(srcSurf->format == surface._rawSurface->format);
+
+ Common::copy((const byte *)srcSurf->getPixels(), (const byte *)srcSurf->getPixels() +
surface.getPitch() * surface.getHeight(), (byte *)surface._rawSurface->getPixels());
- convertedSurface->free();
- delete convertedSurface;
surface.unlock();
}