#include "Frame.h"
+#include "../loader/TypeDescription.h"
+
using geometry::Vector;
+using loader::FieldDescription;
+using loader::TypeDescription;
namespace graphics {
SDL_BlitSurface(surface, &srcRect, dest, &destRect);
}
+
+void Frame::CreateTypeDescription() {
+ Frame f;
+ TypeDescription &td(TypeDescription::CreateOrGet("Frame"));
+
+ td.SetSize(sizeof(Frame));
+
+ int imageId(TypeDescription::GetTypeId("Image"));
+ int vectorId(TypeDescription::GetTypeId("Vector"));
+
+ td.AddField("surface", FieldDescription(((char *)&f.surface) - ((char *)&f), imageId, true));
+ td.AddField("borderSize", FieldDescription(((char *)&f.borderSize) - ((char *)&f), vectorId, false));
+ td.AddField("repeatSize", FieldDescription(((char *)&f.repeatSize) - ((char *)&f), vectorId, false));
+ td.AddField("offset", FieldDescription(((char *)&f.offset) - ((char *)&f), vectorId, false));
+}
+
}
void SetRepeatSize(const geometry::Vector<int> &s) { repeatSize = s; }
void SetOffset(const geometry::Vector<int> &o) { offset = o; }
+ static void CreateTypeDescription();
+
private:
SDL_Surface *surface;
geometry::Vector<int> borderSize;