summaryrefslogtreecommitdiff
path: root/include/sprite.h
diff options
context:
space:
mode:
authorpixel <pixel>2003-02-17 09:10:04 +0000
committerpixel <pixel>2003-02-17 09:10:04 +0000
commit054738ff7c07cf86e72fa7fb6d4136349eef5b1c (patch)
tree20f8d40e967f1c0ad663b9a81b22c0e43a00bad6 /include/sprite.h
parent1ca09259a5195eda52223172e35c58f24383329d (diff)
Forgot a .h.... tsk tsk tsk...
Diffstat (limited to 'include/sprite.h')
-rw-r--r--include/sprite.h43
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