#include<ultra64.h>

extern Vtx AC_Gate01_v[];

extern unsigned char AC_BossTX03_CI8_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 */


/* ======== Default ======== */

Gfx AC_Gate01[]={

	gsDPSetTextureLUT(G_TT_RGBA16),
	gsDPLoadTLUT_pal256(&AC_BossTX03_CI8_txt[1024]),
	gsDPLoadTextureBlock(AC_BossTX03_CI8_txt,G_IM_FMT_CI,G_IM_SIZ_8b,32,32,0,G_TX_WRAP,G_TX_CLAMP,5,5,0,0),

	gsSPVertex(&AC_Gate01_v[0], 16, 0),
	gsSP1Triangle(0, 1, 2, 0),
	gsSP1Triangle(2, 3, 0, 0),
	gsSP1Triangle(1, 0, 4, 0),
	gsSP1Triangle(5, 6, 7, 0),
	gsSP1Triangle(7, 8, 5, 0),
	gsSP1Triangle(9, 10, 11, 0),
	gsSP1Triangle(11, 12, 9, 0),
	gsSP1Triangle(13, 14, 15, 0),
	gsSPVertex(&AC_Gate01_v[13], 1, 0),
	gsSPVertex(&AC_Gate01_v[15], 9, 1),
	gsSPVertex(&AC_Gate01_v[26], 1, 10),
	gsSPVertex(&AC_Gate01_v[32], 5, 11),
	gsSP1Triangle(1, 2, 0, 0),
	gsSP1Triangle(2, 3, 4, 0),
	gsSP1Triangle(2, 11, 5, 0),
	gsSP1Triangle(4, 11, 2, 0),
	gsSP1Triangle(5, 0, 2, 0),
	gsSP1Triangle(2, 1, 3, 0),
	gsSP1Triangle(6, 12, 7, 0),
	gsSP1Triangle(7, 13, 6, 0),
	gsSP1Triangle(8, 9, 14, 0),
	gsSP1Triangle(8, 10, 15, 0),
	gsSPVertex(&AC_Gate01_v[22], 9, 0),
	gsSPVertex(&AC_Gate01_v[36], 7, 9),
	gsSP1Triangle(1, 3, 10, 0),
	gsSP1Triangle(0, 3, 1, 0),
	gsSP1Triangle(2, 11, 3, 0),
	gsSP1Triangle(3, 11, 10, 0),
	gsSP1Triangle(4, 2, 9, 0),
	gsSP1Triangle(5, 6, 7, 0),
	gsSP1Triangle(6, 12, 7, 0),
	gsSP1Triangle(7, 12, 13, 0),
	gsSP1Triangle(8, 14, 15, 0),
	gsSPVertex(&AC_Gate01_v[31], 1, 0),
	gsSPVertex(&AC_Gate01_v[43], 2, 1),
	gsSP1Triangle(0, 1, 2, 0),
	gsDPPipeSync(),
        gsDPSetTextureLUT(G_TT_NONE),
	gsSPEndDisplayList(),
}; /* Default */ 

#undef G_CC_PRIMSHADE

#undef gs_Nin_LoadTextureImage

#undef gs_Nin_SetUpTileDescrip

