]> git.localhorst.tv Git - l2e.git/blobdiff - src/graphics/Frame.h
removed useless comments
[l2e.git] / src / graphics / Frame.h
index 09674cc62d2f63a97dc50a327a2c6df2c33a0fd4..48331f01dda00913a7e22294053f88d8e2b749bd 100644 (file)
@@ -1,14 +1,7 @@
-/*
- * Frame.h
- *
- *  Created on: Aug 7, 2012
- *      Author: holy
- */
-
 #ifndef GRAPHICS_FRAME_H_
 #define GRAPHICS_FRAME_H_
 
-#include "../geometry/Vector.h"
+#include "../math/Vector.h"
 
 #include <SDL.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:
@@ -25,20 +21,29 @@ public:
        int MinHeight() const { return 2 * BorderHeight(); }
        int BorderWidth() const { return BorderSize().X(); }
        int BorderHeight() const { return BorderSize().Y(); }
-       const geometry::Vector<int> BorderSize() const { return borderSize; }
+       const math::Vector<int> BorderSize() const { return borderSize; }
        int RepeatWidth() const { return RepeatSize().X(); }
        int RepeatHeight() const { return RepeatSize().Y(); }
-       const geometry::Vector<int> RepeatSize() const { return repeatSize; }
-       void Draw(SDL_Surface *dest, const geometry::Vector<int> &position, int width, int height) const;
+       const math::Vector<int> RepeatSize() const { return repeatSize; }
+       void Draw(SDL_Surface *dest, const math::Vector<int> &position, int width, int height) const;
+
+public:
+       void SetSurface(SDL_Surface *s) { surface = s; }
+       void SetBorderSize(const math::Vector<int> &s) { borderSize = s; }
+       void SetRepeatSize(const math::Vector<int> &s) { repeatSize = s; }
+       void SetOffset(const math::Vector<int> &o) { offset = o; }
+
+       static void CreateTypeDescription();
+       static void Construct(void *);
 
 private:
        SDL_Surface *surface;
-       geometry::Vector<int> borderSize;
-       geometry::Vector<int> repeatSize;
-       geometry::Vector<int> offset;
+       math::Vector<int> borderSize;
+       math::Vector<int> repeatSize;
+       math::Vector<int> offset;
 
 };
 
 }
 
-#endif /* GRAPHICS_FRAME_H_ */
+#endif