aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorMatthew Hoops2011-06-30 08:13:35 -0400
committerJohannes Schickel2012-03-20 01:06:47 +0100
commit29f7cc33fb66ded97a8261beb8d16dd951bdec59 (patch)
tree8e1228020dfd058b3a3c89a99f2e9e0c6ad54017 /engines
parenta004897252fba00d48a6acb0dc5298897faefdfb (diff)
downloadscummvm-rg350-29f7cc33fb66ded97a8261beb8d16dd951bdec59.tar.gz
scummvm-rg350-29f7cc33fb66ded97a8261beb8d16dd951bdec59.tar.bz2
scummvm-rg350-29f7cc33fb66ded97a8261beb8d16dd951bdec59.zip
MOHAWK: Use Surface::convertTo() for video 8bpp->true color conversion
Diffstat (limited to 'engines')
-rw-r--r--engines/mohawk/video.cpp20
1 files changed, 1 insertions, 19 deletions
diff --git a/engines/mohawk/video.cpp b/engines/mohawk/video.cpp
index 8d72fa3f72..80fa4bf9a0 100644
--- a/engines/mohawk/video.cpp
+++ b/engines/mohawk/video.cpp
@@ -235,25 +235,7 @@ bool VideoManager::updateMovies() {
if (_videoStreams[i]->hasDirtyPalette())
_videoStreams[i]->setSystemPalette();
} else {
- convertedFrame = new Graphics::Surface();
- const byte *palette = _videoStreams[i]->getPalette();
- assert(palette);
-
- convertedFrame->create(frame->w, frame->h, pixelFormat);
-
- for (uint16 j = 0; j < frame->h; j++) {
- for (uint16 k = 0; k < frame->w; k++) {
- byte palIndex = *((const byte *)frame->getBasePtr(k, j));
- byte r = palette[palIndex * 3];
- byte g = palette[palIndex * 3 + 1];
- byte b = palette[palIndex * 3 + 2];
- if (pixelFormat.bytesPerPixel == 2)
- *((uint16 *)convertedFrame->getBasePtr(k, j)) = pixelFormat.RGBToColor(r, g, b);
- else
- *((uint32 *)convertedFrame->getBasePtr(k, j)) = pixelFormat.RGBToColor(r, g, b);
- }
- }
-
+ convertedFrame = frame->convertTo(pixelFormat, _videoStreams[i]->getPalette());
frame = convertedFrame;
}
}