#include<ultra64.h>

extern Vtx BO_Beam_v[];

extern unsigned char BO_Beam_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 */


/* ======== g2 ======== */

Gfx BO_Beam[]={

	gs_Nin_SetUpTileDescrip(G_IM_FMT_IA,G_IM_SIZ_8b,32,16,0,0,G_TX_WRAP,5,0,G_TX_CLAMP,4,0),
	gs_Nin_LoadTextureImage(BO_Beam_txt,G_IM_FMT_IA,G_IM_SIZ_8b,32,16,0,7),

	gsSPVertex(&BO_Beam_v[0], 14, 0),
	gsSP1Triangle(0, 1, 2, 0),
	gsSP1Triangle(0, 2, 3, 0),
	gsSP1Triangle(4, 0, 3, 0),
	gsSP1Triangle(4, 3, 5, 0),
	gsSP1Triangle(1, 6, 7, 0),
	gsSP1Triangle(1, 7, 2, 0),
	gsSP1Triangle(6, 8, 9, 0),
	gsSP1Triangle(6, 9, 7, 0),
	gsSP1Triangle(8, 10, 11, 0),
	gsSP1Triangle(8, 11, 9, 0),
	gsSP1Triangle(10, 12, 13, 0),
	gsSP1Triangle(10, 13, 11, 0),
	gsSPVertex(&BO_Beam_v[4], 2, 0),
	gsSPVertex(&BO_Beam_v[12], 6, 2),
	gsSPVertex(&BO_Beam_v[23], 6, 8),
	gsSP1Triangle(2, 4, 8, 0),
	gsSP1Triangle(2, 8, 3, 0),
	gsSP1Triangle(4, 9, 10, 0),
	gsSP1Triangle(4, 10, 8, 0),
	gsSP1Triangle(5, 0, 1, 0),
	gsSP1Triangle(5, 1, 11, 0),
	gsSP1Triangle(6, 12, 7, 0),
	gsSP1Triangle(6, 7, 13, 0),
	gsSPVertex(&BO_Beam_v[15], 1, 0),
	gsSPVertex(&BO_Beam_v[17], 6, 1),
	gsSPVertex(&BO_Beam_v[26], 1, 7),
	gsSPVertex(&BO_Beam_v[28], 6, 8),
	gsSP1Triangle(1, 2, 9, 0),
	gsSP1Triangle(1, 9, 8, 0),
	gsSP1Triangle(2, 3, 10, 0),
	gsSP1Triangle(2, 10, 9, 0),
	gsSP1Triangle(3, 4, 11, 0),
	gsSP1Triangle(3, 11, 10, 0),
	gsSP1Triangle(4, 6, 12, 0),
	gsSP1Triangle(4, 12, 11, 0),
	gsSP1Triangle(5, 0, 7, 0),
	gsSP1Triangle(5, 7, 13, 0),
	gsSP1Triangle(6, 5, 13, 0),
	gsSP1Triangle(6, 13, 12, 0),
	gsSPEndDisplayList(),
}; /* g2 */ 

#undef G_CC_PRIMSHADE

#undef gs_Nin_LoadTextureImage

#undef gs_Nin_SetUpTileDescrip

