[Scummvm-cvs-logs] SF.net SVN: scummvm: [28516] scummvm/trunk/graphics
fingolfin at users.sourceforge.net
fingolfin at users.sourceforge.net
Sat Aug 11 10:02:19 CEST 2007
Revision: 28516
http://scummvm.svn.sourceforge.net/scummvm/?rev=28516&view=rev
Author: fingolfin
Date: 2007-08-11 01:02:19 -0700 (Sat, 11 Aug 2007)
Log Message:
-----------
make use of RGBToColor<ColorMasks> > template function
Modified Paths:
--------------
scummvm/trunk/graphics/colormasks.h
scummvm/trunk/graphics/scaler/thumbnail.cpp
Modified: scummvm/trunk/graphics/colormasks.h
===================================================================
--- scummvm/trunk/graphics/colormasks.h 2007-08-11 08:00:47 UTC (rev 28515)
+++ scummvm/trunk/graphics/colormasks.h 2007-08-11 08:02:19 UTC (rev 28516)
@@ -48,7 +48,8 @@
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
Modified: scummvm/trunk/graphics/scaler/thumbnail.cpp
===================================================================
--- scummvm/trunk/graphics/scaler/thumbnail.cpp 2007-08-11 08:00:47 UTC (rev 28515)
+++ scummvm/trunk/graphics/scaler/thumbnail.cpp 2007-08-11 08:02:19 UTC (rev 28516)
@@ -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 @@
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);
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list