


#ifndef  __MAJIK_PCTIM_H__
#define  __MAJIK_PCTIM_H__

#ifdef __cplusplus
extern "C" {
#endif

#include "islfile.h"
#include "DCK_Texture.h"


extern int utilPrint(char *fmt, ...);


#define TIM_FLAG_4BITCLUT		0x0
#define TIM_FLAG_8BITCLUT		0x1
#define TIM_FLAG_15BITDIRECT	0x2
#define TIM_FLAG_24BITDIRECT	0x3
#define TIM_FLAG_MIXED			0x4

#define TIM_FLAG_HASCLUT		0x8




typedef struct _TIM_PIXELDATA
{
	unsigned long bnum;
	unsigned short dx, dy;
	unsigned short width, height;
	unsigned short *pixels;
} TIM_PIXELDATA;


typedef struct _TIM_HEADER
{
	unsigned long ID;
	unsigned long flag;

	long srfWidth, srfHeight;		// Size of the surface in texels
	long timWidth, timHeight;		// Size of the TIM image in texels
	KMSURFACEDESC surface;			// Surface containing the TIM image in VRAM
	KMSURFACEDESC *surfacePtr;		// Pointer to the surface...for convenience or sumthin'
	KMSTRIPHEAD stripHead;			// Ummm....not sure why there's a strip head for a texture, but it's here

} TIM_HEADER;


int dcTim_Load(TIM_HEADER **header, char *filename);
int dcTim_Unload(TIM_HEADER **header);
int dcTim_Draw(int x0, int y0, int x1, int y1, TIM_HEADER *tim);



#ifdef __cplusplus
};
#endif


#endif
