]> git.lizzy.rs Git - irrlicht.git/blob - source/Irrlicht/CGUISkin.cpp
Drop IrrCompileConfig (#163)
[irrlicht.git] / source / Irrlicht / CGUISkin.cpp
1 // Copyright (C) 2002-2012 Nikolaus Gebhardt\r
2 // This file is part of the "Irrlicht Engine".\r
3 // For conditions of distribution and use, see copyright notice in irrlicht.h\r
4 \r
5 #include "CGUISkin.h"\r
6 \r
7 #include "IGUIFont.h"\r
8 #include "IGUISpriteBank.h"\r
9 #include "IGUIElement.h"\r
10 #include "IVideoDriver.h"\r
11 #include "IAttributes.h"\r
12 \r
13 namespace irr\r
14 {\r
15 namespace gui\r
16 {\r
17 \r
18 CGUISkin::CGUISkin(EGUI_SKIN_TYPE type, video::IVideoDriver* driver)\r
19 : SpriteBank(0), Driver(driver), Type(type)\r
20 {\r
21         #ifdef _DEBUG\r
22         setDebugName("CGUISkin");\r
23         #endif\r
24 \r
25         if ((Type == EGST_WINDOWS_CLASSIC) || (Type == EGST_WINDOWS_METALLIC))\r
26         {\r
27                 Colors[EGDC_3D_DARK_SHADOW]     = video::SColor(101,50,50,50);\r
28                 Colors[EGDC_3D_SHADOW]          = video::SColor(101,130,130,130);\r
29                 Colors[EGDC_3D_FACE]            = video::SColor(101,210,210,210);\r
30                 Colors[EGDC_3D_HIGH_LIGHT]      = video::SColor(101,255,255,255);\r
31                 Colors[EGDC_3D_LIGHT]           = video::SColor(101,210,210,210);\r
32                 Colors[EGDC_ACTIVE_BORDER]      = video::SColor(101,16,14,115);\r
33                 Colors[EGDC_ACTIVE_CAPTION]     = video::SColor(255,255,255,255);\r
34                 Colors[EGDC_APP_WORKSPACE]      = video::SColor(101,100,100,100);\r
35                 Colors[EGDC_BUTTON_TEXT]        = video::SColor(240,10,10,10);\r
36                 Colors[EGDC_GRAY_TEXT]          = video::SColor(240,130,130,130);\r
37                 Colors[EGDC_HIGH_LIGHT]         = video::SColor(101,8,36,107);\r
38                 Colors[EGDC_HIGH_LIGHT_TEXT]    = video::SColor(240,255,255,255);\r
39                 Colors[EGDC_INACTIVE_BORDER]    = video::SColor(101,165,165,165);\r
40                 Colors[EGDC_INACTIVE_CAPTION]   = video::SColor(255,30,30,30);\r
41                 Colors[EGDC_TOOLTIP]            = video::SColor(200,0,0,0);\r
42                 Colors[EGDC_TOOLTIP_BACKGROUND] = video::SColor(200,255,255,225);\r
43                 Colors[EGDC_SCROLLBAR]          = video::SColor(101,230,230,230);\r
44                 Colors[EGDC_WINDOW]             = video::SColor(101,255,255,255);\r
45                 Colors[EGDC_WINDOW_SYMBOL]      = video::SColor(200,10,10,10);\r
46                 Colors[EGDC_ICON]               = video::SColor(200,255,255,255);\r
47                 Colors[EGDC_ICON_HIGH_LIGHT]    = video::SColor(200,8,36,107);\r
48                 Colors[EGDC_GRAY_WINDOW_SYMBOL] = video::SColor(240,100,100,100);\r
49                 Colors[EGDC_EDITABLE]                   = video::SColor(255,255,255,255);\r
50                 Colors[EGDC_GRAY_EDITABLE]              = video::SColor(255,120,120,120);\r
51                 Colors[EGDC_FOCUSED_EDITABLE]   = video::SColor(255,240,240,255);\r
52 \r
53 \r
54                 Sizes[EGDS_SCROLLBAR_SIZE] = 14;\r
55                 Sizes[EGDS_MENU_HEIGHT] = 30;\r
56                 Sizes[EGDS_WINDOW_BUTTON_WIDTH] = 15;\r
57                 Sizes[EGDS_CHECK_BOX_WIDTH] = 18;\r
58                 Sizes[EGDS_MESSAGE_BOX_WIDTH] = 500;\r
59                 Sizes[EGDS_MESSAGE_BOX_HEIGHT] = 200;\r
60                 Sizes[EGDS_BUTTON_WIDTH] = 80;\r
61                 Sizes[EGDS_BUTTON_HEIGHT] = 30;\r
62 \r
63                 Sizes[EGDS_TEXT_DISTANCE_X] = 2;\r
64                 Sizes[EGDS_TEXT_DISTANCE_Y] = 0;\r
65 \r
66                 Sizes[EGDS_TITLEBARTEXT_DISTANCE_X] = 2;\r
67                 Sizes[EGDS_TITLEBARTEXT_DISTANCE_Y] = 0;\r
68         }\r
69         else\r
70         {\r
71                 //0x80a6a8af\r
72                 Colors[EGDC_3D_DARK_SHADOW]     =       0x60767982;\r
73                 //Colors[EGDC_3D_FACE]                  =       0xc0c9ccd4;             // tab background\r
74                 Colors[EGDC_3D_FACE]                    =       0xc0cbd2d9;             // tab background\r
75                 Colors[EGDC_3D_SHADOW]                  =       0x50e4e8f1;             // tab background, and left-top highlight\r
76                 Colors[EGDC_3D_HIGH_LIGHT]              =       0x40c7ccdc;\r
77                 Colors[EGDC_3D_LIGHT]                   =       0x802e313a;\r
78                 Colors[EGDC_ACTIVE_BORDER]              =       0x80404040;             // window title\r
79                 Colors[EGDC_ACTIVE_CAPTION]     =       0xffd0d0d0;\r
80                 Colors[EGDC_APP_WORKSPACE]              =       0xc0646464;             // unused\r
81                 Colors[EGDC_BUTTON_TEXT]                =       0xd0161616;\r
82                 Colors[EGDC_GRAY_TEXT]                  =       0x3c141414;\r
83                 Colors[EGDC_HIGH_LIGHT]                 =       0x6c606060;\r
84                 Colors[EGDC_HIGH_LIGHT_TEXT]    =       0xd0e0e0e0;\r
85                 Colors[EGDC_INACTIVE_BORDER]    =       0xf0a5a5a5;\r
86                 Colors[EGDC_INACTIVE_CAPTION]   =       0xffd2d2d2;\r
87                 Colors[EGDC_TOOLTIP]                    =       0xf00f2033;\r
88                 Colors[EGDC_TOOLTIP_BACKGROUND] =       0xc0cbd2d9;\r
89                 Colors[EGDC_SCROLLBAR]                  =       0xf0e0e0e0;\r
90                 Colors[EGDC_WINDOW]                             =       0xf0f0f0f0;\r
91                 Colors[EGDC_WINDOW_SYMBOL]              =       0xd0161616;\r
92                 Colors[EGDC_ICON]                               =       0xd0161616;\r
93                 Colors[EGDC_ICON_HIGH_LIGHT]    =       0xd0606060;\r
94                 Colors[EGDC_GRAY_WINDOW_SYMBOL] =       0x3c101010;\r
95                 Colors[EGDC_EDITABLE]                   =       0xf0ffffff;\r
96                 Colors[EGDC_GRAY_EDITABLE]              =       0xf0cccccc;\r
97                 Colors[EGDC_FOCUSED_EDITABLE]   =       0xf0fffff0;\r
98 \r
99                 Sizes[EGDS_SCROLLBAR_SIZE] = 14;\r
100                 Sizes[EGDS_MENU_HEIGHT] = 48;\r
101                 Sizes[EGDS_WINDOW_BUTTON_WIDTH] = 15;\r
102                 Sizes[EGDS_CHECK_BOX_WIDTH] = 18;\r
103                 Sizes[EGDS_MESSAGE_BOX_WIDTH] = 500;\r
104                 Sizes[EGDS_MESSAGE_BOX_HEIGHT] = 200;\r
105                 Sizes[EGDS_BUTTON_WIDTH] = 80;\r
106                 Sizes[EGDS_BUTTON_HEIGHT] = 30;\r
107 \r
108                 Sizes[EGDS_TEXT_DISTANCE_X] = 3;\r
109                 Sizes[EGDS_TEXT_DISTANCE_Y] = 2;\r
110 \r
111                 Sizes[EGDS_TITLEBARTEXT_DISTANCE_X] = 3;\r
112                 Sizes[EGDS_TITLEBARTEXT_DISTANCE_Y] = 2;\r
113         }\r
114 \r
115         Sizes[EGDS_MESSAGE_BOX_GAP_SPACE] = 15;\r
116         Sizes[EGDS_MESSAGE_BOX_MIN_TEXT_WIDTH] = 0;\r
117         Sizes[EGDS_MESSAGE_BOX_MAX_TEXT_WIDTH] = 500;\r
118         Sizes[EGDS_MESSAGE_BOX_MIN_TEXT_HEIGHT] = 0;\r
119         Sizes[EGDS_MESSAGE_BOX_MAX_TEXT_HEIGHT] = 99999;\r
120 \r
121         Sizes[EGDS_BUTTON_PRESSED_IMAGE_OFFSET_X] = 1;\r
122         Sizes[EGDS_BUTTON_PRESSED_IMAGE_OFFSET_Y] = 1;\r
123         Sizes[EGDS_BUTTON_PRESSED_TEXT_OFFSET_X] = 0;\r
124         Sizes[EGDS_BUTTON_PRESSED_TEXT_OFFSET_Y] = 2;\r
125         Sizes[EGDS_BUTTON_PRESSED_SPRITE_OFFSET_X] = 0;\r
126         Sizes[EGDS_BUTTON_PRESSED_SPRITE_OFFSET_Y] = 0;\r
127 \r
128         Texts[EGDT_MSG_BOX_OK] = L"OK";\r
129         Texts[EGDT_MSG_BOX_CANCEL] = L"Cancel";\r
130         Texts[EGDT_MSG_BOX_YES] = L"Yes";\r
131         Texts[EGDT_MSG_BOX_NO] = L"No";\r
132         Texts[EGDT_WINDOW_CLOSE] = L"Close";\r
133         Texts[EGDT_WINDOW_RESTORE] = L"Restore";\r
134         Texts[EGDT_WINDOW_MINIMIZE] = L"Minimize";\r
135         Texts[EGDT_WINDOW_MAXIMIZE] = L"Maximize";\r
136 \r
137         Icons[EGDI_WINDOW_MAXIMIZE] = 225;\r
138         Icons[EGDI_WINDOW_RESTORE] = 226;\r
139         Icons[EGDI_WINDOW_CLOSE] = 227;\r
140         Icons[EGDI_WINDOW_MINIMIZE] = 228;\r
141         Icons[EGDI_CURSOR_UP] = 229;\r
142         Icons[EGDI_CURSOR_DOWN] = 230;\r
143         Icons[EGDI_CURSOR_LEFT] = 231;\r
144         Icons[EGDI_CURSOR_RIGHT] = 232;\r
145         Icons[EGDI_MENU_MORE] = 232;\r
146         Icons[EGDI_CHECK_BOX_CHECKED] = 233;\r
147         Icons[EGDI_DROP_DOWN] = 234;\r
148         Icons[EGDI_SMALL_CURSOR_UP] = 235;\r
149         Icons[EGDI_SMALL_CURSOR_DOWN] = 236;\r
150         Icons[EGDI_RADIO_BUTTON_CHECKED] = 237;\r
151         Icons[EGDI_MORE_LEFT] = 238;\r
152         Icons[EGDI_MORE_RIGHT] = 239;\r
153         Icons[EGDI_MORE_UP] = 240;\r
154         Icons[EGDI_MORE_DOWN] = 241;\r
155         Icons[EGDI_WINDOW_RESIZE] = 242;\r
156         Icons[EGDI_EXPAND] = 243;\r
157         Icons[EGDI_COLLAPSE] = 244;\r
158 \r
159         Icons[EGDI_FILE] = 245;\r
160         Icons[EGDI_DIRECTORY] = 246;\r
161 \r
162         for (u32 i=0; i<EGDF_COUNT; ++i)\r
163                 Fonts[i] = 0;\r
164 \r
165         UseGradient = (Type == EGST_WINDOWS_METALLIC) || (Type == EGST_BURNING_SKIN) ;\r
166 }\r
167 \r
168 \r
169 //! destructor\r
170 CGUISkin::~CGUISkin()\r
171 {\r
172         for (u32 i=0; i<EGDF_COUNT; ++i)\r
173         {\r
174                 if (Fonts[i])\r
175                         Fonts[i]->drop();\r
176         }\r
177 \r
178         if (SpriteBank)\r
179                 SpriteBank->drop();\r
180 }\r
181 \r
182 \r
183 //! returns default color\r
184 video::SColor CGUISkin::getColor(EGUI_DEFAULT_COLOR color) const\r
185 {\r
186         if ((u32)color < EGDC_COUNT)\r
187                 return Colors[color];\r
188         else\r
189                 return video::SColor();\r
190 }\r
191 \r
192 \r
193 //! sets a default color\r
194 void CGUISkin::setColor(EGUI_DEFAULT_COLOR which, video::SColor newColor)\r
195 {\r
196         if ((u32)which < EGDC_COUNT)\r
197                 Colors[which] = newColor;\r
198 }\r
199 \r
200 \r
201 //! returns size for the given size type\r
202 s32 CGUISkin::getSize(EGUI_DEFAULT_SIZE size) const\r
203 {\r
204         if ((u32)size < EGDS_COUNT)\r
205                 return Sizes[size];\r
206         else\r
207                 return 0;\r
208 }\r
209 \r
210 \r
211 //! sets a default size\r
212 void CGUISkin::setSize(EGUI_DEFAULT_SIZE which, s32 size)\r
213 {\r
214         if ((u32)which < EGDS_COUNT)\r
215                 Sizes[which] = size;\r
216 }\r
217 \r
218 \r
219 //! returns the default font\r
220 IGUIFont* CGUISkin::getFont(EGUI_DEFAULT_FONT which) const\r
221 {\r
222         if (((u32)which < EGDF_COUNT) && Fonts[which])\r
223                 return Fonts[which];\r
224         else\r
225                 return Fonts[EGDF_DEFAULT];\r
226 }\r
227 \r
228 \r
229 //! sets a default font\r
230 void CGUISkin::setFont(IGUIFont* font, EGUI_DEFAULT_FONT which)\r
231 {\r
232         if ((u32)which >= EGDF_COUNT)\r
233                 return;\r
234 \r
235         if (font)\r
236         {\r
237                 font->grab();\r
238                 if (Fonts[which])\r
239                         Fonts[which]->drop();\r
240 \r
241                 Fonts[which] = font;\r
242         }\r
243 }\r
244 \r
245 \r
246 //! gets the sprite bank stored\r
247 IGUISpriteBank* CGUISkin::getSpriteBank() const\r
248 {\r
249         return SpriteBank;\r
250 }\r
251 \r
252 \r
253 //! set a new sprite bank or remove one by passing 0\r
254 void CGUISkin::setSpriteBank(IGUISpriteBank* bank)\r
255 {\r
256         if (bank)\r
257                 bank->grab();\r
258 \r
259         if (SpriteBank)\r
260                 SpriteBank->drop();\r
261 \r
262         SpriteBank = bank;\r
263 }\r
264 \r
265 \r
266 //! Returns a default icon\r
267 u32 CGUISkin::getIcon(EGUI_DEFAULT_ICON icon) const\r
268 {\r
269         if ((u32)icon < EGDI_COUNT)\r
270                 return Icons[icon];\r
271         else\r
272                 return 0;\r
273 }\r
274 \r
275 \r
276 //! Sets a default icon\r
277 void CGUISkin::setIcon(EGUI_DEFAULT_ICON icon, u32 index)\r
278 {\r
279         if ((u32)icon < EGDI_COUNT)\r
280                 Icons[icon] = index;\r
281 }\r
282 \r
283 \r
284 //! Returns a default text. For example for Message box button captions:\r
285 //! "OK", "Cancel", "Yes", "No" and so on.\r
286 const wchar_t* CGUISkin::getDefaultText(EGUI_DEFAULT_TEXT text) const\r
287 {\r
288         if ((u32)text < EGDT_COUNT)\r
289                 return Texts[text].c_str();\r
290         else\r
291                 return Texts[0].c_str();\r
292 }\r
293 \r
294 \r
295 //! Sets a default text. For example for Message box button captions:\r
296 //! "OK", "Cancel", "Yes", "No" and so on.\r
297 void CGUISkin::setDefaultText(EGUI_DEFAULT_TEXT which, const wchar_t* newText)\r
298 {\r
299         if ((u32)which < EGDT_COUNT)\r
300                 Texts[which] = newText;\r
301 }\r
302 \r
303 \r
304 //! draws a standard 3d button pane\r
305 /**     Used for drawing for example buttons in normal state.\r
306 It uses the colors EGDC_3D_DARK_SHADOW, EGDC_3D_HIGH_LIGHT, EGDC_3D_SHADOW and\r
307 EGDC_3D_FACE for this. See EGUI_DEFAULT_COLOR for details.\r
308 \param rect: Defining area where to draw.\r
309 \param clip: Clip area.\r
310 \param element: Pointer to the element which wishes to draw this. This parameter\r
311 is usually not used by ISkin, but can be used for example by more complex\r
312 implementations to find out how to draw the part exactly. */\r
313 void CGUISkin::draw3DButtonPaneStandard(IGUIElement* element,\r
314                                         const core::rect<s32>& r,\r
315                                         const core::rect<s32>* clip)\r
316 {\r
317         if (!Driver)\r
318                 return;\r
319 \r
320         core::rect<s32> rect = r;\r
321 \r
322         if ( Type == EGST_BURNING_SKIN )\r
323         {\r
324                 rect.UpperLeftCorner.X -= 1;\r
325                 rect.UpperLeftCorner.Y -= 1;\r
326                 rect.LowerRightCorner.X += 1;\r
327                 rect.LowerRightCorner.Y += 1;\r
328                 draw3DSunkenPane(element,\r
329                                         getColor( EGDC_WINDOW ).getInterpolated( 0xFFFFFFFF, 0.9f )\r
330                                         ,false, true, rect, clip);\r
331                 return;\r
332         }\r
333 \r
334         Driver->draw2DRectangle(getColor(EGDC_3D_DARK_SHADOW), rect, clip);\r
335 \r
336         rect.LowerRightCorner.X -= 1;\r
337         rect.LowerRightCorner.Y -= 1;\r
338         Driver->draw2DRectangle(getColor(EGDC_3D_HIGH_LIGHT), rect, clip);\r
339 \r
340         rect.UpperLeftCorner.X += 1;\r
341         rect.UpperLeftCorner.Y += 1;\r
342         Driver->draw2DRectangle(getColor(EGDC_3D_SHADOW), rect, clip);\r
343 \r
344         rect.LowerRightCorner.X -= 1;\r
345         rect.LowerRightCorner.Y -= 1;\r
346 \r
347         if (!UseGradient)\r
348         {\r
349                 Driver->draw2DRectangle(getColor(EGDC_3D_FACE), rect, clip);\r
350         }\r
351         else\r
352         {\r
353                 const video::SColor c1 = getColor(EGDC_3D_FACE);\r
354                 const video::SColor c2 = c1.getInterpolated(getColor(EGDC_3D_DARK_SHADOW), 0.4f);\r
355                 Driver->draw2DRectangle(rect, c1, c1, c2, c2, clip);\r
356         }\r
357 }\r
358 \r
359 \r
360 //! draws a pressed 3d button pane\r
361 /**     Used for drawing for example buttons in pressed state.\r
362 It uses the colors EGDC_3D_DARK_SHADOW, EGDC_3D_HIGH_LIGHT, EGDC_3D_SHADOW and\r
363 EGDC_3D_FACE for this. See EGUI_DEFAULT_COLOR for details.\r
364 \param rect: Defining area where to draw.\r
365 \param clip: Clip area.\r
366 \param element: Pointer to the element which wishes to draw this. This parameter\r
367 is usually not used by ISkin, but can be used for example by more complex\r
368 implementations to find out how to draw the part exactly. */\r
369 void CGUISkin::draw3DButtonPanePressed(IGUIElement* element,\r
370                                         const core::rect<s32>& r,\r
371                                         const core::rect<s32>* clip)\r
372 {\r
373         if (!Driver)\r
374                 return;\r
375 \r
376         core::rect<s32> rect = r;\r
377         Driver->draw2DRectangle(getColor(EGDC_3D_HIGH_LIGHT), rect, clip);\r
378 \r
379         rect.LowerRightCorner.X -= 1;\r
380         rect.LowerRightCorner.Y -= 1;\r
381         Driver->draw2DRectangle(getColor(EGDC_3D_DARK_SHADOW), rect, clip);\r
382 \r
383         rect.UpperLeftCorner.X += 1;\r
384         rect.UpperLeftCorner.Y += 1;\r
385         Driver->draw2DRectangle(getColor(EGDC_3D_SHADOW), rect, clip);\r
386 \r
387         rect.UpperLeftCorner.X += 1;\r
388         rect.UpperLeftCorner.Y += 1;\r
389 \r
390         if (!UseGradient)\r
391         {\r
392                 Driver->draw2DRectangle(getColor(EGDC_3D_FACE), rect, clip);\r
393         }\r
394         else\r
395         {\r
396                 const video::SColor c1 = getColor(EGDC_3D_FACE);\r
397                 const video::SColor c2 = c1.getInterpolated(getColor(EGDC_3D_DARK_SHADOW), 0.4f);\r
398                 Driver->draw2DRectangle(rect, c1, c1, c2, c2, clip);\r
399         }\r
400 }\r
401 \r
402 \r
403 //! draws a sunken 3d pane\r
404 /** Used for drawing the background of edit, combo or check boxes.\r
405 \param element: Pointer to the element which wishes to draw this. This parameter\r
406 is usually not used by ISkin, but can be used for example by more complex\r
407 implementations to find out how to draw the part exactly.\r
408 \param bgcolor: Background color.\r
409 \param flat: Specifies if the sunken pane should be flat or displayed as sunken\r
410 deep into the ground.\r
411 \param rect: Defining area where to draw.\r
412 \param clip: Clip area. */\r
413 void CGUISkin::draw3DSunkenPane(IGUIElement* element, video::SColor bgcolor,\r
414                                 bool flat, bool fillBackGround,\r
415                                 const core::rect<s32>& r,\r
416                                 const core::rect<s32>* clip)\r
417 {\r
418         if (!Driver)\r
419                 return;\r
420 \r
421         core::rect<s32> rect = r;\r
422 \r
423         if (fillBackGround)\r
424                 Driver->draw2DRectangle(bgcolor, rect, clip);\r
425 \r
426         if (flat)\r
427         {\r
428                 // draw flat sunken pane\r
429 \r
430                 rect.LowerRightCorner.Y = rect.UpperLeftCorner.Y + 1;\r
431                 Driver->draw2DRectangle(getColor(EGDC_3D_SHADOW), rect, clip);  // top\r
432 \r
433                 ++rect.UpperLeftCorner.Y;\r
434                 rect.LowerRightCorner.Y = r.LowerRightCorner.Y;\r
435                 rect.LowerRightCorner.X = rect.UpperLeftCorner.X + 1;\r
436                 Driver->draw2DRectangle(getColor(EGDC_3D_SHADOW), rect, clip);  // left\r
437 \r
438                 rect = r;\r
439                 ++rect.UpperLeftCorner.Y;\r
440                 rect.UpperLeftCorner.X = rect.LowerRightCorner.X - 1;\r
441                 Driver->draw2DRectangle(getColor(EGDC_3D_HIGH_LIGHT), rect, clip);      // right\r
442 \r
443                 rect = r;\r
444                 ++rect.UpperLeftCorner.X;\r
445                 rect.UpperLeftCorner.Y = r.LowerRightCorner.Y - 1;\r
446                 --rect.LowerRightCorner.X;\r
447                 Driver->draw2DRectangle(getColor(EGDC_3D_HIGH_LIGHT), rect, clip);      // bottom\r
448         }\r
449         else\r
450         {\r
451                 // draw deep sunken pane\r
452                 rect.LowerRightCorner.Y = rect.UpperLeftCorner.Y + 1;\r
453                 Driver->draw2DRectangle(getColor(EGDC_3D_SHADOW), rect, clip);  // top\r
454                 ++rect.UpperLeftCorner.X;\r
455                 ++rect.UpperLeftCorner.Y;\r
456                 --rect.LowerRightCorner.X;\r
457                 ++rect.LowerRightCorner.Y;\r
458                 Driver->draw2DRectangle(getColor(EGDC_3D_DARK_SHADOW), rect, clip);\r
459 \r
460                 rect.UpperLeftCorner.X = r.UpperLeftCorner.X;\r
461                 rect.UpperLeftCorner.Y = r.UpperLeftCorner.Y+1;\r
462                 rect.LowerRightCorner.X = rect.UpperLeftCorner.X + 1;\r
463                 rect.LowerRightCorner.Y = r.LowerRightCorner.Y;\r
464                 Driver->draw2DRectangle(getColor(EGDC_3D_SHADOW), rect, clip);  // left\r
465                 ++rect.UpperLeftCorner.X;\r
466                 ++rect.UpperLeftCorner.Y;\r
467                 ++rect.LowerRightCorner.X;\r
468                 --rect.LowerRightCorner.Y;\r
469                 Driver->draw2DRectangle(getColor(EGDC_3D_DARK_SHADOW), rect, clip);\r
470 \r
471                 rect = r;\r
472                 rect.UpperLeftCorner.X = rect.LowerRightCorner.X - 1;\r
473                 ++rect.UpperLeftCorner.Y;\r
474                 Driver->draw2DRectangle(getColor(EGDC_3D_HIGH_LIGHT), rect, clip);      // right\r
475                 --rect.UpperLeftCorner.X;\r
476                 ++rect.UpperLeftCorner.Y;\r
477                 --rect.LowerRightCorner.X;\r
478                 --rect.LowerRightCorner.Y;\r
479                 Driver->draw2DRectangle(getColor(EGDC_3D_LIGHT), rect, clip);\r
480 \r
481                 rect = r;\r
482                 ++rect.UpperLeftCorner.X;\r
483                 rect.UpperLeftCorner.Y = r.LowerRightCorner.Y - 1;\r
484                 --rect.LowerRightCorner.X;\r
485                 Driver->draw2DRectangle(getColor(EGDC_3D_HIGH_LIGHT), rect, clip);      // bottom\r
486                 ++rect.UpperLeftCorner.X;\r
487                 --rect.UpperLeftCorner.Y;\r
488                 --rect.LowerRightCorner.X;\r
489                 --rect.LowerRightCorner.Y;\r
490                 Driver->draw2DRectangle(getColor(EGDC_3D_LIGHT), rect, clip);\r
491         }\r
492 }\r
493 \r
494 \r
495 //! draws a window background\r
496 // return where to draw title bar text.\r
497 core::rect<s32> CGUISkin::draw3DWindowBackground(IGUIElement* element,\r
498                                 bool drawTitleBar, video::SColor titleBarColor,\r
499                                 const core::rect<s32>& r,\r
500                                 const core::rect<s32>* clip,\r
501                                 core::rect<s32>* checkClientArea)\r
502 {\r
503         if (!Driver)\r
504         {\r
505                 if ( checkClientArea )\r
506                 {\r
507                         *checkClientArea = r;\r
508                 }\r
509                 return r;\r
510         }\r
511 \r
512         core::rect<s32> rect = r;\r
513 \r
514         // top border\r
515         rect.LowerRightCorner.Y = rect.UpperLeftCorner.Y + 1;\r
516         if ( !checkClientArea )\r
517         {\r
518                 Driver->draw2DRectangle(getColor(EGDC_3D_HIGH_LIGHT), rect, clip);\r
519         }\r
520 \r
521         // left border\r
522         rect.LowerRightCorner.Y = r.LowerRightCorner.Y;\r
523         rect.LowerRightCorner.X = rect.UpperLeftCorner.X + 1;\r
524         if ( !checkClientArea )\r
525         {\r
526                 Driver->draw2DRectangle(getColor(EGDC_3D_HIGH_LIGHT), rect, clip);\r
527         }\r
528 \r
529         // right border dark outer line\r
530         rect.UpperLeftCorner.X = r.LowerRightCorner.X - 1;\r
531         rect.LowerRightCorner.X = r.LowerRightCorner.X;\r
532         rect.UpperLeftCorner.Y = r.UpperLeftCorner.Y;\r
533         rect.LowerRightCorner.Y = r.LowerRightCorner.Y;\r
534         if ( !checkClientArea )\r
535         {\r
536                 Driver->draw2DRectangle(getColor(EGDC_3D_DARK_SHADOW), rect, clip);\r
537         }\r
538 \r
539         // right border bright innner line\r
540         rect.UpperLeftCorner.X -= 1;\r
541         rect.LowerRightCorner.X -= 1;\r
542         rect.UpperLeftCorner.Y += 1;\r
543         rect.LowerRightCorner.Y -= 1;\r
544         if ( !checkClientArea )\r
545         {\r
546                 Driver->draw2DRectangle(getColor(EGDC_3D_SHADOW), rect, clip);\r
547         }\r
548 \r
549         // bottom border dark outer line\r
550         rect.UpperLeftCorner.X = r.UpperLeftCorner.X;\r
551         rect.UpperLeftCorner.Y = r.LowerRightCorner.Y - 1;\r
552         rect.LowerRightCorner.Y = r.LowerRightCorner.Y;\r
553         rect.LowerRightCorner.X = r.LowerRightCorner.X;\r
554         if ( !checkClientArea )\r
555         {\r
556                 Driver->draw2DRectangle(getColor(EGDC_3D_DARK_SHADOW), rect, clip);\r
557         }\r
558 \r
559         // bottom border bright inner line\r
560         rect.UpperLeftCorner.X += 1;\r
561         rect.LowerRightCorner.X -= 1;\r
562         rect.UpperLeftCorner.Y -= 1;\r
563         rect.LowerRightCorner.Y -= 1;\r
564         if ( !checkClientArea )\r
565         {\r
566                 Driver->draw2DRectangle(getColor(EGDC_3D_SHADOW), rect, clip);\r
567         }\r
568 \r
569         // client area for background\r
570         rect = r;\r
571         rect.UpperLeftCorner.X +=1;\r
572         rect.UpperLeftCorner.Y +=1;\r
573         rect.LowerRightCorner.X -= 2;\r
574         rect.LowerRightCorner.Y -= 2;\r
575         if (checkClientArea)\r
576         {\r
577                 *checkClientArea = rect;\r
578         }\r
579 \r
580         if ( !checkClientArea )\r
581         {\r
582                 if (!UseGradient)\r
583                 {\r
584                         Driver->draw2DRectangle(getColor(EGDC_3D_FACE), rect, clip);\r
585                 }\r
586                 else if ( Type == EGST_BURNING_SKIN )\r
587                 {\r
588                         const video::SColor c1 = getColor(EGDC_WINDOW).getInterpolated ( 0xFFFFFFFF, 0.9f );\r
589                         const video::SColor c2 = getColor(EGDC_WINDOW).getInterpolated ( 0xFFFFFFFF, 0.8f );\r
590 \r
591                         Driver->draw2DRectangle(rect, c1, c1, c2, c2, clip);\r
592                 }\r
593                 else\r
594                 {\r
595                         const video::SColor c2 = getColor(EGDC_3D_SHADOW);\r
596                         const video::SColor c1 = getColor(EGDC_3D_FACE);\r
597                         Driver->draw2DRectangle(rect, c1, c1, c1, c2, clip);\r
598                 }\r
599         }\r
600 \r
601         // title bar\r
602         rect = r;\r
603         rect.UpperLeftCorner.X += 2;\r
604         rect.UpperLeftCorner.Y += 2;\r
605         rect.LowerRightCorner.X -= 2;\r
606         rect.LowerRightCorner.Y = rect.UpperLeftCorner.Y + getSize(EGDS_WINDOW_BUTTON_WIDTH) + 2;\r
607 \r
608         if (drawTitleBar )\r
609         {\r
610                 if (checkClientArea)\r
611                 {\r
612                         (*checkClientArea).UpperLeftCorner.Y = rect.LowerRightCorner.Y;\r
613                 }\r
614                 else\r
615                 {\r
616                         // draw title bar\r
617                         //if (!UseGradient)\r
618                         //      Driver->draw2DRectangle(titleBarColor, rect, clip);\r
619                         //else\r
620                         if ( Type == EGST_BURNING_SKIN )\r
621                         {\r
622                                 const video::SColor c = titleBarColor.getInterpolated( video::SColor(titleBarColor.getAlpha(),255,255,255), 0.8f);\r
623                                 Driver->draw2DRectangle(rect, titleBarColor, titleBarColor, c, c, clip);\r
624                         }\r
625                         else\r
626                         {\r
627                                 const video::SColor c = titleBarColor.getInterpolated(video::SColor(titleBarColor.getAlpha(),0,0,0), 0.2f);\r
628                                 Driver->draw2DRectangle(rect, titleBarColor, c, titleBarColor, c, clip);\r
629                         }\r
630                 }\r
631         }\r
632 \r
633         return rect;\r
634 }\r
635 \r
636 \r
637 //! draws a standard 3d menu pane\r
638 /**     Used for drawing for menus and context menus.\r
639 It uses the colors EGDC_3D_DARK_SHADOW, EGDC_3D_HIGH_LIGHT, EGDC_3D_SHADOW and\r
640 EGDC_3D_FACE for this. See EGUI_DEFAULT_COLOR for details.\r
641 \param element: Pointer to the element which wishes to draw this. This parameter\r
642 is usually not used by ISkin, but can be used for example by more complex\r
643 implementations to find out how to draw the part exactly.\r
644 \param rect: Defining area where to draw.\r
645 \param clip: Clip area. */\r
646 void CGUISkin::draw3DMenuPane(IGUIElement* element,\r
647                         const core::rect<s32>& r, const core::rect<s32>* clip)\r
648 {\r
649         if (!Driver)\r
650                 return;\r
651 \r
652         core::rect<s32> rect = r;\r
653 \r
654         if ( Type == EGST_BURNING_SKIN )\r
655         {\r
656                 rect.UpperLeftCorner.Y -= 3;\r
657                 draw3DButtonPaneStandard(element, rect, clip);\r
658                 return;\r
659         }\r
660 \r
661         // in this skin, this is exactly what non pressed buttons look like,\r
662         // so we could simply call\r
663         // draw3DButtonPaneStandard(element, rect, clip);\r
664         // here.\r
665         // but if the skin is transparent, this doesn't look that nice. So\r
666         // We draw it a little bit better, with some more draw2DRectangle calls,\r
667         // but there aren't that much menus visible anyway.\r
668 \r
669         rect.LowerRightCorner.Y = rect.UpperLeftCorner.Y + 1;\r
670         Driver->draw2DRectangle(getColor(EGDC_3D_HIGH_LIGHT), rect, clip);\r
671 \r
672         rect.LowerRightCorner.Y = r.LowerRightCorner.Y;\r
673         rect.LowerRightCorner.X = rect.UpperLeftCorner.X + 1;\r
674         Driver->draw2DRectangle(getColor(EGDC_3D_HIGH_LIGHT), rect, clip);\r
675 \r
676         rect.UpperLeftCorner.X = r.LowerRightCorner.X - 1;\r
677         rect.LowerRightCorner.X = r.LowerRightCorner.X;\r
678         rect.UpperLeftCorner.Y = r.UpperLeftCorner.Y;\r
679         rect.LowerRightCorner.Y = r.LowerRightCorner.Y;\r
680         Driver->draw2DRectangle(getColor(EGDC_3D_DARK_SHADOW), rect, clip);\r
681 \r
682         rect.UpperLeftCorner.X -= 1;\r
683         rect.LowerRightCorner.X -= 1;\r
684         rect.UpperLeftCorner.Y += 1;\r
685         rect.LowerRightCorner.Y -= 1;\r
686         Driver->draw2DRectangle(getColor(EGDC_3D_SHADOW), rect, clip);\r
687 \r
688         rect.UpperLeftCorner.X = r.UpperLeftCorner.X;\r
689         rect.UpperLeftCorner.Y = r.LowerRightCorner.Y - 1;\r
690         rect.LowerRightCorner.Y = r.LowerRightCorner.Y;\r
691         rect.LowerRightCorner.X = r.LowerRightCorner.X;\r
692         Driver->draw2DRectangle(getColor(EGDC_3D_DARK_SHADOW), rect, clip);\r
693 \r
694         rect.UpperLeftCorner.X += 1;\r
695         rect.LowerRightCorner.X -= 1;\r
696         rect.UpperLeftCorner.Y -= 1;\r
697         rect.LowerRightCorner.Y -= 1;\r
698         Driver->draw2DRectangle(getColor(EGDC_3D_SHADOW), rect, clip);\r
699 \r
700         rect = r;\r
701         rect.UpperLeftCorner.X +=1;\r
702         rect.UpperLeftCorner.Y +=1;\r
703         rect.LowerRightCorner.X -= 2;\r
704         rect.LowerRightCorner.Y -= 2;\r
705 \r
706         if (!UseGradient)\r
707                 Driver->draw2DRectangle(getColor(EGDC_3D_FACE), rect, clip);\r
708         else\r
709         {\r
710                 const video::SColor c1 = getColor(EGDC_3D_FACE);\r
711                 const video::SColor c2 = getColor(EGDC_3D_SHADOW);\r
712                 Driver->draw2DRectangle(rect, c1, c1, c2, c2, clip);\r
713         }\r
714 }\r
715 \r
716 \r
717 //! draws a standard 3d tool bar\r
718 /**     Used for drawing for toolbars and menus.\r
719 \param element: Pointer to the element which wishes to draw this. This parameter\r
720 is usually not used by ISkin, but can be used for example by more complex\r
721 implementations to find out how to draw the part exactly.\r
722 \param rect: Defining area where to draw.\r
723 \param clip: Clip area. */\r
724 void CGUISkin::draw3DToolBar(IGUIElement* element,\r
725                                 const core::rect<s32>& r,\r
726                                 const core::rect<s32>* clip)\r
727 {\r
728         if (!Driver)\r
729                 return;\r
730 \r
731         core::rect<s32> rect = r;\r
732 \r
733         rect.UpperLeftCorner.X = r.UpperLeftCorner.X;\r
734         rect.UpperLeftCorner.Y = r.LowerRightCorner.Y - 1;\r
735         rect.LowerRightCorner.Y = r.LowerRightCorner.Y;\r
736         rect.LowerRightCorner.X = r.LowerRightCorner.X;\r
737         Driver->draw2DRectangle(getColor(EGDC_3D_SHADOW), rect, clip);\r
738 \r
739         rect = r;\r
740         rect.LowerRightCorner.Y -= 1;\r
741 \r
742         if (!UseGradient)\r
743         {\r
744                 Driver->draw2DRectangle(getColor(EGDC_3D_FACE), rect, clip);\r
745         }\r
746         else\r
747         if ( Type == EGST_BURNING_SKIN )\r
748         {\r
749                 const video::SColor c1 = 0xF0000000 | getColor(EGDC_3D_FACE).color;\r
750                 const video::SColor c2 = 0xF0000000 | getColor(EGDC_3D_SHADOW).color;\r
751 \r
752                 rect.LowerRightCorner.Y += 1;\r
753                 Driver->draw2DRectangle(rect, c1, c2, c1, c2, clip);\r
754         }\r
755         else\r
756         {\r
757                 const video::SColor c1 = getColor(EGDC_3D_FACE);\r
758                 const video::SColor c2 = getColor(EGDC_3D_SHADOW);\r
759                 Driver->draw2DRectangle(rect, c1, c1, c2, c2, clip);\r
760         }\r
761 }\r
762 \r
763 \r
764 //! draws a tab button\r
765 /**     Used for drawing for tab buttons on top of tabs.\r
766 \param element: Pointer to the element which wishes to draw this. This parameter\r
767 is usually not used by ISkin, but can be used for example by more complex\r
768 implementations to find out how to draw the part exactly.\r
769 \param active: Specifies if the tab is currently active.\r
770 \param rect: Defining area where to draw.\r
771 \param clip: Clip area. */\r
772 void CGUISkin::draw3DTabButton(IGUIElement* element, bool active,\r
773         const core::rect<s32>& frameRect, const core::rect<s32>* clip, EGUI_ALIGNMENT alignment)\r
774 {\r
775         if (!Driver)\r
776                 return;\r
777 \r
778         core::rect<s32> tr = frameRect;\r
779 \r
780         if ( alignment == EGUIA_UPPERLEFT )\r
781         {\r
782                 tr.LowerRightCorner.X -= 2;\r
783                 tr.LowerRightCorner.Y = tr.UpperLeftCorner.Y + 1;\r
784                 tr.UpperLeftCorner.X += 1;\r
785                 Driver->draw2DRectangle(getColor(EGDC_3D_HIGH_LIGHT), tr, clip);\r
786 \r
787                 // draw left highlight\r
788                 tr = frameRect;\r
789                 tr.LowerRightCorner.X = tr.UpperLeftCorner.X + 1;\r
790                 tr.UpperLeftCorner.Y += 1;\r
791                 Driver->draw2DRectangle(getColor(EGDC_3D_HIGH_LIGHT), tr, clip);\r
792 \r
793                 // draw grey background\r
794                 tr = frameRect;\r
795                 tr.UpperLeftCorner.X += 1;\r
796                 tr.UpperLeftCorner.Y += 1;\r
797                 tr.LowerRightCorner.X -= 2;\r
798                 Driver->draw2DRectangle(getColor(EGDC_3D_FACE), tr, clip);\r
799 \r
800                 // draw right middle gray shadow\r
801                 tr.LowerRightCorner.X += 1;\r
802                 tr.UpperLeftCorner.X = tr.LowerRightCorner.X - 1;\r
803                 Driver->draw2DRectangle(getColor(EGDC_3D_SHADOW), tr, clip);\r
804 \r
805                 tr.LowerRightCorner.X += 1;\r
806                 tr.UpperLeftCorner.X += 1;\r
807                 tr.UpperLeftCorner.Y += 1;\r
808                 Driver->draw2DRectangle(getColor(EGDC_3D_DARK_SHADOW), tr, clip);\r
809         }\r
810         else\r
811         {\r
812                 tr.LowerRightCorner.X -= 2;\r
813                 tr.UpperLeftCorner.Y = tr.LowerRightCorner.Y - 1;\r
814                 tr.UpperLeftCorner.X += 1;\r
815                 Driver->draw2DRectangle(getColor(EGDC_3D_HIGH_LIGHT), tr, clip);\r
816 \r
817                 // draw left highlight\r
818                 tr = frameRect;\r
819                 tr.LowerRightCorner.X = tr.UpperLeftCorner.X + 1;\r
820                 tr.LowerRightCorner.Y -= 1;\r
821                 Driver->draw2DRectangle(getColor(EGDC_3D_HIGH_LIGHT), tr, clip);\r
822 \r
823                 // draw grey background\r
824                 tr = frameRect;\r
825                 tr.UpperLeftCorner.X += 1;\r
826                 tr.UpperLeftCorner.Y -= 1;\r
827                 tr.LowerRightCorner.X -= 2;\r
828                 tr.LowerRightCorner.Y -= 1;\r
829                 Driver->draw2DRectangle(getColor(EGDC_3D_FACE), tr, clip);\r
830 \r
831                 // draw right middle gray shadow\r
832                 tr.LowerRightCorner.X += 1;\r
833                 tr.UpperLeftCorner.X = tr.LowerRightCorner.X - 1;\r
834                 //tr.LowerRightCorner.Y -= 1;\r
835                 Driver->draw2DRectangle(getColor(EGDC_3D_SHADOW), tr, clip);\r
836 \r
837                 tr.LowerRightCorner.X += 1;\r
838                 tr.UpperLeftCorner.X += 1;\r
839                 tr.LowerRightCorner.Y -= 1;\r
840                 Driver->draw2DRectangle(getColor(EGDC_3D_DARK_SHADOW), tr, clip);\r
841         }\r
842 }\r
843 \r
844 \r
845 //! draws a tab control body\r
846 /**     \param element: Pointer to the element which wishes to draw this. This parameter\r
847 is usually not used by ISkin, but can be used for example by more complex\r
848 implementations to find out how to draw the part exactly.\r
849 \param border: Specifies if the border should be drawn.\r
850 \param background: Specifies if the background should be drawn.\r
851 \param rect: Defining area where to draw.\r
852 \param clip: Clip area. */\r
853 void CGUISkin::draw3DTabBody(IGUIElement* element, bool border, bool background,\r
854         const core::rect<s32>& rect, const core::rect<s32>* clip, s32 tabHeight, EGUI_ALIGNMENT alignment)\r
855 {\r
856         if (!Driver)\r
857                 return;\r
858 \r
859         core::rect<s32> tr = rect;\r
860 \r
861         if ( tabHeight == -1 )\r
862                 tabHeight = getSize(gui::EGDS_BUTTON_HEIGHT);\r
863 \r
864         // draw border.\r
865         if (border)\r
866         {\r
867                 if ( alignment == EGUIA_UPPERLEFT )\r
868                 {\r
869                         // draw left hightlight\r
870                         tr.UpperLeftCorner.Y += tabHeight + 2;\r
871                         tr.LowerRightCorner.X = tr.UpperLeftCorner.X + 1;\r
872                         Driver->draw2DRectangle(getColor(EGDC_3D_HIGH_LIGHT), tr, clip);\r
873 \r
874                         // draw right shadow\r
875                         tr.UpperLeftCorner.X = rect.LowerRightCorner.X - 1;\r
876                         tr.LowerRightCorner.X = tr.UpperLeftCorner.X + 1;\r
877                         Driver->draw2DRectangle(getColor(EGDC_3D_SHADOW), tr, clip);\r
878 \r
879                         // draw lower shadow\r
880                         tr = rect;\r
881                         tr.UpperLeftCorner.Y = tr.LowerRightCorner.Y - 1;\r
882                         Driver->draw2DRectangle(getColor(EGDC_3D_SHADOW), tr, clip);\r
883                 }\r
884                 else\r
885                 {\r
886                         // draw left hightlight\r
887                         tr.LowerRightCorner.Y -= tabHeight + 2;\r
888                         tr.LowerRightCorner.X = tr.UpperLeftCorner.X + 1;\r
889                         Driver->draw2DRectangle(getColor(EGDC_3D_HIGH_LIGHT), tr, clip);\r
890 \r
891                         // draw right shadow\r
892                         tr.UpperLeftCorner.X = rect.LowerRightCorner.X - 1;\r
893                         tr.LowerRightCorner.X = tr.UpperLeftCorner.X + 1;\r
894                         Driver->draw2DRectangle(getColor(EGDC_3D_SHADOW), tr, clip);\r
895 \r
896                         // draw lower shadow\r
897                         tr = rect;\r
898                         tr.LowerRightCorner.Y = tr.UpperLeftCorner.Y + 1;\r
899                         Driver->draw2DRectangle(getColor(EGDC_3D_HIGH_LIGHT), tr, clip);\r
900                 }\r
901         }\r
902 \r
903         if (background)\r
904         {\r
905                 if ( alignment == EGUIA_UPPERLEFT )\r
906                 {\r
907                         tr = rect;\r
908                         tr.UpperLeftCorner.Y += tabHeight + 2;\r
909                         tr.LowerRightCorner.X -= 1;\r
910                         tr.UpperLeftCorner.X += 1;\r
911                         tr.LowerRightCorner.Y -= 1;\r
912                 }\r
913                 else\r
914                 {\r
915                         tr = rect;\r
916                         tr.UpperLeftCorner.X += 1;\r
917                         tr.UpperLeftCorner.Y -= 1;\r
918                         tr.LowerRightCorner.X -= 1;\r
919                         tr.LowerRightCorner.Y -= tabHeight + 2;\r
920                         //tr.UpperLeftCorner.X += 1;\r
921                 }\r
922 \r
923                 if (!UseGradient)\r
924                         Driver->draw2DRectangle(getColor(EGDC_3D_FACE), tr, clip);\r
925                 else\r
926                 {\r
927                         video::SColor c1 = getColor(EGDC_3D_FACE);\r
928                         video::SColor c2 = getColor(EGDC_3D_SHADOW);\r
929                         Driver->draw2DRectangle(tr, c1, c1, c2, c2, clip);\r
930                 }\r
931         }\r
932 }\r
933 \r
934 \r
935 //! draws an icon, usually from the skin's sprite bank\r
936 /**     \param parent: Pointer to the element which wishes to draw this icon.\r
937 This parameter is usually not used by IGUISkin, but can be used for example\r
938 by more complex implementations to find out how to draw the part exactly.\r
939 \param icon: Specifies the icon to be drawn.\r
940 \param position: The position to draw the icon\r
941 \param starttime: The time at the start of the animation\r
942 \param currenttime: The present time, used to calculate the frame number\r
943 \param loop: Whether the animation should loop or not\r
944 \param clip: Clip area. */\r
945 void CGUISkin::drawIcon(IGUIElement* element, EGUI_DEFAULT_ICON icon,\r
946                         const core::position2di position,\r
947                         u32 starttime, u32 currenttime,\r
948                         bool loop, const core::rect<s32>* clip)\r
949 {\r
950         if (!SpriteBank)\r
951                 return;\r
952 \r
953         bool gray = element && !element->isEnabled();\r
954         SpriteBank->draw2DSprite(Icons[icon], position, clip,\r
955                         Colors[gray? EGDC_GRAY_WINDOW_SYMBOL : EGDC_WINDOW_SYMBOL], starttime, currenttime, loop, true);\r
956 }\r
957 \r
958 \r
959 EGUI_SKIN_TYPE CGUISkin::getType() const\r
960 {\r
961         return Type;\r
962 }\r
963 \r
964 \r
965 //! draws a 2d rectangle.\r
966 void CGUISkin::draw2DRectangle(IGUIElement* element,\r
967                 const video::SColor &color, const core::rect<s32>& pos,\r
968                 const core::rect<s32>* clip)\r
969 {\r
970         Driver->draw2DRectangle(color, pos, clip);\r
971 }\r
972 \r
973 } // end namespace gui\r
974 } // end namespace irr\r