]> git.localhorst.tv Git - l2e.git/blob - src/graphics/Menu.cpp
92fc898296957dfcf932d3afe45970ae170ff0e3
[l2e.git] / src / graphics / Menu.cpp
1 /*
2  * Menu.cpp
3  *
4  *  Created on: Sep 9, 2012
5  *      Author: holy
6  */
7
8 #include "Menu.h"
9
10 #include "../loader/TypeDescription.h"
11
12 using loader::FieldDescription;
13 using loader::TypeDescription;
14
15 namespace graphics {
16
17 void MenuProperties::CreateTypeDescription() {
18         MenuProperties p;
19
20         int fontId(TypeDescription::GetTypeId("Font"));
21         int numberId(TypeDescription::GetTypeId("Number"));
22         int spriteId(TypeDescription::GetTypeId("Sprite"));
23         int stringId(TypeDescription::GetTypeId("String"));
24
25         TypeDescription &td(TypeDescription::CreateOrGet("MenuProperties"));
26         td.SetConstructor(&Construct);
27         td.SetSize(sizeof(MenuProperties));
28
29         td.AddField("font", FieldDescription(((char *)&p.font) - ((char *)&p), fontId, true));
30         td.AddField("disabledFont", FieldDescription(((char *)&p.disabledFont) - ((char *)&p), fontId, true));
31         td.AddField("cursor", FieldDescription(((char *)&p.cursor) - ((char *)&p), spriteId, true));
32         td.AddField("charsPerEntry", FieldDescription(((char *)&p.charsPerEntry) - ((char *)&p), numberId, false));
33         td.AddField("rows", FieldDescription(((char *)&p.rows) - ((char *)&p), numberId, false));
34         td.AddField("rowGap", FieldDescription(((char *)&p.rowGap) - ((char *)&p), numberId, false));
35         td.AddField("iconSpace", FieldDescription(((char *)&p.iconSpace) - ((char *)&p), numberId, false));
36         td.AddField("cols", FieldDescription(((char *)&p.cols) - ((char *)&p), numberId, false));
37         td.AddField("colGap", FieldDescription(((char *)&p.colGap) - ((char *)&p), numberId, false));
38         td.AddField("delimiter", FieldDescription(((char *)&p.delimiter) - ((char *)&p), stringId, false));
39         td.AddField("charsPerNumber", FieldDescription(((char *)&p.charsPerNumber) - ((char *)&p), numberId, false));
40         td.AddField("charsPerAdditionalText", FieldDescription(((char *)&p.charsPerAdditionalText) - ((char *)&p), numberId, false));
41         td.AddField("additionalTextGap", FieldDescription(((char *)&p.additionalTextGap) - ((char *)&p), numberId, false));
42 }
43
44 void MenuProperties::Construct(void *data) {
45         new (data) MenuProperties;
46 }
47
48 }