#include<ultra64.h>

extern Vtx AC_protect_tail_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 */



Gfx AC_protect_tail[]={

	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_tail_v[0], 9, 0),
	gsSP1Triangle(0, 1, 2, 0),
	gsSP1Triangle(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_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_tail_v[9], 3, 0),
	gsSP1Triangle(0, 1, 2, 0),
	gsSPEndDisplayList(),
};

#undef G_CC_PRIMSHADE

#undef gs_Nin_LoadTextureImage

#undef gs_Nin_SetUpTileDescrip

/* 12 vertices */
Vtx AC_protect_tail_v[]={
	{ 101,-19,-16,0, 1024, 1024, -3,58,-105,255 },   /* v0 used p2/V1 2 times */
	{ -38,0,0,0, 1024, 0, -3,58,-105,255 },   /* v1 used p2/V2 2 times */
	{ 117,12,0,0, 0, 1024, -3,58,-105,255 },   /* v2 used p2/V3 2 times */
	{ -38,0,0,0, 1024, 0, -3,58,104,255 },   /* v3 used p3/V1 2 times */
	{ 101,-19,16,0, 1024, 1024, -3,58,104,255 },   /* v4 used p3/V2 2 times */
	{ 117,12,0,0, 0, 1024, -3,58,104,255 },   /* v5 used p3/V3 2 times */
	{ 101,-19,16,0, 1024, 1024, 9,-119,0,255 },   /* v6 used p1/V1 2 times */
	{ -38,0,0,0, 511, 4, -15,-118,0,255 },   /* v7 used p1/V2 2 times */
	{ 101,-19,-16,0, 0, 1024, 9,-119,0,255 },   /* v8 used p1/V3 2 times */
	{ 117,12,0,0, 255, 1043, 108,-52,0,255 },   /* v9 used p4/V1 2 times */
	{ 101,-19,16,0, 511, 511, 9,-119,0,255 },   /* v10 used p4/V2 2 times */
	{ 101,-19,-16,0, 0, 511, 9,-119,0,255 },   /* v11 used p4/V3 2 times */
};


/*   0 vertices */
/*   1 Materials */

#define	LDIRX	0
#define	LDIRY	0
#define	LDIRZ	120
#define	AMBDIV	1
