4 * Created on: Sep 4, 2012
10 #include "../loader/TypeDescription.h"
12 using loader::FieldDescription;
13 using loader::TypeDescription;
17 Resources::Resources()
21 , attackChoiceIcons(0)
27 , activeHeroTagFrame(0)
28 , smallHeroTagFrame(0)
29 , lastSmallHeroTagFrame(0)
44 , weaponTargetCursor(0)
45 , magicTargetCursor(0)
48 , spellMenuHeadline("")
49 , spellMenuProperties(0)
51 , itemMenuHeadline("")
52 , itemMenuProperties(0)
53 , ikariMenuHeadline("")
54 , ikariMenuProperties(0)
59 , numberAnimationPrototype(0)
61 , greenNumberSprite(0)
84 void Resources::CreateTypeDescription() {
87 int animationId(TypeDescription::GetTypeId("Animation"));
88 int colorId(TypeDescription::GetTypeId("Color"));
89 int fontId(TypeDescription::GetTypeId("Font"));
90 int frameId(TypeDescription::GetTypeId("Frame"));
91 int gaugeId(TypeDescription::GetTypeId("Gauge"));
92 int menuPropertiesId(TypeDescription::GetTypeId("MenuProperties"));
93 int numberId(TypeDescription::GetTypeId("Number"));
94 int spriteId(TypeDescription::GetTypeId("Sprite"));
95 int stringId(TypeDescription::GetTypeId("String"));
97 TypeDescription &td(TypeDescription::CreateOrGet("BattleResources"));
98 td.SetConstructor(&Construct);
99 td.SetSize(sizeof(Resources));
101 td.AddField("swapCursor", FieldDescription(((char *)&r.swapCursor) - ((char *)&r), spriteId, true));
102 td.AddField("moveIcons", FieldDescription(((char *)&r.moveIcons) - ((char *)&r), spriteId, true));
103 td.AddField("attackIcons", FieldDescription(((char *)&r.attackIcons) - ((char *)&r), spriteId, true));
104 td.AddField("attackChoiceIcons", FieldDescription(((char *)&r.attackChoiceIcons) - ((char *)&r), spriteId, true));
106 td.AddField("titleFrame", FieldDescription(((char *)&r.titleFrame) - ((char *)&r), frameId, true));
107 td.AddField("titleFont", FieldDescription(((char *)&r.titleFont) - ((char *)&r), fontId, true));
109 td.AddField("heroTagFrame", FieldDescription(((char *)&r.heroTagFrame) - ((char *)&r), frameId, true));
110 td.AddField("activeHeroTagFrame", FieldDescription(((char *)&r.activeHeroTagFrame) - ((char *)&r), frameId, true));
111 td.AddField("smallHeroTagFrame", FieldDescription(((char *)&r.smallHeroTagFrame) - ((char *)&r), frameId, true));
112 td.AddField("lastSmallHeroTagFrame", FieldDescription(((char *)&r.lastSmallHeroTagFrame) - ((char *)&r), frameId, true));
114 td.AddField("heroTagFont", FieldDescription(((char *)&r.heroTagFont) - ((char *)&r), fontId, true));
115 td.AddField("heroTagLabels", FieldDescription(((char *)&r.heroTagLabels) - ((char *)&r), spriteId, true));
117 td.AddField("healthGauge", FieldDescription(((char *)&r.healthGauge) - ((char *)&r), gaugeId, true));
118 td.AddField("manaGauge", FieldDescription(((char *)&r.manaGauge) - ((char *)&r), gaugeId, true));
119 td.AddField("ikariGauge", FieldDescription(((char *)&r.ikariGauge) - ((char *)&r), gaugeId, true));
121 td.AddField("selectFrame", FieldDescription(((char *)&r.selectFrame) - ((char *)&r), frameId, true));
123 td.AddField("normalFont", FieldDescription(((char *)&r.normalFont) - ((char *)&r), fontId, true));
124 td.AddField("disabledFont", FieldDescription(((char *)&r.disabledFont) - ((char *)&r), fontId, true));
126 td.AddField("menuCursor", FieldDescription(((char *)&r.menuCursor) - ((char *)&r), spriteId, true));
127 td.AddField("weaponTargetCursor", FieldDescription(((char *)&r.weaponTargetCursor) - ((char *)&r), spriteId, true));
128 td.AddField("magicTargetCursor", FieldDescription(((char *)&r.magicTargetCursor) - ((char *)&r), spriteId, true));
129 td.AddField("itemTargetCursor", FieldDescription(((char *)&r.itemTargetCursor) - ((char *)&r), spriteId, true));
131 td.AddField("spellMenuHeadline", FieldDescription(((char *)&r.spellMenuHeadline) - ((char *)&r), stringId, true));
132 td.AddField("spellMenuProperties", FieldDescription(((char *)&r.spellMenuProperties) - ((char *)&r), menuPropertiesId, true));
134 td.AddField("itemMenuHeadline", FieldDescription(((char *)&r.itemMenuHeadline) - ((char *)&r), stringId, true));
135 td.AddField("itemMenuProperties", FieldDescription(((char *)&r.itemMenuProperties) - ((char *)&r), menuPropertiesId, true));
137 td.AddField("ikariMenuHeadline", FieldDescription(((char *)&r.ikariMenuHeadline) - ((char *)&r), stringId, true));
138 td.AddField("ikariMenuProperties", FieldDescription(((char *)&r.ikariMenuProperties) - ((char *)&r), menuPropertiesId, true));
139 td.AddField("noEquipmentText", FieldDescription(((char *)&r.noEquipmentText) - ((char *)&r), stringId, true));
141 td.AddField("escapeText", FieldDescription(((char *)&r.escapeText) - ((char *)&r), stringId, true));
143 td.AddField("numberAnimationPrototype", FieldDescription(((char *)&r.numberAnimationPrototype) - ((char *)&r), animationId, true));
145 td.AddField("bigNumberSprite", FieldDescription(((char *)&r.bigNumberSprite) - ((char *)&r), spriteId, true));
146 td.AddField("greenNumberSprite", FieldDescription(((char *)&r.greenNumberSprite) - ((char *)&r), spriteId, true));
148 td.AddField("weaponMenuIcon", FieldDescription(((char *)&r.weaponMenuIcon) - ((char *)&r), spriteId, true));
149 td.AddField("armorMenuIcon", FieldDescription(((char *)&r.armorMenuIcon) - ((char *)&r), spriteId, true));
150 td.AddField("shieldMenuIcon", FieldDescription(((char *)&r.shieldMenuIcon) - ((char *)&r), spriteId, true));
151 td.AddField("helmetMenuIcon", FieldDescription(((char *)&r.helmetMenuIcon) - ((char *)&r), spriteId, true));
152 td.AddField("ringMenuIcon", FieldDescription(((char *)&r.ringMenuIcon) - ((char *)&r), spriteId, true));
153 td.AddField("jewelMenuIcon", FieldDescription(((char *)&r.jewelMenuIcon) - ((char *)&r), spriteId, true));
155 td.AddField("levelLabelRow", FieldDescription(((char *)&r.levelLabelRow) - ((char *)&r), numberId, false));
156 td.AddField("levelLabelCol", FieldDescription(((char *)&r.levelLabelCol) - ((char *)&r), numberId, false));
157 td.AddField("healthLabelRow", FieldDescription(((char *)&r.healthLabelRow) - ((char *)&r), numberId, false));
158 td.AddField("healthLabelCol", FieldDescription(((char *)&r.healthLabelCol) - ((char *)&r), numberId, false));
159 td.AddField("manaLabelRow", FieldDescription(((char *)&r.manaLabelRow) - ((char *)&r), numberId, false));
160 td.AddField("manaLabelCol", FieldDescription(((char *)&r.manaLabelCol) - ((char *)&r), numberId, false));
161 td.AddField("moveLabelRow", FieldDescription(((char *)&r.moveLabelRow) - ((char *)&r), numberId, false));
162 td.AddField("moveLabelCol", FieldDescription(((char *)&r.moveLabelCol) - ((char *)&r), numberId, false));
163 td.AddField("ikariLabelRow", FieldDescription(((char *)&r.ikariLabelRow) - ((char *)&r), numberId, false));
164 td.AddField("ikariLabelCol", FieldDescription(((char *)&r.ikariLabelCol) - ((char *)&r), numberId, false));
166 td.AddField("heroesBgColor", FieldDescription(((char *)&r.heroesBgColor) - ((char *)&r), colorId, false));
169 void Resources::Construct(void *data) {
170 new (data) Resources;