/* 34 vertices */
Vtx BO_Beam_v[]={
	{ -20,0,25,0, 3583, 89, 0,120,0,255 },   /* v0 used p23/V1 2 times */
	{ -20,0,50,0, 3071, 89, 0,120,0,255 },   /* v1 used p23/V2 4 times */
	{ 20,0,50,0, 3072, 448, 0,120,0,255 },   /* v2 used p23/V3 4 times */
	{ 20,0,25,0, 3584, 448, 0,120,0,255 },   /* v3 used p23/V4 2 times */
	{ -20,0,0,0, 4095, 89, 0,120,0,255 },   /* v4 used p12/V1 2 times */
	{ 20,0,0,0, 4096, 448, 0,120,0,255 },   /* v5 used p12/V4 2 times */
	{ -20,0,75,0, 2559, 89, 0,120,0,255 },   /* v6 used p17/V2 4 times */
	{ 20,0,75,0, 2560, 448, 0,120,0,255 },   /* v7 used p17/V3 4 times */
	{ -20,0,100,0, 2047, 89, 0,120,0,255 },   /* v8 used p24/V2 4 times */
	{ 20,0,100,0, 2048, 448, 0,120,0,255 },   /* v9 used p24/V3 4 times */
	{ -20,0,125,0, 1535, 89, 0,120,0,255 },   /* v10 used p14/V2 4 times */
	{ 20,0,125,0, 1536, 448, 0,120,0,255 },   /* v11 used p14/V3 4 times */
	{ -20,0,150,0, 1023, 89, 0,120,0,255 },   /* v12 used p25/V2 4 times */
	{ 20,0,150,0, 1024, 448, 0,120,0,255 },   /* v13 used p25/V3 4 times */
	{ -20,0,175,0, 511, 89, 0,120,0,255 },   /* v14 used p18/V2 4 times */
	{ -20,0,-25,0, 4607, 89, 0,120,0,255 },   /* v15 used p22/V1 2 times */
	{ 20,0,-200,0, 8192, 448, 0,120,0,255 },   /* v16 used p11/V1 2 times */
	{ -20,0,-175,0, 7679, 89, 0,120,0,255 },   /* v17 used p11/V3 4 times */
	{ -20,0,-150,0, 7167, 89, 0,120,0,255 },   /* v18 used p19/V2 4 times */
	{ -20,0,-125,0, 6655, 89, 0,120,0,255 },   /* v19 used p15/V2 4 times */
	{ -20,0,-100,0, 6143, 89, 0,120,0,255 },   /* v20 used p20/V2 4 times */
	{ -20,0,-50,0, 5119, 89, 0,120,0,255 },   /* v21 used p16/V1 2 times */
	{ -20,0,-75,0, 5631, 89, 0,120,0,255 },   /* v22 used p21/V1 2 times */
	{ 20,0,175,0, 512, 448, 0,120,0,255 },   /* v23 used p18/V3 4 times */
	{ -20,0,200,0, 0, 89, 0,120,0,255 },   /* v24 used p26/V2 2 times */
	{ 20,0,200,0, 0, 448, 0,120,0,255 },   /* v25 used p26/V3 2 times */
	{ 20,0,-25,0, 4608, 448, 0,120,0,255 },   /* v26 used p22/V4 2 times */
	{ -20,0,-200,0, 8191, 89, 0,120,0,255 },   /* v27 used p11/V2 2 times */
	{ 20,0,-175,0, 7680, 448, 0,120,0,255 },   /* v28 used p11/V4 4 times */
	{ 20,0,-150,0, 7168, 448, 0,120,0,255 },   /* v29 used p19/V3 4 times */
	{ 20,0,-125,0, 6656, 448, 0,120,0,255 },   /* v30 used p15/V3 4 times */
	{ 20,0,-100,0, 6144, 448, 0,120,0,255 },   /* v31 used p20/V3 4 times */
	{ 20,0,-75,0, 5632, 448, 0,120,0,255 },   /* v32 used p21/V4 2 times */
	{ 20,0,-50,0, 5120, 448, 0,120,0,255 },   /* v33 used p16/V4 2 times */
};


/*   0 vertices */
/*   1 Materials */

