#include<ultra64.h>

extern Vtx TI_Enemytank_Body_v[];
extern Vtx TI_Enemytank_Body_vmcur[];
extern Tri TI_Enemytank_Body_tri[];
extern Mtx TI_Enemytank_Body_matrix[];

extern unsigned short TI_Catapira01_txt[];
extern unsigned short TI_Catapira02_txt[];
extern unsigned short TI_Diord01_txt[];
extern unsigned short TI_Duct01_txt[];
extern unsigned short TI_Duct02_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


Gfx TI_Enemytank_Body_[]={
	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_Duct02_txt,G_IM_FMT_RGBA,G_IM_SIZ_16b,16,16,0,7),

	gsSPVertex(&TI_Enemytank_Body_v[0],3,0),
	gsSP1Triangle(0, 1, 2, 0),
	gs_Nin_LoadTextureImage(TI_Duct02_txt,G_IM_FMT_RGBA,G_IM_SIZ_16b,16,16,0,7),


	gsSPVertex(&TI_Enemytank_Body_v[3],3,0),
	gsSP1Triangle(0, 1, 2, 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_Duct01_txt,G_IM_FMT_RGBA,G_IM_SIZ_16b,16,16,0,7),


	gsSPVertex(&TI_Enemytank_Body_v[6],10,0),
	gsSP2Triangles(0, 1, 2, 0, 3, 4, 5, 0),
	gsSP2Triangles(6, 7, 8, 0, 6, 9, 7, 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_Duct02_txt,G_IM_FMT_RGBA,G_IM_SIZ_16b,16,16,0,7),



	gsSPVertex(&TI_Enemytank_Body_v[16],28,0),
	gsSP2Triangles(0, 1, 2, 0, 3, 4, 5, 0),
	gsSP2Triangles(3, 6, 4, 0, 7, 8, 9, 0),
	gsSP2Triangles(7, 10, 8, 0, 11, 12, 13, 0),
	gsSP2Triangles(13, 14, 11, 0, 1, 15, 2, 0),
	gsSP2Triangles(16, 17, 18, 0, 18, 19, 16, 0),
	gsSP2Triangles(20, 21, 22, 0, 22, 23, 20, 0),
	gsSP2Triangles(24, 25, 26, 0, 26, 27, 24, 0),
	gs_Nin_LoadTextureImage(TI_Diord01_txt,G_IM_FMT_RGBA,G_IM_SIZ_16b,16,16,0,7),


	gsSPVertex(&TI_Enemytank_Body_v[44],4,0),
	gsSP1Quadrangle(0, 3, 1, 2, 0),
	gs_Nin_LoadTextureImage(TI_Catapira01_txt,G_IM_FMT_RGBA,G_IM_SIZ_16b,16,16,0,7),


	gsSPVertex(&TI_Enemytank_Body_v[48],14,0),
	gsSP2Triangles(0, 1, 2, 0, 1, 3, 2, 0),
	gsSP2Triangles(4, 5, 6, 0, 7, 8, 9, 0),
	gsSP2Triangles(7, 9, 10, 0, 11, 12, 13, 0),
	gs_Nin_LoadTextureImage(TI_Catapira02_txt,G_IM_FMT_RGBA,G_IM_SIZ_16b,16,16,0,7),

	gsSPVertex(&TI_Enemytank_Body_v[62],8,0),
	gsSP1Quadrangle(0, 1, 2, 3, 0),
	gsSP1Quadrangle(4, 5, 6, 7, 0),
	gsSPEndDisplayList(),
}; /* TI_Enemytank */ 

#undef G_CC_PRIMSHADE

#undef gs_Nin_LoadTextureImage

#undef gs_Nin_SetUpTileDescrip

