#ifndef __UOPGUMPS_H__
#define __UOPGUMPS_H__
#include <SDL/SDL_types.h>
#include <map>
#include <fstream>
#include "sprite.h"
class Hue
{
public:
Hue();
~Hue();
Uint16 colors[32],start,end;
bool loaded;
};
class GumpIndex
{
public:
GumpIndex();
~GumpIndex();
Uint32 offset,size;
Uint16 x,y,width,height;
bool patched;
};
class Gump : public Sprite
{
public:
Gump();
~Gump();
void load(Uint16 gump,Sint16 w=-1,Sint16 h=-1,bool tiled=false);
void load(Uint16 gump,Sint16 offsetx,Sint16 offsety,Sint16 w,Sint16 h,bool tiled);
void load(Uint16 *gumpIDs,Sint16 w,Sint16 h);
void blit(Sint16 x,Sint16 y,HueMethod hueMethod=HueNone,Uint16 hue=0);
private:
class Gump *children[9];
Sint16 offsetx,offsety;
};
class Gumps
{
public:
Gumps();
~Gumps();
GumpIndex &getIndex(int gump);
void setIndex(int gump,GumpIndex &index);
Hue &getHue(Uint16 hue);
private:
map<int,GumpIndex>gumps;
map<Uint16,Hue>hues;
ifstream idxfile,huefile;
};
#endif