aboutsummaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
authorMax Horn2008-11-06 15:02:50 +0000
committerMax Horn2008-11-06 15:02:50 +0000
commitedf9f249260b1fd4364f6727fa622991e81e8cf3 (patch)
tree2b034d5daf7b69212957d8d51ab839974f51f2c5 /graphics
parentf238a12b27ebfa9847814b9972fdb5789e484533 (diff)
downloadscummvm-rg350-edf9f249260b1fd4364f6727fa622991e81e8cf3.tar.gz
scummvm-rg350-edf9f249260b1fd4364f6727fa622991e81e8cf3.tar.bz2
scummvm-rg350-edf9f249260b1fd4364f6727fa622991e81e8cf3.zip
Got rid of OSystem::colorToRGB and RGBToColor; added implementations for OSystem::getOverlayFormat to several ports (pending testing by the porters)
svn-id: r34912
Diffstat (limited to 'graphics')
-rw-r--r--graphics/mpeg_player.cpp7
-rw-r--r--graphics/thumbnail.cpp11
2 files changed, 7 insertions, 11 deletions
diff --git a/graphics/mpeg_player.cpp b/graphics/mpeg_player.cpp
index 3c0fd08cb3..7432887360 100644
--- a/graphics/mpeg_player.cpp
+++ b/graphics/mpeg_player.cpp
@@ -389,10 +389,11 @@ void BaseAnimationState::buildLookup() {
}
// Set up entries 0-255 in rgb-to-pixel value tables.
+ Graphics::PixelFormat format = _sys->getOverlayFormat();
for (i = 0; i < 256; i++) {
- r_2_pix_alloc[i + 256] = _sys->RGBToColor(i, 0, 0);
- g_2_pix_alloc[i + 256] = _sys->RGBToColor(0, i, 0);
- b_2_pix_alloc[i + 256] = _sys->RGBToColor(0, 0, i);
+ r_2_pix_alloc[i + 256] = Graphics::RGBToColor(i, 0, 0, format);
+ g_2_pix_alloc[i + 256] = Graphics::RGBToColor(0, i, 0, format);
+ b_2_pix_alloc[i + 256] = Graphics::RGBToColor(0, 0, i, format);
}
// Spread out the values we have to the rest of the array so that we do
diff --git a/graphics/thumbnail.cpp b/graphics/thumbnail.cpp
index 905fea3d93..709ba9ea54 100644
--- a/graphics/thumbnail.cpp
+++ b/graphics/thumbnail.cpp
@@ -42,12 +42,6 @@ struct ThumbnailHeader {
#define ThumbnailHeaderSize (4+4+1+2+2+1)
-inline void colorToRGB(uint16 color, uint8 &r, uint8 &g, uint8 &b) {
- r = (((color >> 11) & 0x1F) << 3);
- g = (((color >> 5) & 0x3F) << 2);
- b = ((color&0x1F) << 3);
-}
-
bool loadHeader(Common::SeekableReadStream &in, ThumbnailHeader &header, bool outputWarnings) {
header.type = in.readUint32BE();
// We also accept the bad 'BMHT' header here, for the sake of compatibility
@@ -114,13 +108,14 @@ bool loadThumbnail(Common::SeekableReadStream &in, Graphics::Surface &to) {
to.create(header.width, header.height, sizeof(OverlayColor));
OverlayColor *pixels = (OverlayColor *)to.pixels;
+ Graphics::PixelFormat format = g_system->getOverlayFormat();
for (int y = 0; y < to.h; ++y) {
for (int x = 0; x < to.w; ++x) {
uint8 r, g, b;
- colorToRGB(in.readUint16BE(), r, g, b);
+ colorToRGB<ColorMasks<565> >(in.readUint16BE(), r, g, b);
// converting to current OSystem Color
- *pixels++ = g_system->RGBToColor(r, g, b);
+ *pixels++ = Graphics::RGBToColor(r, g, b, format);
}
}