[Scummvm-cvs-logs] CVS: scummvm/common system.h,1.91,1.92
Marcus Comstedt
marcus_c at users.sourceforge.net
Sun Apr 3 12:41:53 CEST 2005
Update of /cvsroot/scummvm/scummvm/common
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28883
Modified Files:
system.h
Log Message:
Added possibility to have an overlay with an alpha channel.
Index: system.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/system.h,v
retrieving revision 1.91
retrieving revision 1.92
diff -u -d -r1.91 -r1.92
--- system.h 14 Mar 2005 08:24:38 -0000 1.91
+++ system.h 3 Apr 2005 19:40:54 -0000 1.92
@@ -333,6 +333,13 @@
virtual int overlayToScreenY(int y) { return y; }
/**
+ * Return true if the overlay pixel format has an alpha channel.
+ */
+ virtual bool hasAlpha() const {
+ return false;
+ }
+
+ /**
* Convert the given RGB triplet into an OverlayColor. A OverlayColor can
* be 8bit, 16bit or 32bit, depending on the target system. The default
* implementation generates a 16 bit color value, in the 565 format
@@ -356,6 +363,29 @@
b = ((color&0x1F) << 3);
}
+ /**
+ * Convert the given ARGB quadruplet into an OverlayColor. A OverlayColor can
+ * be 8bit, 16bit or 32bit, depending on the target system. The default
+ * implementation generates a 16 bit color value, in the 565 format
+ * (that is, 5 bits red, 6 bits green, 5 bits blue).
+ * @see colorToRGB
+ */
+ virtual OverlayColor ARGBToColor(uint8 a, uint8 r, uint8 g, uint8 b) {
+ return RGBToColor(r, g, b);
+ }
+
+ /**
+ * Convert the given OverlayColor into an ARGB quadruplet. An OverlayColor can
+ * be 8bit, 16bit or 32bit, depending on the target system. The default
+ * implementation takes a 16 bit color value and assumes it to be in 565 format
+ * (that is, 5 bits red, 6 bits green, 5 bits blue).
+ * @see RGBToColor
+ */
+ virtual void colorToARGB(OverlayColor color, uint8 &a, uint8 &r, uint8 &g, uint8 &b) {
+ colorToRGB(color, r, g, b);
+ a = 255;
+ }
+
//@}
More information about the Scummvm-git-logs
mailing list