#include<ultra64.h>

extern Vtx TI_Lcanon_Body_v[];
extern Vtx TI_Lcanon_Body_vmcur[];
extern Tri TI_Lcanon_Body_tri[];
extern Mtx TI_Lcanon_Body_matrix[];

extern unsigned short TI_Diord01_txt[];
extern unsigned short TI_Duct05_txt[];
extern unsigned short TI_Paint01_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_Body ======== */

Gfx TI_Lcanon_Body[]={

	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_Body_v[0],13,0),
	gsSP2Triangles(0, 1, 2, 0, 1, 3, 2, 0),
	gsSP2Triangles(1, 4, 3, 0, 4, 5, 3, 0),
	gsSP2Triangles(2, 6, 0, 0, 7, 8, 9, 0),
	gsSP1Triangle(10, 11, 12, 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_Diord01_txt,G_IM_FMT_RGBA,G_IM_SIZ_16b,16,16,0,7),


	gsSPVertex(&TI_Lcanon_Body_v[13],9,0),
	gsSP2Triangles(0, 1, 2, 0, 3, 4, 5, 0),
	gsSP1Triangle(6, 7, 8, 0),
	gs_Nin_SetUpTileDescrip(G_IM_FMT_RGBA,G_IM_SIZ_16b,16,16,0,0,G_TX_CLAMP,4,0,G_TX_CLAMP,4,0),
	gs_Nin_LoadTextureImage(TI_Paint01_txt,G_IM_FMT_RGBA,G_IM_SIZ_16b,16,16,0,7),



	gsSPVertex(&TI_Lcanon_Body_v[22],20,0),
	gsSP2Triangles(0, 1, 2, 0, 2, 3, 0, 0),
	gsSP2Triangles(1, 0, 4, 0, 5, 6, 7, 0),
	gsSP2Triangles(6, 8, 7, 0, 9, 10, 11, 0),
	gsSP2Triangles(12, 13, 14, 0, 0, 15, 4, 0),
	gsSP2Triangles(16, 17, 18, 0, 16, 19, 17, 0),
	gsSPEndDisplayList(),
}; /* TI_Lcanon_Body */ 

#undef G_CC_PRIMSHADE

#undef gs_Nin_LoadTextureImage

#undef gs_Nin_SetUpTileDescrip

/* 42 vertices */
Vtx TI_Lcanon_Body_v[]={
	{   -13,   -70,   106,     0,    85,   662,  -119,     0,     0,   255},	/* 0 */
	{     0,   -57,   123,     0,   255,   662,     0,    57,   104,   255},	/* 1 */
	{   -13,     9,    75,     0,   170,    60,     0,    71,    96,   255},	/* 2 */
	{    13,     9,    75,     0,   341,    60,    58,    54,    89,   255},	/* 3 */
	{    13,   -70,   106,     0,   426,   662,   120,     0,     0,   255},	/* 4 */
	{     0,   -18,    57,     0,   426,    60,   109,   -48,   -13,   255},	/* 5 */
	{     0,   -18,    57,     0,    85,    60,  -108,   -48,   -13,   255},	/* 6 */
	{    18,   -97,   154,     0,   385,   512,   105,   -44,    36,   255},	/* 7 */
	{     0,   -48,   189,     0,   252,    33,    69,     5,    97,   255},	/* 8 */
	{   -18,   -97,   154,     0,   120,   512,  -104,   -44,    36,   255},	/* 9 */
	{    18,   -97,   154,     0,   140,   512,   105,   -44,    36,   255},	/* 10 */
	{   -18,   -97,   154,     0,   377,   512,  -104,   -44,    36,   255},	/* 11 */
	{     0,  -104,   100,     0,   258,    76,    71,   -95,   -10,   255},	/* 12 */
	{     0,   -48,   189,     0,   251,   160,    69,     5,    97,   255},	/* 13 */
	{    18,   -12,   150,     0,   460,  -127,   107,    17,    51,   255},	/* 14 */
	{   -18,   -12,   150,     0,    41,  -127,  -106,    17,    51,   255},	/* 15 */
	{   -18,   -97,   154,     0,    56,   472,  -104,   -44,    36,   255},	/* 16 */
	{     0,   -48,   189,     0,   253,   213,  -107,     2,    51,   255},	/* 17 */
	{   -18,   -12,   150,     0,    56,     0,  -106,    17,    51,   255},	/* 18 */
	{    18,   -12,   150,     0,    56,     0,   107,    17,    51,   255},	/* 19 */
	{     0,   -48,   189,     0,   253,   213,    69,     5,    97,   255},	/* 20 */
	{    18,   -97,   154,     0,    56,   472,   105,   -44,    36,   255},	/* 21 */
	{     0,   -18,    57,     0,   345,   215,  -108,   -48,   -13,   255},	/* 22 */
	{     0,   -22,     0,     0,    97,   279,   102,   -63,     4,   255},	/* 23 */
	{    22,    13,     0,     0,   208,     1,   103,   -60,     6,   255},	/* 24 */
	{    13,     9,    75,     0,   500,    -1,   111,   -39,   -23,   255},	/* 25 */
	{   -22,    13,     0,     0,   208,     1,  -102,   -60,     6,   255},	/* 26 */
	{     0,  -104,   100,     0,   512,   512,   -92,   -72,   -20,   255},	/* 27 */
	{   -18,   -97,   154,     0,     0,   512,  -104,   -44,    36,   255},	/* 28 */
	{   -40,   -46,    74,     0,   512,     0,  -114,   -29,    12,   255},	/* 29 */
	{   -18,   -12,   150,     0,     0,     0,  -106,    17,    51,   255},	/* 30 */
	{   -13,     9,    75,     0,   512,   512,   255,   255,   255,   255},	/* 31 */
	{    13,     9,    75,     0,     0,   512,   255,   255,   255,   255},	/* 32 */
	{   -22,    13,     0,     0,   512,     0,   255,   255,   255,   255},	/* 33 */
	{    13,     9,    75,     0,   512,     0,   255,   255,   255,   255},	/* 34 */
	{    22,    13,     0,     0,   512,   512,   255,   255,   255,   255},	/* 35 */
	{   -22,    13,     0,     0,     0,   512,   255,   255,   255,   255},	/* 36 */
	{   -13,     9,    75,     0,   500,    -1,  -117,   -21,     2,   255},	/* 37 */
	{    40,   -46,    74,     0,   512,     0,   115,   -29,    12,   255},	/* 38 */
	{    18,   -97,   154,     0,     0,   512,   105,   -44,    36,   255},	/* 39 */
	{     0,  -104,   100,     0,   512,   512,    71,   -95,   -10,   255},	/* 40 */
	{    18,   -12,   150,     0,     0,     0,   107,    17,    51,   255},	/* 41 */
};


/*   0 vertices */
/*   2 Materials */

#define	LDIRX	0
#define	LDIRY	0
#define	LDIRZ	120
#define	AMBDIV	1
