xoreos  0.0.5
guibackground.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 
25 #ifndef ENGINES_KOTOR_GUI_GUIBACKGROUND_H
26 #define ENGINES_KOTOR_GUI_GUIBACKGROUND_H
27 
29 
31 
32 #include "src/events/notifyable.h"
33 
34 namespace Common {
35  class UString;
36 }
37 
38 namespace Engines {
39 
40 namespace KotOR {
41 
42 static const Common::UString &kBackgroundTypeMenu = "back";
43 static const Common::UString &kBackgroundTypeComp0 = "comp0";
44 static const Common::UString &kBackgroundTypeComp1 = "comp1";
45 static const Common::UString &kBackgroundTypeLoad = "load";
46 static const Common::UString &kBackgroundTypeMap = "map";
47 static const Common::UString &kBackgroundTypePazaak = "pazaak";
48 static const Common::UString &kBackgroundTypeStore = "store";
49 
51 public:
52  GUIBackground(const Common::UString &type = kBackgroundTypeMenu, bool front = false);
54 
55  void setType(const Common::UString &type);
56 
57  // Renderable
58  void calculateDistance();
60 
61 private:
63 
65 
68 
69  int _vertexX1;
70  int _vertexX2;
71  int _vertexY1;
72  int _vertexY2;
73 
74  bool _render;
75 
76  void update();
77  bool tryBackground(int x, int y);
78 
79  void notifyResized(int oldWidth, int oldHeight, int newWidth, int newHeight);
80 };
81 
82 } // End of namespace KotOR
83 
84 } // End of namespace Engines
85 
86 #endif // ENGINES_KOTOR_GUI_GUIBACKGROUND_H
static const Common::UString & kBackgroundTypeMenu
Definition: guibackground.h:42
Definition: 2dafile.h:39
A class holding an UTF-8 string.
Definition: ustring.h:48
static const Common::UString & kBackgroundTypeStore
Definition: guibackground.h:48
void render(Graphics::RenderPass pass)
Render the object.
static const Common::UString & kBackgroundTypeComp1
Definition: guibackground.h:44
A handle to an Aurora texture.
static const Common::UString & kBackgroundTypeMap
Definition: guibackground.h:46
GUIBackground(const Common::UString &type=kBackgroundTypeMenu, bool front=false)
static const Common::UString & kBackgroundTypePazaak
Definition: guibackground.h:47
A GUI element.
void setType(const Common::UString &type)
RenderPass
Definition: types.h:97
void calculateDistance()
Calculate the object&#39;s distance.
A class that can be notified by the NotificationManager.
Graphics::Aurora::TextureHandle _texture
Definition: guibackground.h:62
An element of the GUI.
Definition: guielement.h:33
static const Common::UString & kBackgroundTypeComp0
Definition: guibackground.h:43
void notifyResized(int oldWidth, int oldHeight, int newWidth, int newHeight)
static const Common::UString & kBackgroundTypeLoad
Definition: guibackground.h:45
#define pass
Definition: fft.cpp:257
bool tryBackground(int x, int y)
A handle to a texture.
Definition: texturehandle.h:51