]> git.localhorst.tv Git - l2e.git/blobdiff - src/map/Tile.cpp
implemented map tile anmation
[l2e.git] / src / map / Tile.cpp
index 303c9e556eba5fcf1836eca8b7aa1ac4b05a4fb2..2b7e0f23bb2a56117b63166fe572605581dca548 100644 (file)
@@ -1,18 +1,38 @@
-/*
- * Tile.cpp
- *
- *  Created on: Sep 29, 2012
- *      Author: holy
- */
-
 #include "Tile.h"
 
+#include "../loader/Interpreter.h"
+#include "../loader/TypeDescription.h"
+
+using loader::FieldDescription;
+using loader::Interpreter;
+using loader::TypeDescription;
+
 namespace map {
 
 Tile::Tile()
 : battlebg(0)
-, flags(0) {
+, flags(0)
+, frames(1) {
+
+}
+
+
+void Tile::CreateTypeDescription() {
+       Tile t;
+
+       TypeDescription &td(TypeDescription::Create(TYPE_ID, "Tile"));
+       td.SetConstructor(&Construct);
+       td.SetSize(sizeof(Tile));
+
+       td.AddField("battlebg", FieldDescription(((char *)&t.battlebg) - ((char *)&t), Interpreter::IMAGE_ID).SetReferenced());
+       td.AddField("t", FieldDescription(((char *)&t.offset) - ((char *)&t), Interpreter::VECTOR_ID));
+       td.AddField("flags", FieldDescription(((char *)&t.flags) - ((char *)&t), Interpreter::NUMBER_ID));
+       td.AddField("frames", FieldDescription(((char *)&t.frames) - ((char *)&t), Interpreter::NUMBER_ID));
+
+}
 
+void Tile::Construct(void *data) {
+       new (data) Tile;
 }
 
 }