diff options
author | Max Horn | 2002-09-19 17:03:24 +0000 |
---|---|---|
committer | Max Horn | 2002-09-19 17:03:24 +0000 |
commit | f644bea112becce051fb7faa85d2c1bb47c8eee5 (patch) | |
tree | b4c2065ae96ef3bbc1a046f3cc536541af78f5aa /common | |
parent | bb57506d48e783027dbf09ab44c88b40ed7d2fa4 (diff) | |
download | scummvm-rg350-f644bea112becce051fb7faa85d2c1bb47c8eee5.tar.gz scummvm-rg350-f644bea112becce051fb7faa85d2c1bb47c8eee5.tar.bz2 scummvm-rg350-f644bea112becce051fb7faa85d2c1bb47c8eee5.zip |
improved the text display in a newgui a bit: make the font proportiona; implemented text alignment (left/right/center); alpha blending now not anymore at 50% but at 66%; moved some #defines to util.h
svn-id: r4972
Diffstat (limited to 'common')
-rw-r--r-- | common/util.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/common/util.h b/common/util.h index 79a6eb1068..85ea599278 100644 --- a/common/util.h +++ b/common/util.h @@ -38,6 +38,20 @@ #define SWAP(a,b) do{int tmp=a; a=b; b=tmp; } while(0) #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) + +#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); |