#include<ultra64.h>

extern Vtx TI_Lcanon_Canon01_v[];
extern Vtx TI_Lcanon_Canon01_vmcur[];
extern Tri TI_Lcanon_Canon01_tri[];
extern Mtx TI_Lcanon_Canon01_matrix[];

extern unsigned short TI_Catapira02_txt[];
extern unsigned short TI_Duct05_txt[];



#define gs_Nin_LoadTextureImage(timg,fmt,siz,width,height,tmem,tt)	\
	gsDPSetTextureImage(fmt,siz,1,timg),	\
	gsDPTileSync(),	\
	gsDPSetTile(fmt,siz,0,tmem,tt,0,0,0,0,0,0,0),	\
	gsDPLoadSync(),	\
	gsDPLoadBlock(tt,0,0,width*height-1,CALC_DXT(width,siz##_BYTES))

#define gs_Nin_SetUpTileDescrip(fmt,siz,width,height,tmem,tt,cs,ms,ss,ct,mt,st)	\
	gsDPTileSync(),	\
	gsDPSetTile(fmt,siz,((((width)*siz##_LINE_BYTES)+7)>>3),tmem,tt,0,ct,mt,st,cs,ms,ss),	\
	gsDPSetTileSize(tt,0,0,(width-1)<<G_TEXTURE_IMAGE_FRAC,(height-1)<<G_TEXTURE_IMAGE_FRAC)

#define G_CC_PRIMSHADE PRIMITIVE,0,SHADE,0,0,0,0,SHADE

/* main display list */


/* ======== TI_Lcanon_Canon ======== */

Gfx TI_Lcanon_Canon01[]={

	gs_Nin_SetUpTileDescrip(G_IM_FMT_RGBA,G_IM_SIZ_16b,16,16,0,0,G_TX_CLAMP,4,0,G_TX_WRAP,4,0),
	gs_Nin_LoadTextureImage(TI_Duct05_txt,G_IM_FMT_RGBA,G_IM_SIZ_16b,16,16,0,7),


	gsSPVertex(&TI_Lcanon_Canon01_v[0],5,0),
	gsSP2Triangles(0, 1, 2, 0, 3, 4, 2, 0),
	gsSP2Triangles(2, 1, 3, 0, 2, 4, 0, 0),
	gs_Nin_SetUpTileDescrip(G_IM_FMT_RGBA,G_IM_SIZ_16b,16,16,0,0,G_TX_WRAP,4,0,G_TX_WRAP,4,0),
	gs_Nin_LoadTextureImage(TI_Catapira02_txt,G_IM_FMT_RGBA,G_IM_SIZ_16b,16,16,0,7),

	gsSPVertex(&TI_Lcanon_Canon01_v[5],5,0),
	gsSP2Triangles(0, 1, 2, 0, 2, 3, 4, 0),
	gsSPEndDisplayList(),
}; /* TI_Lcanon_Canon */ 

#undef G_CC_PRIMSHADE

#undef gs_Nin_LoadTextureImage

#undef gs_Nin_SetUpTileDescrip

/* 10 vertices */
Vtx TI_Lcanon_Canon01_v[]={
	{    17,     0,    25,     0,   249,   383,   110,   -42,   -24,   255},	/* 0 */
	{     0,   -17,    25,     0,   109,   383,   -31,  -115,    -4,   255},	/* 1 */
	{     0,     0,   -13,     0,   252,  -116,   -61,    62,   -81,   255},	/* 2 */
	{   -17,     0,    25,     0,   249,   383,   -84,   -84,   -10,   255},	/* 3 */
	{     0,    17,    25,     0,   389,   382,     0,   110,   -48,   255},	/* 4 */
	{    -5,    -5,    75,     0,   273,   122,   -84,   -84,     9,   255},	/* 5 */
	{   -17,     0,    25,     0,   157,   458,   -84,   -84,   -10,   255},	/* 6 */
	{     0,   -17,    25,     0,   389,   458,   -31,  -115,    -4,   255},	/* 7 */
	{    17,     0,    25,     0,   157,   458,   110,   -42,   -24,   255},	/* 8 */
	{     5,    -5,    75,     0,   273,   122,    85,   -84,     9,   255},	/* 9 */
};


/*   0 vertices */
/*   1 Materials */

#define	LDIRX	0
#define	LDIRY	0
#define	LDIRZ	120
#define	AMBDIV	1
