/***************************************************************************
 *
 * n64res.h
 *
 ***************************************************************************
 *
 * n64 shape/texture resource management
 *
 ***************************************************************************/

#ifndef N64RES_H_INCLUDED
#define N64RES_H_INCLUDED

/*
 * includes
 */

#include "ult_64.h"

/*
 * defines
 */

/*
 * typedefs
 */

/*
 * structures
 */

typedef struct _texture
{
        unsigned short	sx,sy;
        unsigned long	flags;
        unsigned char	**paletteHandle;	// NULL on N64
        unsigned char	**bitmapHandle;
	unsigned char	*data;
} texture;

typedef struct _n64Script
{
	Vtx		**vertices;
	unsigned long	size;
	unsigned char	data[1];
} n64Script;

typedef struct _vtxEntry
{
	unsigned long	tag;
	texture		**tex;
} vtxEntry;

typedef struct _vtxMap
{
	unsigned long	count;
	vtxEntry	entries[1];
} vtxMap;

/*
 * globals
 */

/*
 * function prototypes
 */

extern int	N64ResGenerateDL(n64Script *scr,Gfx *dl,unsigned long size,vtxMap *m);
extern int	N64ResGetSize(n64Script *scr,int useTex);
extern void	N64ResAppendDL(n64Script *scr,Gfx **dl,vtxMap *m);
extern void	N64ResSetAlpha(int a);

#endif
