#include<ultra64.h>

extern Vtx ZO_Boss_Lgunbattery_v[];
extern Vtx ZO_Boss_Lgunbattery_vmcur[];
extern Tri ZO_Boss_Lgunbattery_tri[];
extern Mtx ZO_Boss_Lgunbattery_matrix[];

extern unsigned short ZO_BossTX02_txt[];
extern unsigned short ZO_BossTX06_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 */


/* ======== Lhoudai ======== */

Gfx ZO_Boss_Lgunbattery_[]={

	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_Lgunbattery_v[0],26,0),
	gsSP2Triangles(0, 1, 2, 0, 3, 4, 5, 0),
	gsSP1Quadrangle(6, 7, 8, 9, 0),
	gsSP2Triangles(10, 11, 12, 0, 10, 13, 11, 0),
	gsSP1Quadrangle(14, 15, 11, 13, 0),
	gsSP1Triangle(15, 14, 16, 0),
	gsSP1Quadrangle(17, 18, 19, 20, 0),
	gsSP2Triangles(21, 22, 23, 0, 23, 24, 21, 0),
	gsSP1Triangle(16, 25, 15, 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_Lgunbattery_v[26],4,0),
	gsSP1Quadrangle(0, 1, 2, 3, 0),
	gsSPEndDisplayList(),
}; /* Lhoudai */ 

#undef G_CC_PRIMSHADE

#undef gs_Nin_LoadTextureImage

#undef gs_Nin_SetUpTileDescrip

/* 30 vertices */
Vtx ZO_Boss_Lgunbattery_v[]={
	{     0,    77,    50,     0,   512,   715,    11,    91,    77,   255},	/* 0 */
	{     0,   -68,    60,     0,   792,   801,  -111,   -26,    34,   255},	/* 1 */
	{    47,   -88,    75,     0,   830,   688,    -7,  -116,    25,   255},	/* 2 */
	{    47,   -88,   -75,     0,   830,   688,     0,    -9,  -120,   255},	/* 3 */
	{     0,   -68,   -60,     0,   792,   801,  -112,   -35,   -20,   255},	/* 4 */
	{     0,    77,   -50,     0,   512,   715,  -110,     3,   -46,   255},	/* 5 */
	{     0,   -68,   -60,     0,   255,   134,  -112,   -35,   -20,   255},	/* 6 */
	{     0,   -68,    60,     0,   870,   134,  -111,   -26,    34,   255},	/* 7 */
	{     0,    77,    50,     0,   819,   916,  -119,     0,     0,   255},	/* 8 */
	{     0,    77,   -50,     0,   307,   916,  -110,     3,   -46,   255},	/* 9 */
	{    47,   -88,    75,     0,   821,   661,    15,     8,   118,   255},	/* 10 */
	{   175,    47,    50,     0,   383,   117,    59,    47,    92,   255},	/* 11 */
	{     0,    77,    50,     0,   336,   863,    11,    91,    77,   255},	/* 12 */
	{   175,   -53,    38,     0,   684,   117,    61,   -94,    39,   255},	/* 13 */
	{   175,   -53,   -37,     0,   684,   117,    98,   -44,   -52,   255},	/* 14 */
	{   175,    47,   -50,     0,   383,   117,    42,     8,  -112,   255},	/* 15 */
	{    47,   -88,   -75,     0,   821,   661,     0,    -9,  -120,   255},	/* 16 */
	{    47,   -88,   -75,     0,   926,   655,    32,  -115,     0,   255},	/* 17 */
	{   175,   -53,   -37,     0,   835,   113,    98,   -44,   -52,   255},	/* 18 */
	{   175,   -53,    38,     0,   652,   113,    61,   -94,    39,   255},	/* 19 */
	{    47,   -88,    75,     0,   560,   655,    -7,  -116,    25,   255},	/* 20 */
	{    47,   -88,    75,     0,   549,   688,    -7,  -116,    25,   255},	/* 21 */
	{     0,   -68,    60,     0,   582,   840,  -111,   -26,    34,   255},	/* 22 */
	{     0,   -68,   -60,     0,   849,   840,  -112,   -35,   -20,   255},	/* 23 */
	{    47,   -88,   -75,     0,   883,   688,     0,    -9,  -120,   255},	/* 24 */
	{     0,    77,   -50,     0,   336,   863,    13,    74,   -93,   255},	/* 25 */
	{   175,    47,   -50,     0,     0,     6,    20,   118,     0,   255},	/* 26 */
	{     0,    77,   -50,     0,     0,   512,    13,    74,   -93,   255},	/* 27 */
	{     0,    77,    50,     0,   511,   512,    11,    91,    77,   255},	/* 28 */
	{   175,    47,    50,     0,   511,     6,    59,    47,    92,   255},	/* 29 */
};


/*   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_BossTX06_txt[] = {
	0xffff, 0x5293, 0x7359, 0x9ca1, 0xb565, 0x398b, 0xff75, 0xffff, 0x7357, 0xeeaf, 0xd629, 0xace1, 0x941d, 0x62d3, 0x41cd, 0xfffd, 
	0xffff, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0xfff9, 
	0xad67, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 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