projects
/
supertux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9b8baa9
)
Allow creation of a Color object feeding with a vector of Uints.
author
Ricardo Cruz
<rick2@aeiou.pt>
Sat, 21 Aug 2004 11:39:59 +0000
(11:39 +0000)
committer
Ricardo Cruz
<rick2@aeiou.pt>
Sat, 21 Aug 2004 11:39:59 +0000
(11:39 +0000)
SVN-Revision: 1820
lib/video/screen.h
patch
|
blob
|
history
diff --git
a/lib/video/screen.h
b/lib/video/screen.h
index
a1797fe
..
93c0bfa
100644
(file)
--- a/
lib/video/screen.h
+++ b/
lib/video/screen.h
@@
-26,6
+26,8
@@
#endif
#include <iostream>
+#include <vector>
+
namespace SuperTux
{
@@
-42,6
+44,11
@@
namespace SuperTux
: 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)
{ }