#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),
	gsSP1Triangle(0, 1, 2, 0),
	gsSP1Triangle(3, 4, 2, 0),
	gsSP1Triangle(2, 1, 3, 0),
	gsSP1Triangle(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),
	gsSP1Triangle(0, 1, 2, 0),
	gsSP1Triangle(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 },   /* v0 p59/V3 used 2 times */ 
	{ 0,-17,25,0, 109, 383, -31,-115,-4,255 },   /* v1 p60/V2 used 2 times */ 
	{ 0,0,-13,0, 252, -116, -61,62,-81,255 },   /* v2 p59/V1 used 4 times */ 
	{ -17,0,25,0, 249, 383, -84,-84,-10,255 },   /* v3 p60/V3 used 2 times */ 
	{ 0,17,25,0, 389, 382, 0,110,-48,255 },   /* v4 p59/V2 used 2 times */ 
	{ -5,-5,75,0, 273, 122, -84,-84,9,255 },   /* v5 p55/V1 used 1 times */ 
	{ -17,0,25,0, 157, 458, -84,-84,-10,255 },   /* v6 p55/V2 used 1 times */ 
	{ 0,-17,25,0, 389, 458, -31,-115,-4,255 },   /* v7 p70/V1 used 2 times */ 
	{ 17,0,25,0, 157, 458, 110,-42,-24,255 },   /* v8 p70/V2 used 1 times */ 
	{ 5,-5,75,0, 273, 122, 85,-84,9,255 },   /* v9 p70/V3 used 1 times */ 
};


/*   0 vertices */
/*   1 Materials */

#define	LDIRX	0
#define	LDIRY	0
#define	LDIRZ	120
#define	AMBDIV	1
/* 16 x 16  G_IM_SIZ_16b G_IM_FMT_RGBA  */
unsigned short TI_Catapira02_txt[] = {
	0x1, 0x3949, 0x5a51, 0x1, 0x7b9b, 0xa4e7, 0x1, 0xd5ed, 0xbd67, 0x1, 0x8bdd, 0x7317, 0x1, 0x418b, 0x2083, 0x1, 
	0x1, 0x801, 0x3149, 0x1, 0x420f, 0x6317, 0x1, 0x62d5, 0x41cd, 0x1, 0x41cd, 0x398b, 0x1, 0x1883, 0x1, 0x1, 
	0x1, 0x1, 0x3105, 0x5a0f, 0x1, 0x8bdd, 0x8399, 0x1, 0x8399, 0x49cd, 0x1, 0x28c3, 0x28c3, 0x1, 0x1, 0x1, 
	0x1, 0x1, 0x1041, 0x3107, 0x1, 0x398b, 0x41cb, 0x1, 0x418b, 0x1883, 0x1, 0x801, 0x801, 0x1, 0x1, 0x1, 
	0x1, 0x3107, 0x498b, 0x520f, 0x93dd, 0x39cd, 0x83dd, 0xfffd, 0xfffb, 0x6293, 0x941f, 0xa4a3, 0x7b17, 0x6291, 0x49cb, 0x1, 
	0x1, 0x418b, 0x6291, 0x7317, 0xace5, 0xd671, 0xef39, 0xffff, 0xffbb, 0xf777, 0xd62f, 0xa4a1, 0x7315, 0x520f, 0x418b, 0x1, 
	0x1, 0x520f, 0x7315, 0x801, 0x801, 0x801, 0x28c3, 0xfffd, 0xf779, 0x28c3, 0x1, 0x1, 0x1, 0x49cd, 0x3107, 0x1, 
	0x1, 0x520f, 0x6293, 0x1, 0xef79, 0xe737, 0x28c3, 0xffbd, 0xe6f5, 0x28c3, 0xef79, 0xef79, 0x2041, 0x418b, 0x2905, 0x1, 
	0x1, 0x4149, 0x49cb, 0x1, 0xbd69, 0xcded, 0x28c3, 0x8c21, 0x7b59, 0x28c3, 0xace3, 0x8bdd, 0x2041, 0x3107, 0x1841, 0x1, 
	0x1, 0x1, 0x801, 0x1, 0xc5ab, 0xdeb1, 0x28c3, 0x28c3, 0x28c3, 0x28c3, 0xa4a3, 0x7b17, 0x1, 0x1, 0x1, 0x1, 
	0x1, 0x6291, 0x839b, 0xace3, 0xde71, 0xff79, 0xffff, 0xffff, 0xe6f7, 0xbda9, 0xa4a3, 0x5a51, 0x498b, 0x3107, 0x2083, 0x1, 
	0x1, 0x3947, 0x3149, 0xbd27, 0xeef3, 0xfffd, 0xffff, 0xffbb, 0x8c1f, 0x2107, 0x839b, 0x5a51, 0x2907, 0x1843, 0x2083, 0x1, 
	0x1, 0x1, 0x1, 0x1883, 0x28c5, 0x1, 0x41cd, 0x4a0f, 0x1, 0x3949, 0x3107, 0x1, 0x2083, 0x1841, 0x1, 0x1, 
	0x1, 0x1, 0x1, 0x28c5, 0x3949, 0x1, 0x9c5f, 0xb525, 0x1, 0x93dd, 0x7b57, 0x1, 0x3107, 0x1841, 0x1, 0x1, 
	0x1, 0x1, 0x3149, 0x1, 0x398b, 0x398b, 0x1, 0x4a0f, 0x5251, 0x1, 0x420f, 0x314b, 0x1, 0x3149, 0x1, 0x1, 
	0x1, 0x30c5, 0x6ad3, 0x1, 0x6ad5, 0x8c1f, 0x1, 0xb567, 0xcded, 0x1, 0x9ca3, 0x839b, 0x1, 0x6ad5, 0x30c5, 0x1, 
};

