aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2007-08-11 08:02:19 +0000
committerMax Horn2007-08-11 08:02:19 +0000
commitc492e9c90289d7592b8585ba0dc18b859a428560 (patch)
tree6506667d56e36c92e2085d7e7b62c6acacef1422
parent4387d82dd8d8155e803ecd2899cd8c321487f4ab (diff)
downloadscummvm-rg350-c492e9c90289d7592b8585ba0dc18b859a428560.tar.gz
scummvm-rg350-c492e9c90289d7592b8585ba0dc18b859a428560.tar.bz2
scummvm-rg350-c492e9c90289d7592b8585ba0dc18b859a428560.zip
make use of RGBToColor<ColorMasks> > template function
svn-id: r28516
-rw-r--r--graphics/colormasks.h3
-rw-r--r--graphics/scaler/thumbnail.cpp3
2 files changed, 4 insertions, 2 deletions
diff --git a/graphics/colormasks.h b/graphics/colormasks.h
index c5e463e2c2..b8bfe26535 100644
--- a/graphics/colormasks.h
+++ b/graphics/colormasks.h
@@ -48,7 +48,8 @@ The meaning of these is masks is the following:
R = ((color & kRedMask) >> kRedShift) << (8-kRedBits)
Actually, instead of the simple left shift, one might want to use somewhat
- more sophisticated code (which fills up the lower most bits.
+ more sophisticated code (which fills up the least significant bits with
+ appropriate data).
The highBits / lowBits / qhighBits / qlowBits are special values that are
diff --git a/graphics/scaler/thumbnail.cpp b/graphics/scaler/thumbnail.cpp
index 40d0cba156..b17f66bb3d 100644
--- a/graphics/scaler/thumbnail.cpp
+++ b/graphics/scaler/thumbnail.cpp
@@ -27,6 +27,7 @@
#include "common/scummsys.h"
#include "common/system.h"
+#include "graphics/colormasks.h"
#include "graphics/scaler.h"
#include "graphics/scaler/intern.h"
@@ -118,7 +119,7 @@ static bool grabScreen565(Graphics::Surface *surf) {
g = palette[((uint8*)screen->pixels)[y * screen->pitch + x] * 4 + 1];
b = palette[((uint8*)screen->pixels)[y * screen->pitch + x] * 4 + 2];
- ((uint16*)surf->pixels)[y * surf->w + x] = (((r >> 3) & 0x1F) << 11) | (((g >> 2) & 0x3F) << 5) | ((b >> 3) & 0x1F);
+ ((uint16*)surf->pixels)[y * surf->w + x] = RGBToColor<ColorMasks<565> >(r, g, b);
}
}