#include<ultra64.h>

extern Vtx MC_Stopper_BodyC_v[];

extern unsigned char MC_BTTX02_CI8_txt[];
extern unsigned char MC_GimicTX02_CI8_txt[];
extern unsigned char MC_RailWayTX01_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 */


Gfx MC_Stopper_BodyC[]={

	gsDPLoadTLUT_pal256(&MC_BTTX02_CI8_txt[256]),
	gsDPLoadTextureBlock(MC_BTTX02_CI8_txt,G_IM_FMT_CI,G_IM_SIZ_8b,16,16,0,G_TX_WRAP,G_TX_WRAP,4,4,0,0),
	gsDPSetTextureLUT(G_TT_RGBA16),

	gsSPVertex(&MC_Stopper_BodyC_v[0], 12, 0),
	gsSP1Triangle(0, 1, 2, 0),
	gsSP1Triangle(0, 2, 3, 0),
	gsSP1Triangle(4, 5, 6, 0),
	gsSP1Triangle(4, 6, 7, 0),
	gsSP1Triangle(8, 9, 10, 0),
	gsSP1Triangle(8, 10, 11, 0),

	gsDPLoadTLUT_pal256(&MC_GimicTX02_CI8_txt[1024]),
	gsDPLoadTextureBlock(MC_GimicTX02_CI8_txt,G_IM_FMT_CI,G_IM_SIZ_8b,32,32,0,G_TX_WRAP,G_TX_WRAP,5,5,0,0),

	gsSPVertex(&MC_Stopper_BodyC_v[12], 10, 0),
	gsSP1Triangle(0, 1, 2, 0),
	gsSP1Triangle(3, 4, 5, 0),
	gsSP1Triangle(3, 5, 6, 0),
	gsSP1Triangle(7, 8, 9, 0),
	gsDPLoadTLUT_pal256(&MC_RailWayTX01_CI8_txt[1024]),
	gsDPLoadTextureBlock(MC_RailWayTX01_CI8_txt,G_IM_FMT_CI,G_IM_SIZ_8b,32,32,0,G_TX_WRAP,G_TX_WRAP,5,5,0,0),
	gsDPSetTextureLUT(G_TT_RGBA16),

	gsSPVertex(&MC_Stopper_BodyC_v[22], 12, 0),
	gsSP1Triangle(0, 1, 2, 0),
	gsSP1Triangle(0, 2, 3, 0),
	gsSP1Triangle(4, 5, 6, 0),
	gsSP1Triangle(4, 6, 7, 0),
	gsSP1Triangle(8, 9, 10, 0),
	gsSP1Triangle(8, 10, 11, 0),
	gsDPPipeSync(),
        gsDPSetTextureLUT(G_TT_NONE),
	gsSPEndDisplayList(),
}; /* o5 */ 


#undef G_CC_PRIMSHADE

#undef gs_Nin_LoadTextureImage

#undef gs_Nin_SetUpTileDescrip

/* 34 vertices */
Vtx MC_Stopper_BodyC_v[]={
	{ -80,130,50,0, 44, 490, -28,107,45,255 },   /* v0 used p198/V1 2 times */
	{ -80,130,-50,0, 471, 490, -28,107,-46,255 },   /* v1 used p198/V2 2 times */
	{ -110,70,-70,0, 556, 0, -106,54,0,255 },   /* v2 used p198/V3 2 times */
	{ -110,70,70,0, -40, 0, -33,101,55,255 },   /* v3 used p198/V4 2 times */
	{ 110,70,-70,0, -80, 0, 56,58,-89,255 },   /* v4 used p18/V1 2 times */
	{ -110,70,-70,0, 1104, 0, 0,18,-119,255 },   /* v5 used p18/V2 2 times */
	{ -80,130,-50,0, 943, 512, -28,107,-46,255 },   /* v6 used p18/V3 2 times */
	{ 80,130,-50,0, 80, 512, 29,107,-46,255 },   /* v7 used p18/V4 2 times */
	{ 110,70,70,0, -40, 0, 34,101,55,255 },   /* v8 used p19/V1 2 times */
	{ 110,70,-70,0, 556, 0, 56,58,-89,255 },   /* v9 used p19/V2 2 times */
	{ 80,130,-50,0, 471, 490, 29,107,-46,255 },   /* v10 used p19/V3 2 times */
	{ 80,130,50,0, 44, 490, 29,107,45,255 },   /* v11 used p19/V4 2 times */
	{ -230,0,40,0, 896, 1311, -63,94,38,255 },   /* v12 used p193/V1 2 times */
	{ -110,0,240,0, 896, -599, -25,108,44,255 },   /* v13 used p193/V2 2 times */
	{ -110,70,70,0, 179, 681, -33,101,55,255 },   /* v14 used p193/V3 2 times */
	{ 110,70,-70,0, -113, -157, 0,0,-120,255 },   /* v15 used p20/V1 2 times */
	{ 110,0,-70,0, -113, 393, 0,0,-120,255 },   /* v16 used p20/V2 2 times */
	{ -110,0,-70,0, 1137, 393, 0,0,-120,255 },   /* v17 used p20/V3 2 times */
	{ -110,70,-70,0, 1137, -157, 0,18,-119,255 },   /* v18 used p20/V4 2 times */
	{ 110,70,70,0, 179, 681, 34,101,55,255 },   /* v19 used p23/V1 2 times */
	{ 110,0,240,0, 896, -599, 26,108,44,255 },   /* v20 used p23/V2 2 times */
	{ 230,0,40,0, 896, 1311, 64,94,38,255 },   /* v21 used p23/V3 2 times */
	{ -110,70,70,0, -87, 986, -33,101,55,255 },   /* v22 used p6/V1 2 times */
	{ 110,70,70,0, 1111, 986, 34,101,55,255 },   /* v23 used p6/V2 2 times */
	{ 80,130,50,0, 947, 758, 29,107,45,255 },   /* v24 used p6/V3 2 times */
	{ -80,130,50,0, 76, 758, -28,107,45,255 },   /* v25 used p6/V4 2 times */
	{ -110,0,240,0, -87, 1009, -25,108,44,255 },   /* v26 used p13/V1 2 times */
	{ 110,0,240,0, 1111, 1009, 26,108,44,255 },   /* v27 used p13/V2 2 times */
	{ 110,70,70,0, 1111, 760, 34,101,55,255 },   /* v28 used p13/V3 2 times */
	{ -110,70,70,0, -87, 760, -33,101,55,255 },   /* v29 used p13/V4 2 times */
	{ -80,130,50,0, 76, 970, -28,107,45,255 },   /* v30 used p12/V1 2 times */
	{ 80,130,50,0, 947, 970, 29,107,45,255 },   /* v31 used p12/V2 2 times */
	{ 80,130,-50,0, 947, 754, 29,107,-46,255 },   /* v32 used p12/V3 2 times */
	{ -80,130,-50,0, 76, 754, -28,107,-46,255 },   /* v33 used p12/V4 2 times */
};


/*   0 vertices */
/*   1 Materials */

#define	LDIRX	0
#define	LDIRY	0
#define	LDIRZ	120
#define	AMBDIV	1