/* 69 vertices */
Vtx TI_Enemytank_Body_v[]={
	{    42,    26,    23,     0,  -249,   339,    36,    27,   110,   255},	/* 0 */
	{    11,   -27,    57,     0,    42,   657,    67,    15,    98,   255},	/* 1 */
	{    61,   -87,    27,     0,   522,   324,    30,     9,   115,   255},	/* 2 */
	{    42,    26,    23,     0,  -249,   339,    36,    27,   110,   255},	/* 3 */
	{    61,   -87,    27,     0,   522,   324,    30,     9,   115,   255},	/* 4 */
	{   119,    -5,    21,     0,    86,  -260,    24,    54,   103,   255},	/* 5 */
	{    39,   -57,    48,     0,   297,   -86,   120,    -8,     0,   255},	/* 6 */
	{    39,    41,    32,     0,   131,   470,   112,     2,   -42,   255},	/* 7 */
	{    39,    41,    57,     0,   327,   461,   100,    17,    64,   255},	/* 8 */
	{    39,    41,   -57,     0,   327,   461,   100,    17,   -65,   255},	/* 9 */
	{    39,    41,   -32,     0,   131,   470,   112,     2,    41,   255},	/* 10 */
	{    39,   -57,   -48,     0,   297,   -86,   120,    -8,     0,   255},	/* 11 */
	{    11,   -27,    57,     0,   162,   468,  -103,    60,     0,   255},	/* 12 */
	{    42,    26,    -4,     0,   350,   213,   -34,   103,   -51,   255},	/* 13 */
	{    11,   -27,   -44,     0,   162,    20,  -103,    60,     0,   255},	/* 14 */
	{    42,    26,    23,     0,   350,   357,  -103,    60,     0,   255},	/* 15 */
	{    57,   -87,   -43,     0,  -401,   458,    32,    30,  -112,   255},	/* 16 */
	{    11,   -27,   -44,     0,   100,   644,    28,    42,  -109,   255},	/* 17 */
	{   119,    -5,    -3,     0,   111,   -19,    33,    54,  -102,   255},	/* 18 */
	{    39,    41,    57,     0,  -393,   438,   100,    17,    64,   255},	/* 19 */
	{    19,   -68,    72,     0,   311,   492,    22,     2,   117,   255},	/* 20 */
	{    39,   -57,    48,     0,   238,   438,   120,    -8,     0,   255},	/* 21 */
	{    19,    66,    66,     0,  -552,   492,    56,     5,   105,   255},	/* 22 */
	{    19,   -68,   -72,     0,   311,   492,    22,     2,  -118,   255},	/* 23 */
	{    39,    41,   -57,     0,  -393,   438,   100,    17,   -65,   255},	/* 24 */
	{    39,   -57,   -48,     0,   238,   438,   120,    -8,     0,   255},	/* 25 */
	{    19,    66,   -66,     0,  -552,   492,    36,    20,  -113,   255},	/* 26 */
	{    19,    66,    32,     0,     0,   529,    57,   105,     0,   255},	/* 27 */
	{    19,    66,    66,     0,   507,   529,   -21,    73,    92,   255},	/* 28 */
	{    39,    41,    57,     0,   365,   139,   100,    17,    64,   255},	/* 29 */
	{    39,    41,    32,     0,     0,   139,   112,     2,   -42,   255},	/* 30 */
	{    42,    26,    -4,     0,   445,   409,   -34,   103,   -51,   255},	/* 31 */
	{    39,    41,   -57,     0,   365,   139,   100,    17,   -65,   255},	/* 32 */
	{    19,    66,   -66,     0,   507,   529,    36,    20,  -113,   255},	/* 33 */
	{    19,    66,   -32,     0,     0,   529,    57,   105,     0,   255},	/* 34 */
	{    39,    41,   -32,     0,     0,   139,   112,     2,    41,   255},	/* 35 */
	{    39,    41,   -32,     0,    15,   425,   112,     2,    41,   255},	/* 36 */
	{    19,    66,   -32,     0,  -180,   498,     0,     0,   119,   255},	/* 37 */
	{     0,   -51,   -32,     0,   888,   498,    36,    -6,   113,   255},	/* 38 */
	{    39,   -57,   -48,     0,   798,   425,   120,    -8,     0,   255},	/* 39 */
	{     0,   -51,    32,     0,   888,   498,    36,    -6,  -114,   255},	/* 40 */
	{    19,    66,    32,     0,  -180,   498,     0,     0,  -120,   255},	/* 41 */
	{    39,    41,    32,     0,    15,   425,   112,     2,   -42,   255},	/* 42 */
	{    39,   -57,    48,     0,   798,   425,   120,    -8,     0,   255},	/* 43 */
	{    42,    26,    -4,     0,    93,   542,   -34,   103,   -51,   255},	/* 44 */
	{   119,    -5,    21,     0,   382,   -91,    24,    54,   103,   255},	/* 45 */
	{   119,    -5,    -3,     0,   100,   -91,    33,    54,  -102,   255},	/* 46 */
	{    42,    26,    23,     0,   402,   542,    36,    27,   110,   255},	/* 47 */
	{     0,   -51,   -62,     0,  1837,   484,   -55,     0,  -106,   255},	/* 48 */
	{     0,    53,   -62,     0,   180,   485,   -48,    16,  -108,   255},	/* 49 */
	{    19,   -68,   -72,     0,  2108,   214,    22,     2,  -118,   255},	/* 50 */
	{    19,    66,   -66,     0,   -30,   214,    36,    20,  -113,   255},	/* 51 */
	{     0,   -51,    32,     0,  1837,   484,     0,     0,  -120,   255},	/* 52 */
	{     0,    53,    32,     0,   180,   485,     0,     0,  -120,   255},	/* 53 */
	{    19,    66,    32,     0,   -30,   214,     0,     0,  -120,   255},	/* 54 */
	{    19,   -68,    72,     0,  2108,   214,    22,     2,   117,   255},	/* 55 */
	{    19,    66,    66,     0,   -30,   214,   -21,    73,    92,   255},	/* 56 */
	{     0,    53,    62,     0,   180,   485,   -48,    16,   107,   255},	/* 57 */
	{     0,   -51,    62,     0,  1837,   484,   -55,     0,   105,   255},	/* 58 */
	{    19,    66,   -32,     0,   -30,   214,     0,     0,   119,   255},	/* 59 */
	{     0,    53,   -32,     0,   180,   485,     0,     0,   119,   255},	/* 60 */
	{     0,   -51,   -32,     0,  1837,   484,     0,     0,   119,   255},	/* 61 */
	{    19,    66,    66,     0,   508,  -531,   -21,    73,    92,   255},	/* 62 */
	{    19,    66,    32,     0,    51,  -531,    57,   105,     0,   255},	/* 63 */
	{     0,    53,    32,     0,    51,   512,   -68,    98,     0,   255},	/* 64 */
	{     0,    53,    62,     0,   456,   512,   -48,    16,   107,   255},	/* 65 */
	{    19,    66,   -66,     0,   508,  -531,   -68,    98,     0,   255},	/* 66 */
	{     0,    53,   -62,     0,   456,   512,   -48,    16,  -108,   255},	/* 67 */
	{     0,    53,   -32,     0,    51,   512,   -68,    98,     0,   255},	/* 68 */
	{    19,    66,   -32,     0,    51,  -531,    57,   105,     0,   255},	/* 69 */
};


