diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/sprite.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/include/sprite.h b/include/sprite.h new file mode 100644 index 0000000..803bd4a --- /dev/null +++ b/include/sprite.h @@ -0,0 +1,43 @@ +#ifndef __SPRITE_H__ +#define __SPRITE_H__ + +#include <vector> +#include <Exceptions.h> +#include <Handle.h> +#include <Color.h> +#include "gltexture.h" + +namespace mogltk { + + class Sprite : public Base { + public: + Sprite(Handle *, int, int); + Sprite(Uint8 *, int, int); + virtual ~Sprite(); + void draw(int, int, Color = WHITE); + private: + class TexList : public Base { + public: + TexList(int); + virtual ~TexList(); + Sprite * sprheader; + const texture * GetTex() const; + static const TexList * GetHead() const; + const TexList * GetNext() const; + void Bind() const; + private: + texture * tex; + static TexList * header; + TexList * next, * prev; + }; + Sprite * next, * prev; + TexList * tlist; + int sx, sy, posx, posy; + void alloc() const; + bool canfit(int, int, int, int) const; + bool intersect(int, int, int, int) const; + }; + +}; + +#endif |