mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-15 22:28:10 +00:00
HDB: Add macros for RGB-565 conversions
This commit is contained in:
parent
bcaf795b59
commit
8f83631a3b
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user