X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fgraphics%2FFrame.h;h=09674cc62d2f63a97dc50a327a2c6df2c33a0fd4;hb=d20fa78a0dcbc95a69bb6077d2081d42b74a2d1a;hp=d2e8dd4c02a868d0946d2f243865246a219db0db;hpb=1162be37102b24df11f469495c0184f3f9a26ba0;p=l2e.git diff --git a/src/graphics/Frame.h b/src/graphics/Frame.h index d2e8dd4..09674cc 100644 --- a/src/graphics/Frame.h +++ b/src/graphics/Frame.h @@ -8,7 +8,7 @@ #ifndef GRAPHICS_FRAME_H_ #define GRAPHICS_FRAME_H_ -#include "../geometry/Point.h" +#include "../geometry/Vector.h" #include @@ -18,23 +18,24 @@ class Frame { public: Frame(SDL_Surface *s, int borderWidth, int borderHeight, int repeatWidth = 1, int repeatHeight = 1, int xOffset = 0, int yOffset = 0) - : surface(s), borderWidth(borderWidth), borderHeight(borderHeight), repeatWidth(repeatWidth), repeatHeight(repeatHeight), xOffset(xOffset), yOffset(yOffset) { } + : surface(s), borderSize(borderWidth, borderHeight), repeatSize(repeatWidth, repeatHeight), offset(xOffset, yOffset) { } public: - int MinWidth() const { return 2 * borderWidth; } - int MinHeight() const { return 2 * borderHeight; } - int BorderWidth() const { return borderWidth; } - int BorderHeight() const { return borderHeight; } - void Draw(SDL_Surface *dest, const geometry::Point &position, int width, int height) const; + int MinWidth() const { return 2 * BorderWidth(); } + int MinHeight() const { return 2 * BorderHeight(); } + int BorderWidth() const { return BorderSize().X(); } + int BorderHeight() const { return BorderSize().Y(); } + const geometry::Vector BorderSize() const { return borderSize; } + int RepeatWidth() const { return RepeatSize().X(); } + int RepeatHeight() const { return RepeatSize().Y(); } + const geometry::Vector RepeatSize() const { return repeatSize; } + void Draw(SDL_Surface *dest, const geometry::Vector &position, int width, int height) const; private: SDL_Surface *surface; - int borderWidth; - int borderHeight; - int repeatWidth; - int repeatHeight; - int xOffset; - int yOffset; + geometry::Vector borderSize; + geometry::Vector repeatSize; + geometry::Vector offset; };