#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, ColorP = WHITE); private: class TexList : public Base { public: TexList(int); virtual ~TexList(); Sprite * sprheader; const texture * GetTex() const; texture * GetTex(); static const TexList * GetHead(); const TexList * GetNext() const; TexList * GetNext(); void Bind() const; private: texture * tex; static TexList * header; TexList * next, * prev; }; Sprite * next, * prev; TexList * tlist; int sx, sy, posx, posy; void alloc(); bool canfit(int, int, int, int) const; bool intersect(int, int, int, int) const; }; }; #endif