/*   0 vertices */
/*   2 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_Catapira01_txt[] = {
	0x1107, 0x1, 0x63dd, 0x1949, 0x883, 0x41, 0x1, 0x1, 0x1, 0x1, 0x1, 0x883, 0x1949, 0x63dd, 0x1, 0x2189, 
	0x1, 0x31cd, 0x5b9b, 0x43, 0x63dd, 0x1, 0x41, 0x1105, 0x1107, 0x43, 0x1, 0x63dd, 0x41, 0x4ad5, 0x2149, 0x1, 
	0x63dd, 0x7c61, 0x43, 0x1, 0x1, 0x29cd, 0x5b59, 0x6bdd, 0x5b9b, 0x3a93, 0x29cd, 0x1, 0x1, 0x43, 0x3a51, 0x63dd, 
	0x1949, 0x43, 0x1, 0x1, 0x3a0f, 0x5317, 0x1149, 0x1, 0x41, 0x8c5, 0x1949, 0x298b, 0x41, 0x1, 0x83, 0x1949, 
	0x1, 0x63dd, 0x1, 0x639b, 0x4ad3, 0x43, 0x1, 0x1949, 0x1949, 0x1, 0x41, 0x218b, 0x2149, 0x1, 0x63dd, 0x1, 
	0x1, 0x1083, 0x1947, 0x7c61, 0x83, 0x1, 0x84a3, 0xae2d, 0x5359, 0x29cd, 0x1, 0x41, 0x298b, 0x10c5, 0x1, 0x298b, 
	0x1, 0x41, 0x7461, 0x198b, 0x1, 0x6bdd, 0xada9, 0x424f, 0x18c5, 0x29cd, 0x29cd, 0x1, 0x10c5, 0x5317, 0x43, 0x1, 
	0x1, 0x1107, 0x6c1f, 0x1, 0x1949, 0xa567, 0x2147, 0x31cd, 0x1, 0x18c5, 0x639b, 0x41, 0x1, 0x7c61, 0x1107, 0x1, 
	0x1, 0x1949, 0x5b59, 0x1, 0x1949, 0x6399, 0x1, 0x881, 0x318b, 0x4a51, 0xaded, 0x8c5, 0x1905, 0xa5a9, 0x1107, 0x1, 
	0x1, 0x43, 0x4293, 0x83, 0x1, 0x320f, 0x1907, 0x8c5, 0x5b57, 0xb5a9, 0x5b59, 0x1, 0x4251, 0x7c61, 0x41, 0x1, 
	0x41, 0x1, 0x2149, 0x218b, 0x83, 0x1, 0x29cd, 0x9da9, 0x9d67, 0x4ad3, 0x1, 0x298b, 0xb62f, 0x4a95, 0x1, 0x41, 
	0x41, 0x63dd, 0x883, 0x320f, 0x1949, 0x41, 0x1, 0x1, 0x41, 0x1, 0x2149, 0xc66f, 0x6b9b, 0x1, 0x63dd, 0x1, 
	0x1949, 0x43, 0x1, 0x1905, 0x3a51, 0x320f, 0x1949, 0x883, 0x8c5, 0x5315, 0xb5eb, 0x639b, 0x1949, 0x1, 0x43, 0x8c3, 
	0x4b17, 0x2a0f, 0x43, 0x1, 0x883, 0x218b, 0x4b17, 0x5b59, 0x7ca3, 0x6bdd, 0x320f, 0x41, 0x1, 0x8c5, 0x6bdd, 0x63dd, 
	0x1, 0x10c5, 0x2a0f, 0x43, 0x63dd, 0x1, 0x41, 0x1149, 0x1949, 0x41, 0x1, 0x63dd, 0x43, 0x84a5, 0x31cd, 0x1, 
	0x2189, 0x1, 0x63dd, 0x1949, 0x41, 0x41, 0x41, 0x1, 0x1, 0x881, 0x881, 0x883, 0x10c5, 0x63dd, 0x1, 0x5317, 
};

/* 16 x 16  G_IM_SIZ_16b G_IM_FMT_RGBA  */
unsigned short TI_Duct01_txt[] = {
	0x520b, 0x4a0b, 0x41cb, 0x49cb, 0x4a0b, 0x520b, 0x4a0b, 0x4189, 0x41c9, 0x49cb, 0x4989, 0x4989, 0x49c9, 0x4189, 0x49cb, 0x49cb, 
	0x520b, 0x4a0b, 0x49cb, 0x41c9, 0x49cb, 0x520b, 0x4a0b, 0x3989, 0x41c9, 0x41c9, 0x49cb, 0x4189, 0x4189, 0x4189, 0x41c9, 0x520b, 
	0x520b, 0x49cb, 0x49cb, 0x4189, 0x49cb, 0x520b, 0x520b, 0x4189, 0x4a0b, 0x41c9, 0x51cb, 0x4189, 0x41cb, 0x49cb, 0x49cb, 0x520b, 
	0x49cb, 0x49cb, 0x4a0b, 0x4189, 0x49cb, 0x51cb, 0x620b, 0x620d, 0x5a0b, 0x59cb, 0x51c9, 0x4189, 0x41cb, 0x49cb, 0x49c9, 0x520b, 
	0x49cb, 0x4189, 0x49cb, 0x4189, 0x41c9, 0x1905, 0x18c5, 0x2905, 0x2905, 0x2105, 0x18c5, 0x4189, 0x4a0b, 0x41cb, 0x49c9, 0x49cb, 
	0x49c9, 0x4189, 0x49cb, 0x49cb, 0x49cb, 0x4989, 0x61cb, 0x59cb, 0x6a4d, 0x620d, 0x5a0b, 0x51cb, 0x41cb, 0x41cb, 0x4189, 0x49cb, 
	0x41c9, 0x41c9, 0x41cb, 0x4189, 0x49cb, 0x10c3, 0x18c5, 0x28c5, 0x20c3, 0x2105, 0x2105, 0x4189, 0x49cb, 0x41c9, 0x4189, 0x4189, 
	0x4189, 0x41cb, 0x4189, 0x4189, 0x49cb, 0x4989, 0x620b, 0x620d, 0x59cb, 0x6a4d, 0x5a0b, 0x49c9, 0x49cb, 0x41c9, 0x4189, 0x49c9, 
	0x41c9, 0x4189, 0x4189, 0x4189, 0x41cb, 0x1905, 0x18c5, 0x1883, 0x2905, 0x2105, 0x2105, 0x49c9, 0x520b, 0x4189, 0x4189, 0x49cb, 
	0x41c9, 0x49cb, 0x49cb, 0x4189, 0x520b, 0x51cb, 0x5189, 0x4949, 0x59cb, 0x61cb, 0x5a0b, 0x49c9, 0x51cb, 0x4189, 0x4189, 0x49cb, 
	0x41c9, 0x49cb, 0x49cb, 0x49cb, 0x51cb, 0x18c5, 0x18c5, 0x28c5, 0x2905, 0x2105, 0x2105, 0x51cb, 0x49cb, 0x4189, 0x4189, 0x49cb, 
	0x41c9, 0x4a0b, 0x49cb, 0x49cb, 0x5a0b, 0x5a0b, 0x620d, 0x620d, 0x6a4d, 0x620d, 0x5a0b, 0x520b, 0x49cb, 0x4189, 0x4189, 0x49cb, 
	0x41c9, 0x520b, 0x41cb, 0x49cb, 0x520b, 0x1083, 0x2105, 0x28c5, 0x28c5, 0x2105, 0x18c3, 0x49cb, 0x41c9, 0x41c9, 0x49cb, 0x51cb, 
	0x49cb, 0x520b, 0x4189, 0x49cb, 0x4a0b, 0x3989, 0x520b, 0x41c9, 0x49cb, 0x520b, 0x4189, 0x49c9, 0x49cb, 0x4189, 0x49cb, 0x520b, 
	0x49cb, 0x49cb, 0x41cb, 0x49cb, 0x4a0b, 0x41c9, 0x41cb, 0x3989, 0x41c9, 0x49cb, 0x4189, 0x4989, 0x49cb, 0x41c9, 0x49cb, 0x520b, 
	0x49cb, 0x4a0b, 0x41c9, 0x41c9, 0x4a0b, 0x41cb, 0x4a0b, 0x4189, 0x49c9, 0x49c9, 0x4989, 0x51c9, 0x49c9, 0x4989, 0x4189, 0x51cb, 
};

