diff options
author | Max Horn | 2002-12-13 16:15:58 +0000 |
---|---|---|
committer | Max Horn | 2002-12-13 16:15:58 +0000 |
commit | 4bf96d1c8bd2fbcd371b321a11484677478aee15 (patch) | |
tree | f87fff487f1dd753c30e0d2ea9907e6d78638fc8 /common/util.h | |
parent | 7bcbcde9941f05179ab68175c4e6529dae41927e (diff) | |
download | scummvm-rg350-4bf96d1c8bd2fbcd371b321a11484677478aee15.tar.gz scummvm-rg350-4bf96d1c8bd2fbcd371b321a11484677478aee15.tar.bz2 scummvm-rg350-4bf96d1c8bd2fbcd371b321a11484677478aee15.zip |
changed OSystem to allow RBG<->16bit color conversion to be done in the backend; after all, the backend 'knows' best what format the overlay uses. Default implementations of RBGToColor and colorToRBG assume 565 mode, backends other than SDL may want to provide alternate implementations (SDL backend already does the right thing for non-565 modes)
svn-id: r5931
Diffstat (limited to 'common/util.h')
-rw-r--r-- | common/util.h | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/common/util.h b/common/util.h index a5e13c0e4f..3be8c556e0 100644 --- a/common/util.h +++ b/common/util.h @@ -38,28 +38,6 @@ static inline void SWAP(int &a, int &b) { int tmp=a; a=b; b=tmp; } #define ARRAYSIZE(x) (sizeof(x)/sizeof(x[0])) -#if USE_555_FORMAT -// Assume the 16 bit graphics data is in 5-5-5 format -#define RGB_TO_16(r,g,b) (((((r)>>3)&0x1F) << 10) | ((((g)>>3)&0x1F) << 5) | (((b)>>3)&0x1F)) -#define RED_FROM_16(x) ((((x)>>10)&0x1F) << 3) -#define GREEN_FROM_16(x) ((((x)>>5)&0x1F) << 3) -#define BLUE_FROM_16(x) (((x)&0x1F) << 3) - -#elif defined(__GP32__) //ph0x -// GP32 format 5-5-5-1 (first bit means intensity) -#define RGB_TO_16(r,g,b) (((((r)>>3)&0x1F) << 11) | ((((g)>>3)&0x1F) << 6) | (((b)>>3)&0x1F)<<1) -#define RED_FROM_16(x) ((((x)>>11)&0x1F) << 3) -#define GREEN_FROM_16(x) ((((x)>>6) &0x1F) << 3) -#define BLUE_FROM_16(x) ((((x)>>1) &0x1F) << 3) - -#else -// Assume the 16 bit graphics data is in 5-6-5 format -#define RGB_TO_16(r,g,b) (((((r)>>3)&0x1F) << 11) | ((((g)>>2)&0x3F) << 5) | (((b)>>3)&0x1F)) -#define RED_FROM_16(x) ((((x)>>11)&0x1F) << 3) -#define GREEN_FROM_16(x) ((((x)>>5)&0x3F) << 2) -#define BLUE_FROM_16(x) (((x)&0x1F) << 3) -#endif - int RGBMatch(byte *palette, int r, int g, int b); int Blend(int src, int dst, byte *palette); void ClearBlendCache(byte *palette, int weight); |