#include<ultra64.h>

extern Vtx ZO_ebi_head_v[];

extern unsigned short ZO_serpent_TX13_txt[];
extern unsigned short ZO_serpent_TX19_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_head_[]={

	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_head_v[0],6,0),
	gsSP2Triangles(0, 1, 2, 0, 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_head_v[6],12,0),
	gsSP2Triangles(0, 1, 2, 0, 3, 4, 5, 0),
	gsSP2Triangles(6, 7, 8, 0, 9, 10, 11, 0),
	gs_Nin_SetUpTileDescrip(G_IM_FMT_RGBA,G_IM_SIZ_16b,16,16,0,0,G_TX_CLAMP,4,0,G_TX_CLAMP,4,0),
	gs_Nin_LoadTextureImage(ZO_serpent_TX19_txt,G_IM_FMT_RGBA,G_IM_SIZ_16b,16,16,0,7),

	gsSPVertex(&ZO_ebi_head_v[18],5,0),
	gsSP2Triangles(0, 1, 2, 0, 3, 4, 0, 0),
	gsSPEndDisplayList(),
}; /* DXFdata */ 

#undef G_CC_PRIMSHADE

#undef gs_Nin_LoadTextureImage

#undef gs_Nin_SetUpTileDescrip

/* 24 vertices */
Vtx ZO_ebi_head_v[]={
	{    16,     0,   -19,     0,   511,   527,   -29,   -80,   -83,   255},	/* 0 */
	{    16,   -19,     0,     0,   510,     7,    20,  -103,   -57,   255},	/* 1 */
	{   -37,     0,     0,     0,    45,   298,   -29,   -80,   -83,   255},	/* 2 */
	{   -37,     0,     0,     0,    45,   298,   -72,    67,    67,   255},	/* 3 */
	{    16,    19,     0,     0,   510,     7,   -16,   117,   -21,   255},	/* 4 */
	{    16,     0,   -19,     0,   511,   527,    20,    55,  -105,   255},	/* 5 */
	{    16,   -19,     0,     0,     0,   512,    20,  -103,   -57,   255},	/* 6 */
	{    16,     0,   -19,     0,   512,   512,    20,    55,  -105,   255},	/* 7 */
	{    39,     0,     0,     0,   261,     2,   104,   -41,   -43,   255},	/* 8 */
	{    39,     0,     0,     0,   256,   -11,   104,   -41,   -43,   255},	/* 9 */
	{    16,     0,   -19,     0,     0,   512,    20,    55,  -105,   255},	/* 10 */
	{    16,    19,     0,     0,   525,   511,   -16,   117,   -21,   255},	/* 11 */
	{    16,    19,     0,     0,     0,   512,    60,    73,    73,   255},	/* 12 */
	{    16,     0,    19,     0,   512,   512,    20,   -54,   104,   255},	/* 13 */
	{    39,     0,     0,     0,   260,     1,    60,    73,    73,   255},	/* 14 */
	{    39,     0,     0,     0,   251,     1,   104,   -41,   -43,   255},	/* 15 */
	{    16,     0,    19,     0,     0,   512,    20,   -54,   104,   255},	/* 16 */
	{    16,   -19,     0,     0,   512,   512,    20,  -103,   -57,   255},	/* 17 */
	{   -37,     0,     0,     0,  -652,   419,   -72,    67,    67,   255},	/* 18 */
	{    16,     0,    19,     0,   453,  -104,   -28,    81,    82,   255},	/* 19 */
	{    16,    19,     0,     0,   575,   486,   -16,   117,   -21,   255},	/* 20 */
	{    16,   -19,     0,     0,   575,   486,   -28,   -80,    82,   255},	/* 21 */
	{    16,     0,    19,     0,   453,  -104,    20,   -54,   104,   255},	/* 22 */
};


/*   0 vertices */
/*   1 Materials */

