1 #ifndef GRAPHICS_FRAME_H_
2 #define GRAPHICS_FRAME_H_
4 #include "../math/Vector.h"
13 static const int TYPE_ID = 405;
16 explicit Frame(SDL_Surface *s = 0, int borderWidth = 1, int borderHeight = 1, int repeatWidth = 1, int repeatHeight = 1, int xOffset = 0, int yOffset = 0)
17 : surface(s), borderSize(borderWidth, borderHeight), repeatSize(repeatWidth, repeatHeight), offset(xOffset, yOffset) { }
20 int MinWidth() const { return 2 * BorderWidth(); }
21 int MinHeight() const { return 2 * BorderHeight(); }
22 int BorderWidth() const { return BorderSize().X(); }
23 int BorderHeight() const { return BorderSize().Y(); }
24 const math::Vector<int> BorderSize() const { return borderSize; }
25 int RepeatWidth() const { return RepeatSize().X(); }
26 int RepeatHeight() const { return RepeatSize().Y(); }
27 const math::Vector<int> RepeatSize() const { return repeatSize; }
28 void Draw(SDL_Surface *dest, const math::Vector<int> &position, int width, int height) const;
31 void SetSurface(SDL_Surface *s) { surface = s; }
32 void SetBorderSize(const math::Vector<int> &s) { borderSize = s; }
33 void SetRepeatSize(const math::Vector<int> &s) { repeatSize = s; }
34 void SetOffset(const math::Vector<int> &o) { offset = o; }
36 static void CreateTypeDescription();
37 static void Construct(void *);
41 math::Vector<int> borderSize;
42 math::Vector<int> repeatSize;
43 math::Vector<int> offset;