aboutsummaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
authorTravis Howell2009-06-04 01:05:47 +0000
committerTravis Howell2009-06-04 01:05:47 +0000
commit3a64d35dfd9126d7912c4d4496030f7ed120d660 (patch)
treed31b135a189e23fbebe806d77b9c5675ba2ed244 /graphics
parent8447a3650e7de2fc780c1c354f70bf0d119622b3 (diff)
downloadscummvm-rg350-3a64d35dfd9126d7912c4d4496030f7ed120d660.tar.gz
scummvm-rg350-3a64d35dfd9126d7912c4d4496030f7ed120d660.tar.bz2
scummvm-rg350-3a64d35dfd9126d7912c4d4496030f7ed120d660.zip
Add 16bit color support for later HE games.
svn-id: r41153
Diffstat (limited to 'graphics')
-rw-r--r--graphics/scaler/thumbnail_intern.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/graphics/scaler/thumbnail_intern.cpp b/graphics/scaler/thumbnail_intern.cpp
index fabe07b031..57dd468bbf 100644
--- a/graphics/scaler/thumbnail_intern.cpp
+++ b/graphics/scaler/thumbnail_intern.cpp
@@ -23,6 +23,7 @@
*
*/
+#include "common/endian.h"
#include "common/scummsys.h"
#include "common/system.h"
@@ -107,11 +108,17 @@ static bool grabScreen565(Graphics::Surface *surf) {
for (uint y = 0; y < screen->h; ++y) {
for (uint x = 0; x < screen->w; ++x) {
- byte r, g, b;
- r = palette[((uint8*)screen->pixels)[y * screen->pitch + x] * 4];
- g = palette[((uint8*)screen->pixels)[y * screen->pitch + x] * 4 + 1];
- b = palette[((uint8*)screen->pixels)[y * screen->pitch + x] * 4 + 2];
-
+ byte r, g, b;
+ if (screen->bytesPerPixel == 2) {
+ uint16 col = READ_UINT16(screen->getBasePtr(x, y));
+ r = ((col >> 10) & 0x1F) << 3;
+ g = ((col >> 5) & 0x1F) << 3;
+ b = ((col >> 0) & 0x1F) << 3;
+ } else {
+ r = palette[((uint8*)screen->pixels)[y * screen->pitch + x] * 4];
+ 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] = Graphics::RGBToColor<Graphics::ColorMasks<565> >(r, g, b);
}
}