/* 16 x 16  G_IM_SIZ_16b G_IM_FMT_RGBA  */
unsigned short TI_Duct05_txt[] = {
	0x4801, 0x8843, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x8843, 0x4001, 
	0x4801, 0x8843, 0x1041, 0x2881, 0x3103, 0x4105, 0x4187, 0x4105, 0x4105, 0x38c5, 0x38c5, 0x3103, 0x2081, 0x1041, 0x2843, 0x4001, 
	0x3801, 0x3843, 0x28c5, 0x4989, 0x628f, 0x624f, 0x93db, 0xfff7, 0xd62b, 0x7b15, 0x59cb, 0x8419, 0x520d, 0x2907, 0x7043, 0x2801, 
	0x3001, 0x7043, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x8843, 0x4001, 
	0x4801, 0x8843, 0x1041, 0x2081, 0x3103, 0x4187, 0x4187, 0x528d, 0x4187, 0x49c9, 0x4187, 0x39c7, 0x2081, 0x1041, 0x2843, 0x4001, 
	0x4801, 0x8843, 0x2907, 0x520d, 0x7355, 0x7313, 0x93db, 0xfff7, 0xace3, 0xce6b, 0x9cdf, 0x8419, 0x628f, 0x3147, 0x8843, 0x4001, 
	0x3801, 0x7843, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x7043, 0x3001, 
	0x4801, 0x8043, 0x1041, 0x20c1, 0x3145, 0x4187, 0x49c9, 0x528d, 0x49c9, 0x49c9, 0x528d, 0x39c7, 0x2101, 0x1081, 0x8843, 0x4001, 
	0x3801, 0x8043, 0x2907, 0x520d, 0x8419, 0x7313, 0xace1, 0xfff7, 0xa45f, 0x93db, 0x7313, 0x7355, 0x6b53, 0x39cb, 0x7043, 0x3001, 
	0x4801, 0x8843, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x6843, 0x2801, 
	0x4001, 0x3843, 0x1041, 0x2081, 0x3145, 0x4187, 0x49c9, 0x528d, 0x49c9, 0x528d, 0x528d, 0x3145, 0x2881, 0x1041, 0x8843, 0x4001, 
	0x4801, 0x4043, 0x3147, 0x628f, 0x7355, 0x7b55, 0xce6b, 0xfff7, 0xfff7, 0xce6b, 0x9cdf, 0x8419, 0x4989, 0x28c5, 0x8843, 0x4001, 
	0x4801, 0x8843, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x8843, 0x4001, 
	0x3801, 0x7843, 0x1081, 0x2101, 0x3103, 0x4105, 0x38c5, 0x4187, 0x528d, 0x49c9, 0x4105, 0x3145, 0x2101, 0x1081, 0x2843, 0x3801, 
	0x4801, 0x8843, 0x39cb, 0x6b53, 0x9c5d, 0x7313, 0x8399, 0xc5a7, 0xfff7, 0xce6b, 0x83d9, 0x9cdd, 0x6b53, 0x39cb, 0x7043, 0x2801, 
	0x4801, 0x8843, 0x1, 0x1, 0xce27, 0x1, 0x1, 0xe6ad, 0xf7b5, 0x1, 0x1, 0xdeeb, 0x1, 0x1, 0x8843, 0x4801, 
};