/* 45 vertices */
Vtx AC_Gate01_v[]={
	{ 26,562,-10,0, 2369, 340, 3,106,54,255 },   /* v0 used p68/V3 3 times */
	{ 296,427,23,0, 1818, 1073, 47,60,92,255 },   /* v1 used p53/V2 4 times */
	{ 427,472,-205,0, 824, 948, 65,87,50,255 },   /* v2 used p68/V1 2 times */
	{ 1,610,-311,0, 1630, -197, 4,118,18,255 },   /* v3 used p68/V2 2 times */
	{ 172,375,33,0, 2249, 910, -33,-31,109,255 },   /* v4 used p61/V3 2 times */
	{ -435,507,-235,0, -413, 802, -40,109,29,255 },   /* v5 used p67/V3 2 times */
	{ -368,446,29,0, 217, 1109, -52,72,78,255 },   /* v6 used p57/V2 2 times */
	{ 26,562,-10,0, 819, 299, 3,106,54,255 },   /* v7 used p67/V1 2 times */
	{ 1,610,-311,0, 211, -77, 4,118,18,255 },   /* v8 used p67/V2 2 times */
	{ -172,387,36,0, 1170, 1052, 26,-50,104,255 },   /* v9 used p66/V3 2 times */
	{ -129,281,-128,0, 1046, 633, 20,-96,67,255 },   /* v10 used p56/V2 2 times */
	{ 141,255,-131,0, 101, 532, -23,-94,68,255 },   /* v11 used p66/V1 2 times */
	{ 172,375,33,0, -41, 1003, -33,-31,109,255 },   /* v12 used p66/V2 2 times */
	{ -272,146,-168,0, -18, 425, 92,-56,51,255 },   /* v13 used p65/V3 3 times */
	{ -129,281,-128,0, -436, 778, 20,-96,67,255 },   /* v14 used p52/V2 2 times */
	{ -172,387,36,0, -139, 987, 26,-50,104,255 },   /* v15 used p65/V1 3 times */
	{ -360,204,89,0, 402, 510, 68,-5,98,255 },   /* v16 used p65/V2 6 times */
	{ -368,446,29,0, 718, 1025, -52,72,78,255 },   /* v17 used p62/V3 2 times */
	{ -564,0,123,0, 987, -18, -67,46,87,255 },   /* v18 used p54/V3 4 times */
	{ -289,0,-103,0, -119, 104, 114,6,35,255 },   /* v19 used p64/V1 2 times */
	{ 557,0,83,0, 626, 18, 60,53,89,255 },   /* v20 used p63/V3 2 times */
	{ 427,472,-205,0, -220, 972, 65,87,50,255 },   /* v21 used p63/V1 2 times */
	{ 212,128,-117,0, -378, 371, -105,-32,44,255 },   /* v22 used p69/V1 6 times */
	{ 172,375,33,0, -169, 973, -33,-31,109,255 },   /* v23 used p69/V2 6 times */
	{ 297,0,93,0, -182, 38, -56,14,104,255 },   /* v24 used p72/V1 2 times */
	{ 269,162,57,0, -54, 434, -51,4,107,255 },   /* v25 used p75/V2 4 times */
	{ 212,0,-103,0, -577, 67, -111,-2,43,255 },   /* v26 used p71/V2 2 times */
	{ -714,0,-94,0, 463, -339, -89,50,61,255 },   /* v27 used p48/V1 2 times */
	{ -564,0,123,0, 1083, 11, -67,46,87,255 },   /* v28 used p49/V1 2 times */
	{ -604,284,-164,0, 345, 288, -87,58,56,255 },   /* v29 used p50/V1 3 times */
	{ 26,562,-10,0, 524, 291, 3,106,54,255 },   /* v30 used p60/V1 2 times */
	{ 26,562,-10,0, 1005, 160, 3,106,54,255 },   /* v31 used p59/V1 2 times */
	{ -348,0,103,0, 120, 77, 76,10,91,255 },   /* v32 used p58/V2 2 times */
	{ 718,0,-94,0, -260, -78, 75,63,68,255 },   /* v33 used p51/V2 2 times */
	{ 296,427,23,0, 786, 953, 47,60,92,255 },   /* v34 used p63/V2 2 times */
	{ 141,255,-131,0, -505, 699, -23,-94,68,255 },   /* v35 used p69/V3 2 times */
	{ 269,162,57,0, -54, 434, -51,4,107,255 },   /* v36 used p71/V3 2 times */
	{ 296,427,23,0, 487, 1055, 47,60,92,255 },   /* v37 used p74/V3 2 times */
	{ 557,0,83,0, 1024, -50, 60,53,89,255 },   /* v38 used p73/V2 2 times */
	{ -368,446,29,0, 960, 1043, -52,72,78,255 },   /* v39 used p50/V2 2 times */
	{ -435,507,-235,0, 321, 896, -40,109,29,255 },   /* v40 used p50/V3 2 times */
	{ -172,387,36,0, 1167, 1090, 26,-50,104,255 },   /* v41 used p60/V2 2 times */
	{ 172,375,33,0, -44, 1042, -33,-31,109,255 },   /* v42 used p60/V3 2 times */
	{ -368,446,29,0, 85, 1221, -52,72,78,255 },   /* v43 used p59/V2 2 times */
	{ -172,387,36,0, 754, 1220, 26,-50,104,255 },   /* v44 used p59/V3 2 times */
};


/*   0 vertices */
/*   1 Materials */

#define	LDIRX	0
#define	LDIRY	0
#define	LDIRZ	120
#define	AMBDIV	1