#define	LDIRX	0
#define	LDIRY	0
#define	LDIRZ	120
#define	AMBDIV	1
/* 16 x 16  G_IM_SIZ_16b G_IM_FMT_RGBA  */
unsigned short ZO_tori_TX05_txt[] = {
	0x1, 0x1, 0x801, 0x1, 0x1, 0x1, 0x1, 0x801, 0x1, 0x1, 0x801, 0x1, 0x801, 0x801, 0x801, 0x801, 
	0x801, 0x1001, 0x801, 0x801, 0x1, 0x1001, 0x1, 0x801, 0x1, 0x801, 0x1, 0x1001, 0x1, 0x1001, 0x1001, 0x1001, 
	0x1, 0x1801, 0x1, 0x801, 0x801, 0x1, 0x801, 0x801, 0x801, 0x1801, 0x801, 0x1001, 0x1001, 0x1801, 0x1001, 0x1841, 
	0x3041, 0x1801, 0x2001, 0x1001, 0x1001, 0x1, 0x1001, 0x1, 0x1001, 0x1, 0x1801, 0x1, 0x2001, 0x1001, 0x2041, 0x2841, 
	0x801, 0x801, 0x1801, 0x1, 0x1801, 0x1801, 0x2001, 0x1001, 0x2001, 0x1, 0x1801, 0x801, 0x2001, 0x1001, 0x2841, 0x801, 
	0x3841, 0x3041, 0x1801, 0x2001, 0x2001, 0x1001, 0x1, 0x801, 0x801, 0x1001, 0x801, 0x801, 0x801, 0x1801, 0x3041, 0x3041, 
	0x1801, 0x801, 0x1001, 0x801, 0x2001, 0x1801, 0x2841, 0x2041, 0x1, 0x2841, 0x1, 0x2841, 0x1001, 0x3041, 0x801, 0x2041, 
	0x2841, 0x4041, 0x3841, 0x1801, 0x3841, 0x1, 0x1001, 0x801, 0x1841, 0x1841, 0x1, 0x2041, 0x801, 0x3881, 0x2841, 0x4881, 
	0x1801, 0x2841, 0x1, 0x4881, 0x1841, 0x3881, 0x30c3, 0x1001, 0x801, 0x801, 0x2041, 0x2083, 0x4105, 0x2041, 0x2041, 0x3881, 
	0x50c1, 0x50c1, 0x4901, 0x5143, 0x1, 0x2905, 0x1, 0x2083, 0x841, 0x1041, 0x2883, 0x1883, 0x5147, 0x38c3, 0x6143, 0x3881, 
	0x38c1, 0x1841, 0x5183, 0x3145, 0x49c7, 0x4a0b, 0x3147, 0x28c5, 0x2907, 0x2905, 0x1883, 0x628f, 0x20c5, 0x4147, 0x6987, 0x2881, 
	0x6203, 0x6203, 0x5a8b, 0x2105, 0x4a8f, 0x843, 0x5b0f, 0x20c5, 0x2107, 0x39cb, 0x5a4f, 0x420d, 0x62d1, 0x41cb, 0x4147, 0x4103, 
	0x2901, 0x62c7, 0x6393, 0x5353, 0x5311, 0x6395, 0x4ad1, 0x4a4d, 0x7bdd, 0x31cd, 0x7397, 0x2107, 0x6355, 0x4a51, 0x6313, 0x624b, 
	0x62c5, 0x6b4d, 0x4ad1, 0x8d23, 0x4ad3, 0x7d25, 0x5b59, 0x9523, 0x6b9b, 0xa5a9, 0x8ce3, 0x9525, 0x7c5f, 0x5315, 0x845b, 0x7351, 
	0x5b09, 0x7c57, 0x9523, 0xadeb, 0xc6b3, 0x298b, 0xbef5, 0x1909, 0xd6f7, 0x7c21, 0xa56b, 0xb62f, 0xcef5, 0xb671, 0x9d65, 0x52d3, 
	0xa5a7, 0xa5e9, 0xa5eb, 0x298b, 0xffff, 0xbe31, 0xc737, 0x8ca3, 0xffff, 0x39cf, 0xd737, 0x7c61, 0xffff, 0xbe2f, 0xb62f, 0xadeb, 
};

