#include<ultra64.h>

extern Vtx ZO_Boss_Rbarast_v[];
extern Vtx ZO_Boss_Rbarast_vmcur[];
extern Tri ZO_Boss_Rbarast_tri[];
extern Mtx ZO_Boss_Rbarast_matrix[];

extern unsigned short ZO_BossTEX01_txt[];
extern unsigned short ZO_BossTX02_txt[];
extern unsigned short ZO_BossTX06_txt[];
extern unsigned short ZO_BossTX08_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 */


/* ======== Rwing ======== */

Gfx ZO_Boss_Rbarast_[]={

	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(ZO_BossTX02_txt,G_IM_FMT_RGBA,G_IM_SIZ_16b,32,32,0,7),

	gsSPVertex(&ZO_Boss_Rbarast_v[0], 16, 0),
	gsSP1Triangle(0, 1, 2, 0),
	gsSP1Triangle(1, 3, 2, 0),
	gsSP1Triangle(4, 5, 6, 0),
	gsSP1Triangle(5, 7, 6, 0),
	gsSP1Triangle(8, 9, 10, 0),
	gsSP1Triangle(9, 11, 10, 0),
	gsSP1Triangle(12, 13, 14, 0),
	gsSP1Triangle(14, 15, 12, 0),
	gsSPVertex(&ZO_Boss_Rbarast_v[16], 7, 0),
	gsSP1Triangle(0, 3, 4, 0),
	gsSP1Triangle(1, 5, 2, 0),
	gsSP1Triangle(2, 6, 1, 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_BossTX06_txt,G_IM_FMT_RGBA,G_IM_SIZ_16b,16,16,0,7),

	gsSPVertex(&ZO_Boss_Rbarast_v[23], 4, 0),
	gsSP1Triangle(0, 1, 2, 0),
	gsSP1Triangle(0, 2, 3, 0),

	gs_Nin_SetUpTileDescrip(G_IM_FMT_RGBA,G_IM_SIZ_16b,16,16,0,0,G_TX_WRAP,4,0,G_TX_CLAMP,4,0),
	gs_Nin_LoadTextureImage(ZO_BossTX08_txt,G_IM_FMT_RGBA,G_IM_SIZ_16b,16,16,0,7),

	gsSPVertex(&ZO_Boss_Rbarast_v[27], 16, 0),
	gsSP1Triangle(0, 1, 2, 0),
	gsSP1Triangle(0, 3, 1, 0),
	gsSP1Triangle(4, 5, 6, 0),
	gsSP1Triangle(4, 7, 5, 0),
	gsSP1Triangle(8, 9, 10, 0),
	gsSP1Triangle(8, 10, 11, 0),
	gsSP1Triangle(12, 13, 14, 0),
	gsSP1Triangle(15, 12, 14, 0),

	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(ZO_BossTEX01_txt,G_IM_FMT_RGBA,G_IM_SIZ_16b,32,32,0,7),

	gsSPVertex(&ZO_Boss_Rbarast_v[43], 13, 0),
	gsSP1Triangle(0, 1, 2, 0),
	gsSP1Triangle(0, 3, 4, 0),
	gsSP1Triangle(0, 4, 5, 0),
	gsSP1Triangle(2, 3, 0, 0),
	gsSP1Triangle(5, 1, 0, 0),
	gsSP1Triangle(6, 5, 4, 0),
	gsSP1Triangle(7, 8, 9, 0),
	gsSP1Triangle(9, 8, 10, 0),
	gsSP1Triangle(10, 11, 9, 0),
	gsSP1Triangle(10, 12, 11, 0),
	gsSPEndDisplayList(),
}; /* Rwing */ 

#undef G_CC_PRIMSHADE

#undef gs_Nin_LoadTextureImage

#undef gs_Nin_SetUpTileDescrip

