#include<ultra64.h>

extern Vtx AC_protect_head_v[];

extern unsigned short AC_ankou_TX_015_txt[];
extern unsigned short AC_kabuto_TX_01_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_head[]={

	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_ankou_TX_015_txt,G_IM_FMT_RGBA,G_IM_SIZ_16b,32,32,0,7),


	gsSPVertex(&AC_protect_head_v[0],22,0),
	gsSP2Triangles(0, 1, 2, 0, 3, 4, 5, 0),
	gsSP2Triangles(4, 6, 7, 0, 8, 3, 9, 0),
	gsSP2Triangles(10, 11, 12, 0, 9, 13, 14, 0),
	gsSP2Triangles(13, 15, 11, 0, 16, 17, 13, 0),
	gsSP2Triangles(1, 18, 19, 0, 20, 21, 18, 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(AC_kabuto_TX_01_txt,G_IM_FMT_RGBA,G_IM_SIZ_16b,16,16,0,7),

	gsSPVertex(&AC_protect_head_v[22],16,0),
	gsSP2Triangles(0, 1, 2, 0, 3, 4, 5, 0),
	gsSP2Triangles(6, 7, 4, 0, 5, 8, 3, 0),
	gsSP2Triangles(9, 10, 11, 0, 8, 12, 6, 0),
	gsSP1Triangle(13, 14, 15, 0),
	gsSPEndDisplayList(),
}; /* DXFdata */ 

#undef G_CC_PRIMSHADE

#undef gs_Nin_LoadTextureImage

#undef gs_Nin_SetUpTileDescrip

/* 51 vertices */
Vtx AC_protect_head_v[]={
	{    38,    -1,     0,     0,   509,   -16,   114,   -36,     0,   255},	/* 0 */
	{    35,    18,    -9,     0,     0,  1024,    56,    25,  -103,   255},	/* 1 */
	{    35,    18,     9,     0,  1024,  1024,    70,    11,    96,   255},	/* 2 */
	{    35,    18,     9,     0,     0,  1024,    70,    11,    96,   255},	/* 3 */
	{     4,     2,    15,     0,  1024,     0,     7,    30,   115,   255},	/* 4 */
	{    15,   -34,    16,     0,  1024,  1023,    68,   -18,    96,   255},	/* 5 */
	{    35,    18,     9,     0,     0,  1023,   -19,    74,    91,   255},	/* 6 */
	{    23,    26,     0,     0,  1024,  1023,  -117,    19,     0,   255},	/* 7 */
	{    23,    26,     0,     0,   514,   240,    73,    96,     0,   255},	/* 8 */
	{    35,    18,    -9,     0,  1024,  1024,    56,    25,  -103,   255},	/* 9 */
	{    38,    -1,     0,     0,     0,  1024,   114,   -36,     0,   255},	/* 10 */
	{    15,   -34,    16,     0,  1023,     0,    68,   -18,    96,   255},	/* 11 */
	{    17,   -41,     0,     0,  1023,  1024,   107,   -54,     0,   255},	/* 12 */
	{    38,    -1,     0,     0,     0,  1023,   114,   -36,     0,   255},	/* 13 */
	{    15,   -34,   -16,     0,  1024,     0,    68,   -18,   -97,   255},	/* 14 */
	{    35,    18,     9,     0,  1023,  1024,    70,    11,    96,   255},	/* 15 */
	{    17,   -41,     0,     0,  1023,  1023,   107,   -54,     0,   255},	/* 16 */
	{    15,   -34,   -16,     0,  1023,     0,    68,   -18,   -97,   255},	/* 17 */
	{     4,     2,   -15,     0,  1024,     0,     8,    29,  -116,   255},	/* 18 */
	{    23,    26,     0,     0,  1024,  1024,  -117,    19,     0,   255},	/* 19 */
	{    35,    18,    -9,     0,     0,  1023,    56,    25,  -103,   255},	/* 20 */
	{    15,   -34,   -16,     0,  1024,  1023,    68,   -18,   -97,   255},	/* 21 */
	{    12,     4,   -13,     0,   512,   512,   -29,    74,   -90,   255},	/* 22 */
	{     3,    16,     0,     0,   312,   199,   -29,    74,   -90,   255},	/* 23 */
	{    25,    25,     0,     0,     0,   512,   -29,    74,   -90,   255},	/* 24 */
	{    23,    26,     0,     0,     0,   512,  -117,    19,     0,   255},	/* 25 */
	{    15,   -34,   -16,     0,   512,     0,   -96,    -4,    69,   255},	/* 26 */
	{    17,   -41,     0,     0,   512,   512,  -118,    11,     0,   255},	/* 27 */
	{    23,    26,     0,     0,     0,   511,  -117,    19,     0,   255},	/* 28 */
	{     4,     2,   -15,     0,   512,   512,   -56,   -18,   103,   255},	/* 29 */
	{    15,   -34,    16,     0,   512,     0,   -96,    -4,   -70,   255},	/* 30 */
	{    12,     4,   -13,     0,     0,   512,   -93,   -74,     0,   255},	/* 31 */
	{    12,     4,    13,     0,   512,   512,   -93,   -74,     0,   255},	/* 32 */
	{     3,    16,     0,     0,   255,   211,   -93,   -74,     0,   255},	/* 33 */
	{     4,     2,    15,     0,   512,   512,   -56,   -18,  -104,   255},	/* 34 */
	{     3,    16,     0,     0,   312,   226,   -29,    74,    89,   255},	/* 35 */
	{    12,     4,    13,     0,   102,   503,   -29,    74,    89,   255},	/* 36 */
	{    25,    25,     0,     0,   605,   552,   -29,    74,    89,   255},	/* 37 */
};


/*   0 vertices */
/*   1 Materials */

#define	LDIRX	0
#define	LDIRY	0
#define	LDIRZ	120
#define	AMBDIV	1
