#include<ultra64.h>

extern Vtx MC_BossTAKO_Kagizume_v[];

extern unsigned char MC_BossFaceTX_CI8_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 */


/* ======== kagizume ======== */

Gfx MC_BossTAKO_Kagizume[]={

	gsDPLoadTLUT_pal256(&MC_BossFaceTX_CI8_txt[1024]),
	gsDPLoadTextureBlock(MC_BossFaceTX_CI8_txt,G_IM_FMT_CI,G_IM_SIZ_8b,32,32,0,G_TX_WRAP,G_TX_WRAP,5,5,0,0),
	gsDPSetTextureLUT(G_TT_RGBA16),

	gsSPVertex(&MC_BossTAKO_Kagizume_v[0], 14, 0),
	gsSP1Triangle(0, 1, 2, 0),
	gsSP1Triangle(3, 0, 4, 0),
	gsSP1Triangle(1, 0, 3, 0),
	gsSP1Triangle(3, 5, 1, 0),
	gsSP1Triangle(5, 3, 4, 0),
	gsSP1Triangle(6, 7, 8, 0),
	gsSP1Triangle(9, 10, 11, 0),
	gsSP1Triangle(9, 11, 12, 0),
	gsSP1Triangle(12, 13, 9, 0),
	gsSPVertex(&MC_BossTAKO_Kagizume_v[10], 2, 0),
	gsSPVertex(&MC_BossTAKO_Kagizume_v[14], 5, 2),
	gsSP1Triangle(2, 1, 0, 0),
	gsSP1Triangle(3, 5, 6, 0),
	gsSP1Triangle(4, 6, 5, 0),
	gsDPPipeSync(),
        gsDPSetTextureLUT(G_TT_NONE),
	gsSPEndDisplayList(),
}; /* kagizume */ 

#undef G_CC_PRIMSHADE

#undef gs_Nin_LoadTextureImage

#undef gs_Nin_SetUpTileDescrip

/* 19 vertices */
Vtx MC_BossTAKO_Kagizume_v[]={
	{ 60,-10,15,0, 639, 378, 81,59,65,255 },   /* v0 used p210/V1 6 times */
	{ 20,10,-25,0, 298, 696, 57,102,-26,255 },   /* v1 used p210/V2 3 times */
	{ 20,10,25,0, 725, 696, 58,97,38,255 },   /* v2 used p210/V3 2 times */
	{ 60,-10,-15,0, 383, 378, 81,35,-81,255 },   /* v3 used p211/V1 4 times */
	{ 90,-95,0,0, 511, -337, 80,-60,-66,255 },   /* v4 used p211/V3 4 times */
	{ 20,-10,-25,0, 298, 559, -45,-1,-111,255 },   /* v5 used p234/V1 2 times */
	{ 90,-95,0,0, 0, 697, 80,-60,-66,255 },   /* v6 used p239/V1 2 times */
	{ 15,-110,25,0, 393, -48, 24,-117,0,255 },   /* v7 used p239/V2 2 times */
	{ 15,-110,-25,0, -393, -48, 24,-117,0,255 },   /* v8 used p239/V3 2 times */
	{ 20,-10,25,0, 1535, -73, -119,6,0,255 },   /* v9 used p366/V1 4 times */
	{ 20,-10,-25,0, 512, -73, -119,6,0,255 },   /* v10 used p366/V2 4 times */
	{ 15,-110,-25,0, 511, 1024, -113,6,-37,255 },   /* v11 used p366/V3 4 times */
	{ 15,-110,25,0, 1535, 1024, -113,6,36,255 },   /* v12 used p366/V4 4 times */
	{ 45,-90,65,0, 2047, 1024, -96,5,69,255 },   /* v13 used p365/V2 2 times */
	{ 45,-90,-65,0, 0, 1024, -96,5,-70,255 },   /* v14 used p364/V1 2 times */
	{ 90,-95,0,0, 511, -337, 29,-9,115,255 },   /* v15 used p354/V1 2 times */
	{ 20,10,25,0, 725, 696, 58,97,38,255 },   /* v16 used p353/V1 2 times */
	{ 60,-10,15,0, 639, 378, 81,59,65,255 },   /* v17 used p354/V2 4 times */
	{ 20,-10,25,0, 725, 559, -45,-1,110,255 },   /* v18 used p354/V3 4 times */
};


/*   0 vertices */
/*   1 Materials */

#define	LDIRX	0
#define	LDIRY	0
#define	LDIRZ	120
#define	AMBDIV	1
