comparison engine/core/controller/enginesettings.h @ 621:356634098bd9

* Removed the image chunking size variable from engine settings. * Replaced the existing define of PI and added some math related static const variables
author prock@33b003aa-7bff-0310-803a-e67f0ece8222
date Fri, 01 Oct 2010 14:09:47 +0000
parents 79678719d569
children a7909cdcdc85
comparison
equal deleted inserted replaced
620:853d25234671 621:356634098bd9
42 class EngineSettings { 42 class EngineSettings {
43 public: 43 public:
44 /** Constructor 44 /** Constructor
45 */ 45 */
46 EngineSettings(); 46 EngineSettings();
47 47
48 /** Destructor 48 /** Destructor
49 */ 49 */
50 ~EngineSettings(); 50 ~EngineSettings();
51 51
52 /** Validates settings. On invalid settings, throws NotSet with message 52 /** Validates settings. On invalid settings, throws NotSet with message
53 */ 53 */
54 void validate() const; 54 void validate() const;
55 55
56 /** Sets bits per pixel 56 /** Sets bits per pixel
57 * @see getPossibleBitsPerPixel 57 * @see getPossibleBitsPerPixel
58 */ 58 */
59 void setBitsPerPixel(unsigned int bitsperpixel); 59 void setBitsPerPixel(unsigned int bitsperpixel);
60 60
61 /** Gets currently set bits per pixel value 61 /** Gets currently set bits per pixel value
62 */ 62 */
63 unsigned int getBitsPerPixel() const { 63 unsigned int getBitsPerPixel() const {
64 return m_bitsperpixel; 64 return m_bitsperpixel;
65 } 65 }
66 66
67 /** Gets all possible bits per pixel values 67 /** Gets all possible bits per pixel values
68 */ 68 */
69 std::vector<unsigned int> getPossibleBitsPerPixel() const; 69 std::vector<unsigned int> getPossibleBitsPerPixel() const;
70 70
71 /** Gets all possible screen resolutions 71 /** Gets all possible screen resolutions
72 */ 72 */
73 std::vector<std::pair<unsigned int, unsigned int> > getPossibleResolutions() const; 73 std::vector<std::pair<unsigned int, unsigned int> > getPossibleResolutions() const;
74 74
75 /** Sets fullscreen / windowed mode 75 /** Sets fullscreen / windowed mode
76 */ 76 */
77 void setFullScreen(bool fullscreen) { 77 void setFullScreen(bool fullscreen) {
78 m_fullscreen = fullscreen; 78 m_fullscreen = fullscreen;
79 } 79 }
80 80
81 /** True, if set to fullscreen. False = windowed 81 /** True, if set to fullscreen. False = windowed
82 */ 82 */
83 bool isFullScreen() const { 83 bool isFullScreen() const {
84 return m_fullscreen; 84 return m_fullscreen;
85 } 85 }
86 86
87 /** Sets initial engine sound volume 87 /** Sets initial engine sound volume
88 * @see getInitialMaxVolume 88 * @see getInitialMaxVolume
89 */ 89 */
90 void setInitialVolume(float volume); 90 void setInitialVolume(float volume);
91 91
92 /** Gets initial engine sound volume 92 /** Gets initial engine sound volume
93 */ 93 */
94 float getInitialVolume() const { 94 float getInitialVolume() const {
95 return m_initialvolume; 95 return m_initialvolume;
96 } 96 }
97 97
98 /** Gets maximum volume that can be set 98 /** Gets maximum volume that can be set
99 */ 99 */
100 float getMaxVolume() const; 100 float getMaxVolume() const;
101 101
102 /** Sets name for renderbackend 102 /** Sets name for renderbackend
103 * @see getPossibleRenderBackends 103 * @see getPossibleRenderBackends
104 */ 104 */
105 void setRenderBackend(const std::string& renderbackend); 105 void setRenderBackend(const std::string& renderbackend);
106 106
107 /** Gets currently set renderbackend name 107 /** Gets currently set renderbackend name
108 */ 108 */
109 const std::string getRenderBackend() const { 109 const std::string getRenderBackend() const {
110 return m_renderbackend; 110 return m_renderbackend;
111 } 111 }
112 112
113 /** Gets all possible renderbackend names 113 /** Gets all possible renderbackend names
114 */ 114 */
115 std::vector<std::string> getPossibleRenderBackends(); 115 std::vector<std::string> getPossibleRenderBackends();
116 116
117 /** Sets if fake alpha is removed in SDL renderbackend 117 /** Sets if fake alpha is removed in SDL renderbackend
118 */ 118 */
119 void setSDLRemoveFakeAlpha(bool sdlremovefakealpha); 119 void setSDLRemoveFakeAlpha(bool sdlremovefakealpha);
120 120
121 /** Tells if fake alpha is removed in SDL renderbackend 121 /** Tells if fake alpha is removed in SDL renderbackend
122 */ 122 */
123 bool isSDLRemoveFakeAlpha(bool sdlremovefakealpha) const { 123 bool isSDLRemoveFakeAlpha(bool sdlremovefakealpha) const {
124 return m_sdlremovefakealpha; 124 return m_sdlremovefakealpha;
125 } 125 }
126 126
127 /** Sets screen width (pixels) 127 /** Sets screen width (pixels)
128 */ 128 */
129 void setScreenWidth(unsigned int screenwidth); 129 void setScreenWidth(unsigned int screenwidth);
130 130
131 /** Gets screen width (pixels) 131 /** Gets screen width (pixels)
132 */ 132 */
133 unsigned int getScreenWidth() const { 133 unsigned int getScreenWidth() const {
134 return m_screenwidth; 134 return m_screenwidth;
135 } 135 }
136 136
137 /** Sets screen height (pixels) 137 /** Sets screen height (pixels)
138 */ 138 */
139 void setScreenHeight(unsigned int screenheight); 139 void setScreenHeight(unsigned int screenheight);
140 140
141 /** Gets screen height (pixels) 141 /** Gets screen height (pixels)
142 */ 142 */
143 unsigned int getScreenHeight() const { 143 unsigned int getScreenHeight() const {
144 return m_screenheight; 144 return m_screenheight;
145 } 145 }
146 146
147 /** Sets path for default font 147 /** Sets path for default font
148 */ 148 */
149 void setDefaultFontPath(const std::string& defaultfontpath); 149 void setDefaultFontPath(const std::string& defaultfontpath);
150 150
151 /** Sets current path for default font 151 /** Sets current path for default font
152 */ 152 */
153 std::string getDefaultFontPath() const { 153 std::string getDefaultFontPath() const {
154 return m_defaultfontpath; 154 return m_defaultfontpath;
155 } 155 }
156 156
157 /** Sets size for default font 157 /** Sets size for default font
158 */ 158 */
159 void setDefaultFontSize(const unsigned int defaultfontsize); 159 void setDefaultFontSize(const unsigned int defaultfontsize);
160 160
161 /** Gets size for default font 161 /** Gets size for default font
162 */ 162 */
163 unsigned int getDefaultFontSize() const { 163 unsigned int getDefaultFontSize() const {
164 return m_defaultfontsize; 164 return m_defaultfontsize;
165 } 165 }
166 166
167 /** Sets glyphs for default font 167 /** Sets glyphs for default font
168 */ 168 */
169 void setDefaultFontGlyphs(const std::string& defaultfontglyphs); 169 void setDefaultFontGlyphs(const std::string& defaultfontglyphs);
170 170
171 /** Gets current glyphs for default font 171 /** Gets current glyphs for default font
172 */ 172 */
173 std::string getDefaultFontGlyphs() const { 173 std::string getDefaultFontGlyphs() const {
174 return m_defaultfontglyphs; 174 return m_defaultfontglyphs;
175 } 175 }
176
177 /** Sets image chunking size, @see RenderBackend::setChunkingSize
178 */
179 void setImageChunkingSize(unsigned int size) {
180 m_image_chunking_size = size;
181 }
182
183 /** @see setImageChunkingSize
184 */
185 unsigned int getImageChunkingSize() const {
186 return m_image_chunking_size;
187 }
188 176
189 /** Sets the title of the window 177 /** Sets the title of the window
190 */ 178 */
191 void setWindowTitle(const std::string& title); 179 void setWindowTitle(const std::string& title);
192 180
193 /** Gets the current window title 181 /** Gets the current window title
194 */ 182 */
195 std::string getWindowTitle() const { 183 std::string getWindowTitle() const {
196 return m_windowtitle; 184 return m_windowtitle;
197 } 185 }
198 186
199 /** Sets the icon that appears in the window title bar 187 /** Sets the icon that appears in the window title bar
200 */ 188 */
201 void setWindowIcon(const std::string& icon); 189 void setWindowIcon(const std::string& icon);
202 190
203 /** Gets the icon in the window title bar 191 /** Gets the icon in the window title bar
219 void setColorKey(Uint8 r, Uint8 g, Uint8 b); 207 void setColorKey(Uint8 r, Uint8 g, Uint8 b);
220 208
221 /** Gets the global colorkey setting 209 /** Gets the global colorkey setting
222 */ 210 */
223 const SDL_Color& getColorKey() const; 211 const SDL_Color& getColorKey() const;
224 212
225 private: 213 private:
226 unsigned int m_bitsperpixel; 214 unsigned int m_bitsperpixel;
227 bool m_fullscreen; 215 bool m_fullscreen;
228 float m_initialvolume; 216 float m_initialvolume;
229 std::string m_renderbackend; 217 std::string m_renderbackend;
230 bool m_sdlremovefakealpha; 218 bool m_sdlremovefakealpha;
231 unsigned int m_screenwidth; 219 unsigned int m_screenwidth;
232 unsigned int m_screenheight; 220 unsigned int m_screenheight;
233 std::string m_windowtitle; 221 std::string m_windowtitle;
234 std::string m_windowicon; 222 std::string m_windowicon;
235 223
236 224
237 std::string m_defaultfontpath; 225 std::string m_defaultfontpath;
238 unsigned int m_defaultfontsize; 226 unsigned int m_defaultfontsize;
239 std::string m_defaultfontglyphs; 227 std::string m_defaultfontglyphs;
240 unsigned int m_image_chunking_size;
241 bool m_iscolorkeyenabled; 228 bool m_iscolorkeyenabled;
242 SDL_Color m_colorkey; 229 SDL_Color m_colorkey;
243 }; 230 };
244 231
245 }//FIFE 232 }//FIFE