X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fgraphics%2FFrame.h;fp=src%2Fgraphics%2FFrame.h;h=0f1287c06a3d2528b6f01c074ddda32f3c5ec75e;hb=cccda573516f3bce30efbaba3fc20e4148d3cdc8;hp=0000000000000000000000000000000000000000;hpb=526504934732d84cf43f164125f04f1f3e9cb225;p=l2e.git diff --git a/src/graphics/Frame.h b/src/graphics/Frame.h new file mode 100644 index 0000000..0f1287c --- /dev/null +++ b/src/graphics/Frame.h @@ -0,0 +1,41 @@ +/* + * Frame.h + * + * Created on: Aug 7, 2012 + * Author: holy + */ + +#ifndef GRAPHICS_FRAME_H_ +#define GRAPHICS_FRAME_H_ + +#include "../geometry/Point.h" + +#include + +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) + : surface(s), borderWidth(borderWidth), borderHeight(borderHeight), repeatWidth(repeatWidth), repeatHeight(repeatHeight), xOffset(xOffset), yOffset(yOffset) { } + +public: + int MinWidth() const { return 2 * borderWidth; } + int MinHeight() const { return 2 * borderHeight; } + void Draw(SDL_Surface *dest, geometry::Point position, int width, int height) const; + +private: + SDL_Surface *surface; + int borderWidth; + int borderHeight; + int repeatWidth; + int repeatHeight; + int xOffset; + int yOffset; + +}; + +} + +#endif /* GRAPHICS_FRAME_H_ */