/* 56 vertices */
Vtx ZO_Boss_Rbarast_v[]={
	{ 63,-22,71,0, 757, 472, 98,-69,0,255 },   /* v0 used p1784/V1 1 times */
	{ 63,87,71,0, 757, 921, 86,84,0,255 },   /* v1 used p1785/V1 2 times */
	{ 63,-22,193,0, 234, 472, 97,-70,0,255 },   /* v2 used p1785/V3 2 times */
	{ 63,87,193,0, 234, 921, 86,84,0,255 },   /* v3 used p1785/V2 1 times */
	{ 63,87,193,0, 209, 738, 86,84,0,255 },   /* v4 used p1786/V1 1 times */
	{ 63,87,71,0, 779, 738, 86,84,0,255 },   /* v5 used p1787/V1 2 times */
	{ -70,114,193,0, 209, 170, 23,118,0,255 },   /* v6 used p1787/V3 2 times */
	{ -70,114,71,0, 779, 170, 23,118,0,255 },   /* v7 used p1787/V2 1 times */
	{ 63,-22,71,0, 779, 738, 98,-69,0,255 },   /* v8 used p1788/V1 1 times */
	{ 63,-22,193,0, 209, 738, 97,-70,0,255 },   /* v9 used p1788/V2 2 times */
	{ -70,-99,61,0, 779, 170, 60,-103,0,255 },   /* v10 used p1788/V3 2 times */
	{ -70,-99,193,0, 209, 170, 60,-103,0,255 },   /* v11 used p1789/V2 1 times */
	{ 95,154,-68,0, 1093, 1102, 119,4,-16,255 },   /* v12 used p1793/V3 2 times */
	{ 95,154,117,0, -90, 1102, 120,2,-4,255 },   /* v13 used p1799/V2 1 times */
	{ 95,-272,118,0, -97, -975, 110,-20,42,255 },   /* v14 used p1793/V1 2 times */
	{ 95,-272,-67,0, 1088, -975, 97,-40,-58,255 },   /* v15 used p1793/V2 1 times */
	{ 95,-272,-67,0, 0, -30, 97,-40,-58,255 },   /* v16 used p1801/V1 1 times */
	{ -70,165,138,0, 224, 1228, -44,109,23,255 },   /* v17 used p1797/V3 2 times */
	{ 50,222,-62,0, 897, 319, -42,103,-43,255 },   /* v18 used p1797/V1 2 times */
	{ 95,-272,118,0, 948, -30, 110,-20,42,255 },   /* v19 used p1801/V2 1 times */
	{ -70,-461,89,0, 800, 1480, 75,-92,-11,255 },   /* v20 used p1801/V3 1 times */
	{ 50,222,101,0, 373, 320, -51,108,0,255 },   /* v21 used p1792/V2 1 times */
	{ -70,165,-80,0, 922, 1228, -65,46,-89,255 },   /* v22 used p1797/V2 1 times */
	{ 68,140,71,0, 105, 194, 110,43,-23,255 },   /* v23 used p1806/V1 2 times */
	{ 68,140,-29,0, 426, 184, 106,45,34,255 },   /* v24 used p1806/V2 1 times */
	{ 49,190,-29,0, 420, 382, 115,32,4,255 },   /* v25 used p1806/V3 2 times */
	{ 49,190,71,0, 99, 393, 119,17,-5,255 },   /* v26 used p1805/V3 1 times */
	{ 49,190,71,0, 831, 511, 119,17,-5,255 },   /* v27 used p1781/V1 2 times */
	{ 50,222,-62,0, -98, -12, 105,37,-44,255 },   /* v28 used p1781/V3 2 times */
	{ 50,222,101,0, 1085, -12, 94,44,59,255 },   /* v29 used p1780/V3 1 times */
	{ 49,190,-29,0, 191, 511, 115,32,4,255 },   /* v30 used p1781/V2 1 times */
	{ 68,140,-29,0, 531, 598, 106,45,34,255 },   /* v31 used p1778/V1 2 times */
	{ 50,222,-62,0, -52, 58, 105,37,-44,255 },   /* v32 used p1778/V3 2 times */
	{ 49,190,-29,0, 67, 560, 115,32,4,255 },   /* v33 used p1779/V3 1 times */
	{ 95,154,-68,0, 597, 24, 119,4,-16,255 },   /* v34 used p1778/V2 1 times */
	{ 68,140,-29,0, 831, 511, -56,105,0,255 },   /* v35 used p1808/V1 2 times */
	{ 68,140,71,0, 191, 511, -56,105,0,255 },   /* v36 used p1808/V2 1 times */
	{ 95,154,117,0, -98, -12, -19,86,80,255 },   /* v37 used p1808/V3 2 times */
	{ 95,154,-68,0, 1085, -12, 119,4,-16,255 },   /* v38 used p1807/V3 1 times */
	{ 50,222,101,0, -52, 58, 94,44,59,255 },   /* v39 used p1782/V1 2 times */
	{ 95,154,117,0, 597, 24, 120,2,-4,255 },   /* v40 used p1782/V2 1 times */
	{ 68,140,71,0, 531, 598, 110,43,-23,255 },   /* v41 used p1782/V3 2 times */
	{ 49,190,71,0, 67, 560, 119,17,-5,255 },   /* v42 used p1783/V1 1 times */
	{ 28,15,-157,0, -486, 716, 8,1,-120,255 },   /* v43 used p1802/V1 5 times */
	{ -70,165,-80,0, -997, 1343, -65,46,-89,255 },   /* v44 used p1796/V2 2 times */
	{ 50,222,-62,0, -1194, 575, -42,103,-43,255 },   /* v45 used p1796/V3 2 times */
	{ 95,154,-68,0, -962, 287, 119,4,-16,255 },   /* v46 used p1802/V2 2 times */
	{ 95,-272,-67,0, 492, 288, 97,-40,-58,255 },   /* v47 used p1802/V3 3 times */
	{ -70,-330,-76,0, 691, 1344, -18,-38,-112,255 },   /* v48 used p1794/V3 3 times */
	{ -70,-461,89,0, 1136, 1344, 75,-92,-11,255 },   /* v49 used p1800/V1 1 times */
	{ 50,222,101,0, 1455, 597, 94,44,59,255 },   /* v50 used p179xߠxp1801/V1 1 times */
	{ -70,165,138,0, 1300, 1109, -44,109,23,255 },   /* v51 used p179xߠxp1801/V2 2 times */
	{ 95,154,117,0, 1271, 405, -19,86,80,255 },   /* v52 used p179xߠxp1801/V3 3 times */
	{ -70,-376,146,0, -157, 1109, 22,-4,117,255 },   /* v53 used p1790/V1 3 times */
	{ 95,-272,118,0, 123, 405, 110,-20,42,255 },   /* v54 used p1790/V2 2 times */
	{ -70,-461,89,0, -385, 1109, 75,-92,-11,255 },   /* v55 used p1791/V2 1 times */
};


/*   0 vertices */
/*   2 Materials */

#define	LDIRX	0
#define	LDIRY	0
#define	LDIRZ	120
#define	AMBDIV	1
