#include<ultra64.h>

extern Vtx ZO_ebi_tail_v[];

extern unsigned short ZO_serpent_TX13_txt[];
extern unsigned short ZO_serpent_TX15_txt[];
extern unsigned short ZO_tori_TX05_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 ZO_ebi_tail[]={

	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(ZO_tori_TX05_txt,G_IM_FMT_RGBA,G_IM_SIZ_16b,16,16,0,7),

	gsSPVertex(&ZO_ebi_tail_v[0], 6, 0),
	gsSP1Triangle(0, 1, 2, 0),
	gsSP1Triangle(3, 4, 5, 0),

	gs_Nin_LoadTextureImage(ZO_serpent_TX13_txt,G_IM_FMT_RGBA,G_IM_SIZ_16b,16,16,0,7),

	gsSPVertex(&ZO_ebi_tail_v[6], 9, 0),
	gsSP1Triangle(0, 1, 2, 0),
	gsSP1Triangle(3, 4, 5, 0),
	gsSP1Triangle(6, 7, 8, 0),

	gs_Nin_LoadTextureImage(ZO_serpent_TX15_txt,G_IM_FMT_RGBA,G_IM_SIZ_16b,16,16,0,7),

	gsSPVertex(&ZO_ebi_tail_v[15], 3, 0),
	gsSP1Triangle(0, 1, 2, 0),
	gsSPEndDisplayList(),
}; /* DXFdata */ 

#undef G_CC_PRIMSHADE

#undef gs_Nin_LoadTextureImage

#undef gs_Nin_SetUpTileDescrip

/* 18 vertices */
Vtx ZO_ebi_tail_v[]={
	{ 2,9,-6,0, 511, 511, 0,97,69,255 },   /* v0 used p3/V1 2 times */
	{ 5,0,6,0, 417, 101, 0,97,69,255 },   /* v1 used p3/V2 2 times */
	{ 50,0,0,0, -187, 511, 9,98,67,255 },   /* v2 used p3/V3 2 times */
	{ 50,0,0,0, -187, 511, 9,-97,67,255 },   /* v3 used p7/V1 2 times */
	{ 5,0,6,0, 417, 101, 0,-96,69,255 },   /* v4 used p7/V2 2 times */
	{ 2,-9,-6,0, 511, 511, 0,-96,69,255 },   /* v5 used p7/V3 2 times */
	{ -14,0,-1,0, 255, 45, -42,0,-112,255 },   /* v6 used p6/V1 2 times */
	{ 2,9,-6,0, 0, 512, 1,0,-120,255 },   /* v7 used p6/V2 2 times */
	{ 2,-9,-6,0, 512, 512, 1,0,-120,255 },   /* v8 used p6/V3 2 times */
	{ 2,-9,-6,0, 0, 512, 0,-96,69,255 },   /* v9 used p5/V1 2 times */
	{ 5,0,6,0, 512, 512, 0,-96,69,255 },   /* v10 used p5/V2 2 times */
	{ -14,0,-1,0, 198, -59, -25,-90,72,255 },   /* v11 used p5/V3 2 times */
	{ -14,0,-1,0, 313, -59, -25,91,72,255 },   /* v12 used p4/V1 2 times */
	{ 5,0,6,0, 0, 512, 0,97,69,255 },   /* v13 used p4/V2 2 times */
	{ 2,9,-6,0, 512, 512, 0,97,69,255 },   /* v14 used p4/V3 2 times */
	{ 2,-9,-6,0, 0, 512, 1,0,-120,255 },   /* v15 used p8/V1 2 times */
	{ 2,9,-6,0, 512, 512, 1,0,-120,255 },   /* v16 used p8/V2 2 times */
	{ 50,0,0,0, 255, -888, 15,0,-119,255 },   /* v17 used p8/V3 2 times */
};


/*   0 vertices */
/*   1 Materials */

#define	LDIRX	0
#define	LDIRY	0
#define	LDIRZ	120
#define	AMBDIV	1
