4 * Created on: Aug 7, 2012
8 #ifndef GRAPHICS_FRAME_H_
9 #define GRAPHICS_FRAME_H_
11 #include "../geometry/Vector.h"
20 Frame(SDL_Surface *s, int borderWidth, int borderHeight, int repeatWidth = 1, int repeatHeight = 1, int xOffset = 0, int yOffset = 0)
21 : surface(s), borderSize(borderWidth, borderHeight), repeatSize(repeatWidth, repeatHeight), offset(xOffset, yOffset) { }
24 int MinWidth() const { return 2 * BorderWidth(); }
25 int MinHeight() const { return 2 * BorderHeight(); }
26 int BorderWidth() const { return BorderSize().X(); }
27 int BorderHeight() const { return BorderSize().Y(); }
28 const geometry::Vector<int> BorderSize() const { return borderSize; }
29 int RepeatWidth() const { return RepeatSize().X(); }
30 int RepeatHeight() const { return RepeatSize().Y(); }
31 const geometry::Vector<int> RepeatSize() const { return repeatSize; }
32 void Draw(SDL_Surface *dest, const geometry::Vector<int> &position, int width, int height) const;
36 geometry::Vector<int> borderSize;
37 geometry::Vector<int> repeatSize;
38 geometry::Vector<int> offset;
44 #endif /* GRAPHICS_FRAME_H_ */