xoreos  0.0.5
highlightable.h
Go to the documentation of this file.
1 /* xoreos - A reimplementation of BioWare's Aurora engine
2  *
3  * xoreos is the legal property of its developers, whose names
4  * can be found in the AUTHORS file distributed with this source
5  * distribution.
6  *
7  * xoreos is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 3
10  * of the License, or (at your option) any later version.
11  *
12  * xoreos is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with xoreos. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 #ifndef GRAPHICS_AURORA_HIGHLIGHTABLE_H
22 #define GRAPHICS_AURORA_HIGHLIGHTABLE_H
23 
24 #include "src/common/types.h"
25 
26 namespace Graphics {
27 
28 namespace Aurora {
29 
31 
32 public:
33  Highlightable();
34  virtual ~Highlightable();
35 
36  bool isHighlightable() const;
37  void setHighlightable(bool highlightable);
38 
39  bool isHightlighted() const;
40  void setHighlighted(bool hightlighted);
41 
46  void setHighlightDelta(float r, float g, float b, float a);
47 
49  void setHighlightUpperBound(float r, float g, float b, float a);
50 
52  void setHighlightLowerBound(float r, float g, float b, float a);
53 
54  void getHighlightedLowerBound(float &r, float &g, float &b, float &a) const;
55 
56 protected:
57  void flipHighlightDelta();
58 
59  void incrementColor(float initialR, float initialG, float initialB, float initialA,
60  float &r, float &g, float &b, float &a);
61 
62 
63 private:
66 
67  float _deltaR;
68  float _deltaG;
69  float _deltaB;
70  float _deltaA;
71 
72  float _upperBoundR;
73  float _upperBoundG;
74  float _upperBoundB;
75  float _upperBoundA;
76 
77  float _lowerBoundR;
78  float _lowerBoundG;
79  float _lowerBoundB;
80  float _lowerBoundA;
81 
83 };
84 
85 } // End of namespace Aurora
86 
87 } // End of namespace Graphics
88 
89 #endif // GRAPHICS_AURORA_HIGHLIGHTABLE_H
void setHighlighted(bool hightlighted)
void setHighlightable(bool highlightable)
Low-level type definitions to handle fixed width types portably.
void setHighlightDelta(float r, float g, float b, float a)
Set how much the quad changes per render.
uint32_t uint32
Definition: types.h:204
void incrementColor(float initialR, float initialG, float initialB, float initialA, float &r, float &g, float &b, float &a)
void setHighlightUpperBound(float r, float g, float b, float a)
When any of the quad properties are greater than this bound, the signs of the delta floats will flip...
void setHighlightLowerBound(float r, float g, float b, float a)
When any of the quad properties are less than this bound, the signs of the delta floats will flip...
void getHighlightedLowerBound(float &r, float &g, float &b, float &a) const