#ifndef __SPRITE_H__ #define __SPRITE_H__ #include #include #include #include #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