[Scummvm-cvs-logs] CVS: scummvm/common util.h,1.4,1.5

Max Horn fingolfin at users.sourceforge.net
Thu Sep 19 10:04:03 CEST 2002


Update of /cvsroot/scummvm/scummvm/common
In directory usw-pr-cvs1:/tmp/cvs-serv9164/common

Modified Files:
	util.h 
Log Message:
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

Index: util.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/util.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- util.h	15 Sep 2002 09:06:02 -0000	1.4
+++ util.h	19 Sep 2002 17:03:24 -0000	1.5
@@ -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);





More information about the Scummvm-git-logs mailing list