X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fmap%2FTile.cpp;h=2b7e0f23bb2a56117b63166fe572605581dca548;hb=04e4e8797a63c0a89aae9882982cd864213d05ab;hp=7b77fb1feccdb93a6f260c0adad725a7acf9b2f7;hpb=59c4aea0762cbc5f1bf74c5b1b35629408fb92af;p=l2e.git diff --git a/src/map/Tile.cpp b/src/map/Tile.cpp index 7b77fb1..2b7e0f2 100644 --- a/src/map/Tile.cpp +++ b/src/map/Tile.cpp @@ -1,17 +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() -: flags(0) { +: battlebg(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; } }