#include<ultra64.h>

extern Vtx AC_protect_body_v[];

extern unsigned short AC_kabuto_TX_01_txt[];
extern unsigned short AC_protect_TX_02_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 */


/* ======== DXFdata ======== */

Gfx AC_protect_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(AC_kabuto_TX_01_txt,G_IM_FMT_RGBA,G_IM_SIZ_16b,16,16,0,7),


	gsSPVertex(&AC_protect_body_v[0],6,0),
	gsSP2Triangles(0, 1, 2, 0, 3, 4, 5, 0),
	gs_Nin_SetUpTileDescrip(G_IM_FMT_RGBA,G_IM_SIZ_16b,32,32,0,0,G_TX_WRAP,5,0,G_TX_WRAP,5,0),
	gs_Nin_LoadTextureImage(AC_protect_TX_02_txt,G_IM_FMT_RGBA,G_IM_SIZ_16b,32,32,0,7),

	gsSPVertex(&AC_protect_body_v[6],30,0),
	gsSP2Triangles(0, 1, 2, 0, 3, 1, 4, 0),
	gsSP2Triangles(5, 6, 7, 0, 8, 9, 10, 0),
	gsSP2Triangles(11, 12, 8, 0, 13, 14, 15, 0),
	gsSP2Triangles(15, 16, 13, 0, 17, 18, 19, 0),
	gsSP2Triangles(19, 18, 20, 0, 11, 21, 22, 0),
	gsSP2Triangles(23, 24, 25, 0, 26, 27, 28, 0),
	gsSP1Triangle(29, 21, 10, 0),
	gsSPVertex(&AC_protect_body_v[36],3,0),
	gsSP1Triangle(0, 1, 2, 0),
	gsSPEndDisplayList(),
}; /* DXFdata */ 

#undef G_CC_PRIMSHADE

#undef gs_Nin_LoadTextureImage

#undef gs_Nin_SetUpTileDescrip

/* 42 vertices */
Vtx AC_protect_body_v[]={
	{    10,    23,     0,     0,     0,   512,   -60,   103,     0,   255},	/* 0 */
	{   -13,   -17,     0,     0,   511,     0,   -86,   -82,     4,   255},	/* 1 */
	{     3,     0,    20,     0,   511,   512,   -51,    45,    97,   255},	/* 2 */
	{     3,     0,   -20,     0,   512,   511,   -53,    44,   -98,   255},	/* 3 */
	{   -13,   -17,     0,     0,   511,     0,  -100,    59,   -28,   255},	/* 4 */
	{    10,    23,     0,     0,     0,   511,   -60,   103,     0,   255},	/* 5 */
	{     3,     0,   -20,     0,  -415,  1274,   -53,    44,   -98,   255},	/* 6 */
	{    10,    23,     0,     0,   393,  1192,   -60,   103,     0,   255},	/* 7 */
	{    50,    23,   -16,     0,   299,    97,    38,    83,   -78,   255},	/* 8 */
	{    50,    24,    15,     0,   299,    97,    39,    84,    75,   255},	/* 9 */
	{     3,     0,    20,     0,  -415,  1274,   -51,    45,    97,   255},	/* 10 */
	{    45,   -20,   -38,     0,  1419,  1580,     6,   -35,  -114,   255},	/* 11 */
	{     3,     0,   -20,     0,     0,  1024,   -53,    44,   -98,   255},	/* 12 */
	{    50,    23,   -16,     0,  1309,    79,    38,    83,   -78,   255},	/* 13 */
	{   -13,   -17,     0,     0,   481,  2489,   -86,   -82,     4,   255},	/* 14 */
	{     3,     0,   -20,     0,   -96,  2130,   -53,    44,   -98,   255},	/* 15 */
	{    45,   -20,   -38,     0,     0,  1023,     6,   -35,  -114,   255},	/* 16 */
	{    45,   -20,    38,     0,     0,  1023,     8,   -33,   114,   255},	/* 17 */
	{     3,     0,    20,     0,   -96,  2130,   -51,    45,    97,   255},	/* 18 */
	{    43,   -56,     0,     0,  1186,  1258,   -29,  -112,    27,   255},	/* 19 */
	{    45,   -20,    38,     0,    70,   917,     8,   -33,   114,   255},	/* 20 */
	{   -13,   -17,     0,     0,   248,  2452,   -86,   -82,     4,   255},	/* 21 */
	{    45,   -20,   -38,     0,    70,   917,     6,   -35,  -114,   255},	/* 22 */
	{    45,   -20,   -38,     0,  1365,  1580,     6,   -35,  -114,   255},	/* 23 */
	{    84,   -20,    -1,     0,     0,  1024,   115,    17,   -28,   255},	/* 24 */
	{    43,   -56,     0,     0,  1203,   170,    65,   -74,   -68,   255},	/* 25 */
	{    45,   -20,    38,     0,  1365,  1580,     8,   -33,   114,   255},	/* 26 */
	{    84,   -20,    -1,     0,  -589,  -117,   115,    17,   -28,   255},	/* 27 */
	{    50,    24,    15,     0,   739,   125,    39,    84,    75,   255},	/* 28 */
	{    84,   -20,    -1,     0,  -693,  -697,   115,    17,   -28,   255},	/* 29 */
	{    50,    23,   -16,     0,    18,   688,    38,    83,   -78,   255},	/* 30 */
	{    50,    24,    15,     0,   627,   128,    39,    84,    75,   255},	/* 31 */
	{    50,    24,    15,     0,   326,   146,    39,    84,    75,   255},	/* 32 */
	{    50,    23,   -16,     0,   183,   784,    38,    83,   -78,   255},	/* 33 */
	{    10,    23,     0,     0,  1081,   653,   -60,   103,     0,   255},	/* 34 */
	{    50,    23,   -16,     0,   739,   125,    38,    83,   -78,   255},	/* 35 */
	{    50,    24,    15,     0,  1309,    79,    39,    84,    75,   255},	/* 36 */
	{     3,     0,    20,     0,     0,  1024,   -51,    45,    97,   255},	/* 37 */
	{    45,   -20,    38,     0,  1419,  1580,     8,   -33,   114,   255},	/* 38 */
};


/*   0 vertices */
/*   1 Materials */

#define	LDIRX	0
#define	LDIRY	0
#define	LDIRZ	120
#define	AMBDIV	1
