#ifndef _TEXMALLOC_H_
#define _TEXMALLOC_H_

typedef struct ALLOC_AREA{
	struct ALLOC_AREA *next;
	struct ALLOC_AREA *before;
	Sint32 flag;
	Sint8 *addr;
	Sint32 size;
}ALLOC_AREA;

#define TEXMEM_BLOCK_NUM	(1024)
#define BLOCK_WIDTH		(8)
#define BLOCK_HEIGHT	(8)
#define BLOCK_SIZE		(32)
#define DISP_WIDTH		(480)
#define DISP_HEIGHT		(368)
#define SPACE_COLOR		(0xFF00C0C0)
#define USE_COLOR		(0xFFC00000)
#define START_X_POS		(140.f)
#define START_Y_POS		(80.f)

extern ALLOC_AREA head;
extern ALLOC_AREA tail;
extern ALLOC_AREA texblock[TEXMEM_BLOCK_NUM];
extern ALLOC_AREA *max_area;
extern ALLOC_AREA *space_area;

Sint32 InitTexFixedArea(Uint32 size);
void SetTexFixedArea(void);
Sint8* TexMalloc(Uint32 size);
void TexFree(Sint8 *addr);

Sint32 InitTexFixedArea(Uint32 size);
void SetTexFixedArea(void);
Sint32 LoadFileTexture(NJS_TEXLIST *texlist,Uint32 n);
Sint32 ReleaseTexture(NJS_TEXLIST *texlist,Uint32 n);


#endif