Update of /cvsroot/super-tux/supertux/lib/video
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv960/lib/video
Modified Files:
screen.h
Log Message:
Allow creation of a Color object feeding with a vector of Uints.
Index: screen.h
===================================================================
RCS file: /cvsroot/super-tux/supertux/lib/video/screen.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- screen.h 21 Jul 2004 16:51:53 -0000 1.2
+++ screen.h 21 Aug 2004 11:39:59 -0000 1.3
@@ -26,6 +26,8 @@
#endif
#include <iostream>
+#include <vector>
+
namespace SuperTux
{
@@ -42,6 +44,11 @@
: red(red_), green(green_), blue(blue_), alpha(alpha_)
{}
+ Color(std::vector <unsigned int> color)
+ : red(0), green(0), blue(0), alpha(255)
+ { if(color.size() >= 3) { red = color[0]; green = color[1]; blue = color[2]; }
+ if(color.size() == 4) alpha = color[3]; }
+
Color(const Color& o)
: red(o.red), green(o.green), blue(o.blue), alpha(o.alpha)
{ }
|