]> git.localhorst.tv Git - l2e.git/commitdiff
added type description of MenuProperties
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Sun, 9 Sep 2012 12:14:13 +0000 (14:14 +0200)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Sun, 9 Sep 2012 12:14:13 +0000 (14:14 +0200)
src/graphics/Menu.cpp [new file with mode: 0644]
src/graphics/Menu.h

diff --git a/src/graphics/Menu.cpp b/src/graphics/Menu.cpp
new file mode 100644 (file)
index 0000000..b70697e
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * Menu.cpp
+ *
+ *  Created on: Sep 9, 2012
+ *      Author: holy
+ */
+
+#include "Menu.h"
+
+#include "../loader/TypeDescription.h"
+
+using loader::FieldDescription;
+using loader::TypeDescription;
+
+namespace graphics {
+
+void MenuProperties::CreateTypeDescription() {
+       MenuProperties p;
+       TypeDescription &td(TypeDescription::CreateOrGet("MenuProperties"));
+
+       td.SetSize(sizeof(MenuProperties));
+
+       int fontId(TypeDescription::GetTypeId("Font"));
+       int numberId(TypeDescription::GetTypeId("Number"));
+       int spriteId(TypeDescription::GetTypeId("Sprite"));
+       int stringId(TypeDescription::GetTypeId("String"));
+
+       td.AddField("font", FieldDescription(((char *)&p.font) - ((char *)&p), fontId, true));
+       td.AddField("disabledFont", FieldDescription(((char *)&p.disabledFont) - ((char *)&p), fontId, true));
+       td.AddField("cursor", FieldDescription(((char *)&p.cursor) - ((char *)&p), spriteId, true));
+       td.AddField("charsPerEntry", FieldDescription(((char *)&p.charsPerEntry) - ((char *)&p), numberId, false));
+       td.AddField("rows", FieldDescription(((char *)&p.rows) - ((char *)&p), numberId, false));
+       td.AddField("rowGap", FieldDescription(((char *)&p.rowGap) - ((char *)&p), numberId, false));
+       td.AddField("iconSpace", FieldDescription(((char *)&p.iconSpace) - ((char *)&p), numberId, false));
+       td.AddField("cols", FieldDescription(((char *)&p.cols) - ((char *)&p), numberId, false));
+       td.AddField("colGap", FieldDescription(((char *)&p.colGap) - ((char *)&p), numberId, false));
+       td.AddField("delimiter", FieldDescription(((char *)&p.delimiter) - ((char *)&p), stringId, false));
+       td.AddField("charsPerNumber", FieldDescription(((char *)&p.charsPerNumber) - ((char *)&p), numberId, false));
+       td.AddField("charsPerAdditionalText", FieldDescription(((char *)&p.charsPerAdditionalText) - ((char *)&p), numberId, false));
+       td.AddField("additionalTextGap", FieldDescription(((char *)&p.additionalTextGap) - ((char *)&p), numberId, false));
+}
+
+}
index 175a7114501afcd4ad1e75bfb61115c8b790f28c..7aa2e9448794754d57024e36e16252bbba6f0389 100644 (file)
@@ -43,6 +43,8 @@ struct MenuProperties {
 
        MenuProperties(const Font *font, const Font *disabledFont, const Sprite *cursor, int charsPerEntry, int rows, int rowGap, int iconSpace, int cols, int colGap, int charsPerNumber, char delimiter, int charsPerAdditionalText, int additionalTextGap)
        : font(font), disabledFont(disabledFont), cursor(cursor), charsPerEntry(charsPerEntry), rows(rows), rowGap(rowGap), iconSpace(iconSpace), cols(cols), colGap(colGap), charsPerNumber(charsPerNumber), charsPerAdditionalText(charsPerAdditionalText), additionalTextGap(additionalTextGap), delimiter(delimiter) { }
+
+       static void CreateTypeDescription();
 };
 
 template<class T>