X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fmap%2FArea.cpp;h=b6d02f6204f7ba0477b4c7c9df636fc2a3bad936;hb=350055a7ff27c74882aff8a4d6af2014782f830b;hp=985dea2d5462f4aae5ecba7663d6c79651f635d3;hpb=0ad5ca97b5df217329bc319d62564a9f46ba11d7;p=l2e.git diff --git a/src/map/Area.cpp b/src/map/Area.cpp index 985dea2..b6d02f6 100644 --- a/src/map/Area.cpp +++ b/src/map/Area.cpp @@ -9,11 +9,16 @@ #include "Tile.h" #include "../graphics/Sprite.h" +#include "../loader/TypeDescription.h" +#include "../loader/Interpreter.h" #include "../sdl/utility.h" #include using geometry::Vector; +using loader::FieldDescription; +using loader::Interpreter; +using loader::TypeDescription; namespace map { @@ -86,4 +91,21 @@ void Area::RenderDebug(SDL_Surface *dest, const graphics::Sprite *tileset, const } } + +void Area::CreateTypeDescription() { + Area a; + + TypeDescription &td(TypeDescription::Create(TYPE_ID, "Area")); + td.SetConstructor(&Construct); + td.SetSize(sizeof(Area)); + + td.AddField("battlebg", FieldDescription(((char *)&a.battlebg) - ((char *)&a), Interpreter::IMAGE_ID).SetReferenced()); + td.AddField("tiles", FieldDescription(((char *)&a.tiles) - ((char *)&a), Tile::TYPE_ID).SetReferenced().SetAggregate()); + td.AddField("width", FieldDescription(((char *)&a.width) - ((char *)&a), Interpreter::NUMBER_ID)); +} + +void Area::Construct(void *data) { + new (data) Area; +} + }