aboutsummaryrefslogtreecommitdiff
path: root/graphics/scaler
diff options
context:
space:
mode:
authorTravis Howell2009-06-03 00:31:50 +0000
committerTravis Howell2009-06-03 00:31:50 +0000
commitfc4d1c0affc2623ec5f35d3e10c6c0297eb01a25 (patch)
tree088ca72968cddea5caec4748615f46edaab63db2 /graphics/scaler
parentf82df1d1c44fb9ae7bb3bad21c972b95ae689621 (diff)
downloadscummvm-rg350-fc4d1c0affc2623ec5f35d3e10c6c0297eb01a25.tar.gz
scummvm-rg350-fc4d1c0affc2623ec5f35d3e10c6c0297eb01a25.tar.bz2
scummvm-rg350-fc4d1c0affc2623ec5f35d3e10c6c0297eb01a25.zip
Revert last change, better to wait for 16bit backend support.
svn-id: r41131
Diffstat (limited to 'graphics/scaler')
-rw-r--r--graphics/scaler/thumbnail_intern.cpp19
1 files changed, 6 insertions, 13 deletions
diff --git a/graphics/scaler/thumbnail_intern.cpp b/graphics/scaler/thumbnail_intern.cpp
index 6e78c71bfd..fabe07b031 100644
--- a/graphics/scaler/thumbnail_intern.cpp
+++ b/graphics/scaler/thumbnail_intern.cpp
@@ -23,7 +23,6 @@
*
*/
-#include "common/endian.h"
#include "common/scummsys.h"
#include "common/system.h"
@@ -99,7 +98,7 @@ static bool grabScreen565(Graphics::Surface *surf) {
if (!screen)
return false;
- assert(screen->pixels != 0);
+ assert(screen->bytesPerPixel == 1 && screen->pixels != 0);
byte palette[256 * 4];
g_system->grabPalette(&palette[0], 0, 256);
@@ -108,17 +107,11 @@ 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;
- if (screen->bytesPerPixel == 2) {
- uint16 col = READ_LE_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];
- }
+ 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];
+
((uint16*)surf->pixels)[y * surf->w + x] = Graphics::RGBToColor<Graphics::ColorMasks<565> >(r, g, b);
}
}