X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fgraphics%2FFont.cpp;h=e4e538d90250abf4bb06034989f95cf247ba171a;hb=ed792d6d00d822384d79d049e644e372f7c3b4cd;hp=c68031065b717486f55d06bb589d124b84d0228a;hpb=679b9e39c7680fd46482589f37f0a225032103b7;p=l2e.git diff --git a/src/graphics/Font.cpp b/src/graphics/Font.cpp index c680310..e4e538d 100644 --- a/src/graphics/Font.cpp +++ b/src/graphics/Font.cpp @@ -77,16 +77,21 @@ void Font::DrawNumber(int numberIn, SDL_Surface *dest, const Vector &positi void Font::CreateTypeDescription() { Font f; - TypeDescription &td(TypeDescription::CreateOrGet("Font")); - - td.SetSize(sizeof(Font)); int numberId(TypeDescription::GetTypeId("Number")); int spriteId(TypeDescription::GetTypeId("Sprite")); + TypeDescription &td(TypeDescription::CreateOrGet("Font")); + td.SetConstructor(&Construct); + td.SetSize(sizeof(Font)); + td.AddField("sprite", FieldDescription(((char *)&f.sprite) - ((char *)&f), spriteId, true)); td.AddField("columnoffset", FieldDescription(((char *)&f.colOffset) - ((char *)&f), numberId, false)); td.AddField("rowoffset", FieldDescription(((char *)&f.rowOffset) - ((char *)&f), numberId, false)); } +void Font::Construct(void *data) { + new (data) Font; +} + }