_________ __                 __
        /   _____//  |_____________ _/  |______     ____  __ __  ______
        \_____  \\   __\_  __ \__  \\   __\__  \   / ___\|  |  \/  ___/
        /        \|  |  |  | \// __ \|  |  / __ \_/ /_/  >  |  /\___ \
       /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
               \/                  \/          \//_____/            \/
    ______________________                           ______________________
                          T H E   W A R   B E G I N S
                   Stratagus - A free fantasy real time strategy game engine

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
color.h
Go to the documentation of this file.
1 // _________ __ __
2 // / _____// |_____________ _/ |______ ____ __ __ ______
3 // \_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/
4 // / \| | | | \// __ \| | / __ \_/ /_/ > | /\___ |
5 // /_______ /|__| |__| (____ /__| (____ /\___ /|____//____ >
6 // \/ \/ \//_____/ \/
7 // ______________________ ______________________
8 // T H E W A R B E G I N S
9 // Stratagus - A free fantasy real time strategy game engine
10 //
12 //
13 // (c) Copyright 2012 by Joris Dauphin
14 //
15 // This program is free software; you can redistribute it and/or modify
16 // it under the terms of the GNU General Public License as published by
17 // the Free Software Foundation; only version 2 of the License.
18 //
19 // This program is distributed in the hope that it will be useful,
20 // but WITHOUT ANY WARRANTY; without even the implied warranty of
21 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 // GNU General Public License for more details.
23 //
24 // You should have received a copy of the GNU General Public License
25 // along with this program; if not, write to the Free Software
26 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
27 // 02111-1307, USA.
28 //
29 
30 #ifndef COLOR_H
31 #define COLOR_H
32 
34 
35 struct SDL_Color;
36 struct lua_State;
37 
39 class CColor
40 {
41 public:
42  CColor() : R(0), G(0), B(0), A(0) {}
43  CColor(unsigned char r, unsigned char g, unsigned char b,
44  unsigned char a = 0) : R(r), G(g), B(b), A(a) {}
45  CColor(const CColor &color) : R(color.R), G(color.G), B(color.B), A(color.A) {}
46 
47  void Parse(lua_State *l, int index = -1);
48 
50  operator SDL_Color() const;
51 
52 public:
53  unsigned char R;
54  unsigned char G;
55  unsigned char B;
56  unsigned char A;
57 };
58 
59 
60 #include <vector>
61 
63 {
64 public:
66 
67 public:
68  std::vector<CColor> Colors;
69 };
70 
71 
72 #include <stdint.h>
73 
74 typedef uint32_t IntColor; // Uint32 in SDL
75 
76 
78 
79 #endif
A platform independent color.
Definition: color.h:39
CColor()
Definition: color.h:42
unsigned char B
Green.
Definition: color.h:55
Definition: color.h:62
unsigned char R
Definition: color.h:53
void Parse(lua_State *l, int index=-1)
Definition: color.cpp:46
std::vector< CColor > Colors
Definition: color.h:68
unsigned char A
Blue.
Definition: color.h:56
unsigned char G
Red.
Definition: color.h:54
CColor(const CColor &color)
Definition: color.h:45
uint32_t IntColor
Definition: color.h:74
CColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a=0)
Definition: color.h:43
CUnitColors()
Definition: color.h:65
(C) Copyright 1998-2012 by The Stratagus Project under the GNU General Public License.
All trademarks and copyrights on this page are owned by their respective owners.