X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fgraphics%2FFrame.h;h=62c052d0765d168686d4d452a6868bf77c6ed0fe;hb=cc3d698b8c1ad09d7a3f9e3f28bc84e0ac1735ea;hp=09674cc62d2f63a97dc50a327a2c6df2c33a0fd4;hpb=d20fa78a0dcbc95a69bb6077d2081d42b74a2d1a;p=l2e.git diff --git a/src/graphics/Frame.h b/src/graphics/Frame.h index 09674cc..62c052d 100644 --- a/src/graphics/Frame.h +++ b/src/graphics/Frame.h @@ -1,10 +1,3 @@ -/* - * Frame.h - * - * Created on: Aug 7, 2012 - * Author: holy - */ - #ifndef GRAPHICS_FRAME_H_ #define GRAPHICS_FRAME_H_ @@ -17,7 +10,10 @@ namespace graphics { class Frame { public: - Frame(SDL_Surface *s, int borderWidth, int borderHeight, int repeatWidth = 1, int repeatHeight = 1, int xOffset = 0, int yOffset = 0) + static const int TYPE_ID = 405; + +public: + explicit Frame(SDL_Surface *s = 0, int borderWidth = 1, int borderHeight = 1, int repeatWidth = 1, int repeatHeight = 1, int xOffset = 0, int yOffset = 0) : surface(s), borderSize(borderWidth, borderHeight), repeatSize(repeatWidth, repeatHeight), offset(xOffset, yOffset) { } public: @@ -31,6 +27,15 @@ public: const geometry::Vector RepeatSize() const { return repeatSize; } void Draw(SDL_Surface *dest, const geometry::Vector &position, int width, int height) const; +public: + void SetSurface(SDL_Surface *s) { surface = s; } + void SetBorderSize(const geometry::Vector &s) { borderSize = s; } + void SetRepeatSize(const geometry::Vector &s) { repeatSize = s; } + void SetOffset(const geometry::Vector &o) { offset = o; } + + static void CreateTypeDescription(); + static void Construct(void *); + private: SDL_Surface *surface; geometry::Vector borderSize;