/* 16 x 16  G_IM_SIZ_16b G_IM_FMT_RGBA  */
unsigned short ZO_serpent_TX19_txt[] = {
	0x81c7, 0x81c7, 0x9209, 0x9249, 0x7983, 0x8a07, 0x9a8b, 0x7181, 0x40c3, 0xbb97, 0xdce1, 0xdce1, 0xe569, 0xff35, 0xc461, 0xffff, 
	0x9a8d, 0x928d, 0x928f, 0x928f, 0x9311, 0xab95, 0xb417, 0xc45d, 0xc49f, 0xd523, 0xe5a7, 0xfe2b, 0x3843, 0xffff, 0xfeb3, 0xffff, 
	0xb201, 0xc241, 0x6147, 0xa24b, 0x8a09, 0x9249, 0x8207, 0x49c9, 0x8355, 0xa3d9, 0xa41b, 0xb49f, 0xfe2b, 0xe5e9, 0x4105, 0xedeb, 
	0xb201, 0xba01, 0xba47, 0xb249, 0x1001, 0xa20b, 0x61cf, 0x6ad5, 0x6acf, 0x5187, 0x4145, 0x8b95, 0x9c19, 0xa45d, 0xac5d, 0xb4a1, 
	0x9141, 0x9141, 0x5905, 0x7989, 0x8185, 0x8299, 0xf637, 0xffbf, 0xf62b, 0xb453, 0x6a47, 0x4985, 0x6b13, 0x7b57, 0x5ad1, 0x7b57, 
	0x78c1, 0x7901, 0x7901, 0x8983, 0x4149, 0xdd73, 0xffff, 0xffff, 0xfffb, 0xf5db, 0xbc0b, 0x69c3, 0x39cd, 0x4a4f, 0x2a4f, 0x5291, 
	0x6841, 0x60c1, 0x60c1, 0x6901, 0x390d, 0xf631, 0xffff, 0xffff, 0xffb3, 0xfdd7, 0xd449, 0x9ac3, 0x6a0d, 0x524d, 0x2a0f, 0x31cb, 
	0x6041, 0x6041, 0x5041, 0x5081, 0x4107, 0xccdd, 0xff31, 0xff71, 0xfe61, 0xf551, 0xd447, 0xaac1, 0x5189, 0x5985, 0x4a09, 0x5145, 
	0x4001, 0x5801, 0x4801, 0x6145, 0x1043, 0x8acb, 0xdc93, 0xf557, 0xed11, 0xdc89, 0xc383, 0x9201, 0x40c1, 0x4901, 0x4141, 0x50c1, 
	0x5001, 0x4001, 0x3801, 0x4841, 0x3881, 0x4941, 0x9ac5, 0xc3c9, 0xcbc7, 0xbb43, 0xa281, 0x50c1, 0x2841, 0x40c1, 0x3081, 0x2841, 
	0x3001, 0x3801, 0x4001, 0x4801, 0x4801, 0x4041, 0x5941, 0x7a01, 0x9241, 0x81c1, 0x48c1, 0x1801, 0x1001, 0x2841, 0x2801, 0x1, 
	0x1001, 0x2001, 0x4001, 0x4801, 0x1801, 0x4801, 0x4801, 0x3841, 0x3041, 0x2801, 0x1801, 0x801, 0x801, 0x801, 0x1001, 0x1001, 
	0x1, 0x801, 0x2001, 0x2801, 0x3801, 0x2801, 0x3801, 0x2801, 0x1801, 0x1001, 0x801, 0x1, 0x1, 0x1, 0x1, 0x1, 
	0x1001, 0x801, 0x1001, 0x2001, 0x2801, 0x2801, 0x2001, 0x1801, 0x1001, 0x801, 0x801, 0x1, 0x1, 0x1, 0x1, 0x1, 
	0x801, 0x1001, 0x1801, 0x2801, 0x2001, 0x1001, 0x1001, 0x1801, 0x801, 0x1001, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 
	0x3001, 0x2001, 0x3801, 0x3801, 0x3001, 0x3801, 0x2001, 0x3001, 0x1001, 0x2801, 0x801, 0x801, 0x1, 0x1001, 0x801, 0x1, 
};