#define	LDIRX	0
#define	LDIRY	0
#define	LDIRZ	120
#define	AMBDIV	1
/* 32 x 16  G_IM_SIZ_8b  G_IM_FMT_IA    */
unsigned char BO_Beam_txt[] = {
	0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 
	0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x51, 0x51, 0x51, 0x51, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 
	0x51, 0x50, 0x50, 0x50, 0x50, 0x51, 0x51, 0x51, 0x51, 0x54, 0x54, 0x55, 0x54, 0x51, 0x51, 0x51, 0x51, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x51, 0x51, 0x51, 
	0x54, 0x51, 0x51, 0x51, 0x51, 0x55, 0x54, 0x54, 0x55, 0x58, 0x58, 0x58, 0x58, 0x54, 0x55, 0x54, 0x54, 0x51, 0x51, 0x51, 0x51, 0x50, 0x50, 0x50, 0x50, 0x51, 0x51, 0x51, 0x51, 0x54, 0x54, 0x54, 
	0x58, 0x54, 0x54, 0x54, 0x55, 0x58, 0x58, 0x58, 0x58, 0x5b, 0x5c, 0x5c, 0x5c, 0x58, 0x58, 0x58, 0x58, 0x55, 0x54, 0x54, 0x54, 0x51, 0x51, 0x51, 0x51, 0x54, 0x54, 0x55, 0x54, 0x58, 0x58, 0x57, 
	0x5c, 0x58, 0x58, 0x58, 0x58, 0x5c, 0x5b, 0x5b, 0x5c, 0xae, 0xae, 0xae, 0xaf, 0x5c, 0x5c, 0x5b, 0x5c, 0x58, 0x58, 0x58, 0x58, 0x54, 0x54, 0x54, 0x54, 0x58, 0x58, 0x58, 0x58, 0x5b, 0x5b, 0x5b, 
	0xae, 0x5c, 0x5c, 0x5c, 0x5b, 0xae, 0xae, 0xae, 0xae, 0xff, 0xff, 0xff, 0xff, 0xae, 0xae, 0xae, 0xae, 0x5c, 0x5c, 0x5c, 0x5c, 0x58, 0x58, 0x58, 0x58, 0x5c, 0x5b, 0x5c, 0x5b, 0xae, 0xae, 0xae, 
	0xff, 0xae, 0xaf, 0xae, 0xae, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xae, 0xae, 0xae, 0xae, 0x5c, 0x5c, 0x5c, 0x5b, 0xae, 0xae, 0xae, 0xae, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xaf, 0xae, 0xae, 0xae, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xae, 0xaf, 0xae, 0xae, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xae, 0xff, 0xff, 0xff, 0xff, 0xae, 0xae, 0xae, 0xae, 0x5c, 0x5c, 0x5c, 0x5c, 0xae, 0xae, 0xae, 0xae, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xaf, 0xae, 0xae, 
	0x5b, 0xae, 0xae, 0xae, 0xae, 0x5b, 0x5c, 0x5b, 0x5c, 0x58, 0x58, 0x58, 0x58, 0x5c, 0x5c, 0x5c, 0x5b, 0xae, 0xae, 0xaf, 0xae, 0xff, 0xff, 0xff, 0xff, 0xae, 0xae, 0xae, 0xae, 0x5c, 0x5c, 0x5c, 
	0x57, 0x5b, 0x5b, 0x5b, 0x5c, 0x58, 0x58, 0x58, 0x58, 0x54, 0x54, 0x54, 0x54, 0x58, 0x58, 0x58, 0x58, 0x5c, 0x5c, 0x5c, 0x5c, 0xae, 0xae, 0xae, 0xae, 0x5b, 0x5c, 0x5b, 0x5c, 0x58, 0x58, 0x58, 
	0x54, 0x58, 0x58, 0x58, 0x58, 0x54, 0x54, 0x54, 0x54, 0x51, 0x51, 0x51, 0x51, 0x54, 0x55, 0x54, 0x54, 0x58, 0x58, 0x58, 0x58, 0x5c, 0x5b, 0x5c, 0x5b, 0x58, 0x58, 0x58, 0x58, 0x54, 0x54, 0x54, 
	0x51, 0x54, 0x54, 0x54, 0x55, 0x51, 0x51, 0x51, 0x51, 0x50, 0x50, 0x50, 0x50, 0x51, 0x51, 0x51, 0x51, 0x55, 0x54, 0x54, 0x55, 0x58, 0x58, 0x58, 0x58, 0x54, 0x55, 0x55, 0x54, 0x51, 0x51, 0x51, 
	0x50, 0x51, 0x51, 0x51, 0x51, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x51, 0x51, 0x51, 0x51, 0x54, 0x54, 0x55, 0x54, 0x51, 0x51, 0x51, 0x51, 0x50, 0x50, 0x50, 
	0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 
};

