niotso/Libraries/FileHandler/iff/sprite.h
thnor 6c85920535 Support for sprites was added to libiff.
Support for SPR# and SPR2 was added to iff2html.

*NOTE: The default exporter used is the PNG one, since web browsers
don't like targa. However, since there is a bug in my PNG exporter, I would
recommend that you use the targa exporter for a precise representation of the
loaded sprite frame(s). Feel free to fix the PNG exporter, btw :)
2012-04-04 00:24:25 -05:00

41 lines
771 B
C

#define IFF2HTML
typedef struct IFFSpriteColor_struct
{
uint8_t A;
uint8_t R;
uint8_t G;
uint8_t B;
} IFFSpriteColor;
typedef struct IFFPixelMap_struct
{
IFFSpriteColor *Colors; /* This is 255 b/c sometimes SPR2 and SPR resource go out of bounds (safety first!) */
} IFFPMap;
typedef struct IFFSpriteFrame_struct
{
uint16_t XLocation;
uint16_t YLocation;
uint16_t Width;
uint16_t Height;
uint16_t Flag;
uint16_t PaletteID;
IFFSpriteColor TransparentPixel;
IFFSpriteColor *Texels;
#ifdef IFF2HTML
char *filePath;
#endif
} IFFSpriteFrame;
typedef struct IFFSprite_struct
{
IFFSpriteFrame **Frames;
uint16_t FrameCount;
#ifdef IFF2HTML
uint32_t Version;
#endif
} IFFSprite;