aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNipun Garg2019-07-12 05:57:57 +0530
committerEugene Sandulenko2019-09-03 17:17:18 +0200
commit8f83631a3b6eb5e86c3b1cd6708d7dfb652bb3c4 (patch)
tree86f57d06a65efb7905f8f8798c4309c6c12b8c7f
parentbcaf795b593279aef3faabaa3234d7b35c96f99c (diff)
downloadscummvm-rg350-8f83631a3b6eb5e86c3b1cd6708d7dfb652bb3c4.tar.gz
scummvm-rg350-8f83631a3b6eb5e86c3b1cd6708d7dfb652bb3c4.tar.bz2
scummvm-rg350-8f83631a3b6eb5e86c3b1cd6708d7dfb652bb3c4.zip
HDB: Add macros for RGB-565 conversions
-rw-r--r--engines/hdb/gfx.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/engines/hdb/gfx.h b/engines/hdb/gfx.h
index a097b6f588..e384ac96f0 100644
--- a/engines/hdb/gfx.h
+++ b/engines/hdb/gfx.h
@@ -166,6 +166,20 @@ public:
void turnOnBonusStars(int which);
void drawBonusStars();
+ // Macro to convert RGB into 16-bit
+ uint16 rgbTo565(int r, int g, int b) {
+ return (uint16) (
+ ((r & 0xf8) << 8) |
+ ((g & 0xfc) << 3) |
+ ((b & 0xf8) >> 3)
+ );
+ }
+
+ // Macros to get RGB from 565 short
+#define getR( x ) ( ( x & 0xf800 ) >> 8 )
+#define getG( x ) ( ( x & 0x07e0 ) >> 3 )
+#define getB( x ) ( ( x & 0x001f ) << 3 )
+
private:
int _numTiles;
TileLookup *_tLookupArray;