Mercurial > fife-parpg
comparison engine/core/controller/enginesettings.h @ 0:4a0efb7baf70
* Datasets becomes the new trunk and retires after that :-)
author | mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Sun, 29 Jun 2008 18:44:17 +0000 |
parents | |
children | 90005975cdbb |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:4a0efb7baf70 |
---|---|
1 /*************************************************************************** | |
2 * Copyright (C) 2005-2008 by the FIFE team * | |
3 * http://www.fifengine.de * | |
4 * This file is part of FIFE. * | |
5 * * | |
6 * FIFE is free software; you can redistribute it and/or modify * | |
7 * it under the terms of the GNU General Public License as published by * | |
8 * the Free Software Foundation; either version 2 of the License, or * | |
9 * (at your option) any later version. * | |
10 * * | |
11 * This program is distributed in the hope that it will be useful, * | |
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of * | |
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * | |
14 * GNU General Public License for more details. * | |
15 * * | |
16 * You should have received a copy of the GNU General Public License * | |
17 * along with this program; if not, write to the * | |
18 * Free Software Foundation, Inc., * | |
19 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * | |
20 ***************************************************************************/ | |
21 | |
22 #ifndef FIFE_ENGINESETTINGS_H | |
23 #define FIFE_ENGINESETTINGS_H | |
24 | |
25 // Standard C++ library includes | |
26 #include <vector> | |
27 | |
28 // 3rd party library includes | |
29 | |
30 // FIFE includes | |
31 // These includes are split up in two parts, separated by one empty line | |
32 // First block: files included from the FIFE root src directory | |
33 // Second block: files included from the same folder | |
34 #include "util/base/exception.h" | |
35 | |
36 namespace FIFE { | |
37 class NotSupported; | |
38 | |
39 /** This class defines the engine settings on engine init | |
40 * | |
41 */ | |
42 class EngineSettings { | |
43 public: | |
44 /** Constructor | |
45 */ | |
46 EngineSettings(); | |
47 | |
48 /** Destructor | |
49 */ | |
50 ~EngineSettings(); | |
51 | |
52 /** Validates settings. On invalid settings, throws NotSet with message | |
53 */ | |
54 void validate() const; | |
55 | |
56 /** Sets bits per pixel | |
57 * @see getPossibleBitsPerPixel | |
58 */ | |
59 void setBitsPerPixel(unsigned int bitsperpixel); | |
60 | |
61 /** Gets currently set bits per pixel value | |
62 */ | |
63 unsigned int getBitsPerPixel() const { | |
64 return m_bitsperpixel; | |
65 } | |
66 | |
67 /** Gets all possible bits per pixel values | |
68 */ | |
69 std::vector<unsigned int> getPossibleBitsPerPixel() const; | |
70 | |
71 /** Sets fullscreen / windowed mode | |
72 */ | |
73 void setFullScreen(bool fullscreen) { | |
74 m_fullscreen = fullscreen; | |
75 } | |
76 | |
77 /** True, if set to fullscreen. False = windowed | |
78 */ | |
79 bool isFullScreen() const { | |
80 return m_fullscreen; | |
81 } | |
82 | |
83 /** Sets initial engine sound volume | |
84 * @see getInitialMaxVolume | |
85 */ | |
86 void setInitialVolume(float volume); | |
87 | |
88 /** Gets initial engine sound volume | |
89 */ | |
90 float getInitialVolume() const { | |
91 return m_initialvolume; | |
92 } | |
93 | |
94 /** Gets maximum volume that can be set | |
95 */ | |
96 float getMaxVolume() const; | |
97 | |
98 /** Sets name for renderbackend | |
99 * @see getPossibleRenderBackends | |
100 */ | |
101 void setRenderBackend(const std::string& renderbackend); | |
102 | |
103 /** Gets currently set renderbackend name | |
104 */ | |
105 const std::string getRenderBackend() const { | |
106 return m_renderbackend; | |
107 } | |
108 | |
109 /** Gets all possible renderbackend names | |
110 */ | |
111 std::vector<std::string> getPossibleRenderBackends(); | |
112 | |
113 /** Sets if fake alpha is removed in SDL renderbackend | |
114 */ | |
115 void setSDLRemoveFakeAlpha(bool sldremovefakealpha); | |
116 | |
117 /** Tells if fake alpha is removed in SDL renderbackend | |
118 */ | |
119 bool isSDLRemoveFakeAlpha(bool sldremovefakealpha) const { | |
120 return m_sldremovefakealpha; | |
121 } | |
122 | |
123 /** Sets screen width (pixels) | |
124 */ | |
125 void setScreenWidth(unsigned int screenwidth); | |
126 | |
127 /** Gets screen width (pixels) | |
128 */ | |
129 unsigned int getScreenWidth() const { | |
130 return m_screenwidth; | |
131 } | |
132 | |
133 /** Sets screen height (pixels) | |
134 */ | |
135 void setScreenHeight(unsigned int screenheight); | |
136 | |
137 /** Gets screen height (pixels) | |
138 */ | |
139 unsigned int getScreenHeight() const { | |
140 return m_screenheight; | |
141 } | |
142 | |
143 /** Sets path for default font | |
144 */ | |
145 void setDefaultFontPath(const std::string& defaultfontpath); | |
146 | |
147 /** Sets current path for default font | |
148 */ | |
149 std::string getDefaultFontPath() const { | |
150 return m_defaultfontpath; | |
151 } | |
152 | |
153 /** Sets size for default font | |
154 */ | |
155 void setDefaultFontSize(const unsigned int defaultfontsize); | |
156 | |
157 /** Gets size for default font | |
158 */ | |
159 unsigned int getDefaultFontSize() const { | |
160 return m_defaultfontsize; | |
161 } | |
162 | |
163 /** Sets glyphs for default font | |
164 */ | |
165 void setDefaultFontGlyphs(const std::string& defaultfontglyphs); | |
166 | |
167 /** Gets current glyphs for default font | |
168 */ | |
169 std::string getDefaultFontGlyphs() const { | |
170 return m_defaultfontglyphs; | |
171 } | |
172 | |
173 /** Sets image chunking size, @see RenderBackend::setChunkingSize | |
174 */ | |
175 void setImageChunkingSize(unsigned int size) { | |
176 m_image_chunking_size = size; | |
177 } | |
178 | |
179 /** @see setImageChunkingSize | |
180 */ | |
181 unsigned int getImageChunkingSize() { | |
182 return m_image_chunking_size; | |
183 } | |
184 | |
185 | |
186 private: | |
187 unsigned int m_bitsperpixel; | |
188 bool m_fullscreen; | |
189 float m_initialvolume; | |
190 std::string m_renderbackend; | |
191 bool m_sldremovefakealpha; | |
192 unsigned int m_screenwidth; | |
193 unsigned int m_screenheight; | |
194 | |
195 std::string m_defaultfontpath; | |
196 unsigned int m_defaultfontsize; | |
197 std::string m_defaultfontglyphs; | |
198 unsigned int m_image_chunking_size; | |
199 }; | |
200 | |
201 }//FIFE | |
202 | |
203 #endif | |
204 |