#include<ultra64.h>

extern Vtx AC_kabuto_head_v[];

extern unsigned short AC_ika_TX_003_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_kabuto_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_ika_TX_003_txt,G_IM_FMT_RGBA,G_IM_SIZ_16b,32,32,0,7),

	gsSPVertex(&AC_kabuto_head_v[0], 13, 0),
	gsSP1Triangle(0, 1, 2, 0),
	gsSP1Triangle(2, 3, 0, 0),
	gsSP1Triangle(0, 3, 4, 0),
	gsSP1Triangle(3, 5, 4, 0),
	gsSP1Triangle(4, 6, 0, 0),
	gsSP1Triangle(6, 1, 0, 0),
	gsSP1Triangle(4, 7, 8, 0),
	gsSP1Triangle(4, 9, 10, 0),
	gsSP1Triangle(4, 10, 6, 0),
	gsSP1Triangle(8, 9, 4, 0),
	gsSP1Triangle(4, 5, 7, 0),
	gsSP1Triangle(8, 7, 11, 0),
	gsSP1Triangle(11, 12, 8, 0),
	gsSP1Triangle(8, 12, 9, 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_kabuto_head_v[13], 15, 0),
	gsSP1Triangle(0, 1, 2, 0),
	gsSP1Triangle(3, 4, 5, 0),
	gsSP1Triangle(6, 7, 8, 0),
	gsSP1Triangle(9, 10, 11, 0),
	gsSP1Triangle(12, 13, 14, 0),
	gsSPEndDisplayList(),
}; /* DXFdata */ 

#undef G_CC_PRIMSHADE

#undef gs_Nin_LoadTextureImage

#undef gs_Nin_SetUpTileDescrip

/* 28 vertices */
Vtx AC_kabuto_head_v[]={
	{ 16,-33,4,0, 1086, 628, -16,-90,75,255 },   /* v0 used p42/V3 5 times */
	{ 22,-46,-25,0, 1320, 428, -5,-109,47,255 },   /* v1 used p19/V2 4 times */
	{ 95,-29,-10,0, 1017, -765, 18,-93,72,255 },   /* v2 used p42/V1 2 times */
	{ 31,-11,17,0, 706, 423, 7,-60,102,255 },   /* v3 used p42/V2 3 times */
	{ -14,0,10,0, 511, 1165, -71,0,95,255 },   /* v4 used p41/V1 8 times */
	{ 26,0,24,0, 511, 537, 100,14,64,255 },   /* v5 used p41/V2 2 times */
	{ -10,-29,-24,0, 1023, 1024, -68,-83,50,255 },   /* v6 used p43/V2 3 times */
	{ 31,11,17,0, 317, 423, -2,64,100,255 },   /* v7 used p41/V3 3 times */
	{ 16,33,4,0, -62, 628, -16,91,75,255 },   /* v8 used p44/V1 5 times */
	{ -10,29,-24,0, 0, 1024, -68,84,50,255 },   /* v9 used p46/V2 3 times */
	{ -31,0,-15,0, 511, 1363, -98,0,66,255 },   /* v10 used p32/V2 4 times */
	{ 95,29,-10,0, 6, -765, 18,94,72,255 },   /* v11 used p44/V3 2 times */
	{ 22,46,-25,0, -296, 428, -5,110,47,255 },   /* v12 used p21/V2 4 times */
	{ 31,-11,17,0, 511, 0, 18,114,-33,255 },   /* v13 used p30/V1 2 times */
	{ 95,-29,-10,0, 512, 512, 18,114,-33,255 },   /* v14 used p30/V2 2 times */
	{ 48,-24,-21,0, 0, 511, 96,68,20,255 },   /* v15 used p30/V3 2 times */
	{ 31,11,17,0, 512, 512, 35,-111,-24,255 },   /* v16 used p29/V1 2 times */
	{ 26,0,24,0, 512, 0, 100,14,64,255 },   /* v17 used p29/V2 2 times */
	{ 48,25,-21,0, 0, 512, 96,-67,20,255 },   /* v18 used p29/V3 2 times */
	{ 26,0,24,0, 256, -10, 100,14,64,255 },   /* v19 used p24/V1 2 times */
	{ 48,-24,-21,0, 0, 512, 96,68,20,255 },   /* v20 used p24/V2 2 times */
	{ 48,25,-21,0, 512, 512, 96,-67,20,255 },   /* v21 used p24/V3 2 times */
	{ 26,0,24,0, 0, 512, 100,14,64,255 },   /* v22 used p28/V1 2 times */
	{ 31,-11,17,0, 511, 511, 7,-60,102,255 },   /* v23 used p28/V2 2 times */
	{ 48,-24,-21,0, 511, 0, 96,68,20,255 },   /* v24 used p28/V3 2 times */
	{ 31,11,17,0, 511, 0, 35,-111,-24,255 },   /* v25 used p31/V1 2 times */
	{ 48,25,-21,0, 0, 512, 96,-67,20,255 },   /* v26 used p31/V2 2 times */
	{ 95,29,-10,0, 512, 512, 18,-113,-33,255 },   /* v27 used p31/V3 2 times */
};


/*   0 vertices */
/*   1 Materials */

#define	LDIRX	0
#define	LDIRY	0
#define	LDIRZ	120
#define	AMBDIV	1
