#include<ultra64.h>

extern Vtx MC_BTbase_TiresLOD_v[];

extern unsigned char MC_BTTX02_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 */


/* ======== DXFdata ======== */

Gfx MC_BTbase_TiresLOD[]={

	gsDPSetTextureLUT(G_TT_RGBA16),
	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),

	gsSPVertex(&MC_BTbase_TiresLOD_v[0], 12, 0),
	gsSP1Triangle(0, 1, 2, 0),
	gsSP1Triangle(0, 3, 1, 0),
	gsSP1Triangle(4, 5, 6, 0),
	gsSP1Triangle(5, 7, 6, 0),
	gsSP1Triangle(8, 9, 10, 0),
	gsSP1Triangle(8, 11, 9, 0),
	gsDPPipeSync(),
        gsDPSetTextureLUT(G_TT_NONE),
	gsSPEndDisplayList(),
}; /* DXFdata */ 

#undef G_CC_PRIMSHADE

#undef gs_Nin_LoadTextureImage

#undef gs_Nin_SetUpTileDescrip

/* 12 vertices */
Vtx MC_BTbase_TiresLOD_v[]={
	{ -75,-35,-55,0, 534, 896, -119,0,0,255 },   /* v0 used p260/V1 2 times */
	{ -75,35,80,0, -111, 0, -119,0,0,255 },   /* v1 used p260/V3 2 times */
	{ -75,35,-80,0, 601, 0, -119,0,0,255 },   /* v2 used p259/V3 2 times */
	{ -75,-35,55,0, -44, 896, -119,0,0,255 },   /* v3 used p260/V2 2 times */
	{ 75,35,-80,0, 601, 0, 120,0,0,255 },   /* v4 used p120/V1 2 times */
	{ 75,35,80,0, -111, 0, 78,-30,85,255 },   /* v5 used p119/V1 2 times */
	{ 75,-35,-55,0, 534, 896, 120,0,0,255 },   /* v6 used p119/V3 2 times */
	{ 75,-35,55,0, -44, 896, 68,-32,92,255 },   /* v7 used p119/V2 2 times */
	{ -75,-35,55,0, 0, 916, 0,-39,112,255 },   /* v8 used p123/V1 2 times */
	{ 75,35,80,0, 1024, 0, 78,-30,85,255 },   /* v9 used p123/V3 2 times */
	{ -75,35,80,0, 0, 0, 0,-39,112,255 },   /* v10 used p124/V3 2 times */
	{ 75,-35,55,0, 1024, 916, 68,-32,92,255 },   /* v11 used p123/V2 2 times */
};


/*   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 char MC_BTTX02_CI8_txt[] = {
	0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 
	0x0, 0x0, 0x0, 0x0, 0x1, 0x1, 0x0, 0x0, 0x0, 0x0, 0x1, 0x1, 0x0, 0x0, 0x0, 0x0, 
	0x0, 0x0, 0x0, 0x1, 0x2, 0x2, 0x1, 0x0, 0x0, 0x1, 0x2, 0x2, 0x1, 0x0, 0x0, 0x0, 
	0x0, 0x0, 0x0, 0x3, 0x4, 0x4, 0x3, 0x0, 0x0, 0x3, 0x4, 0x4, 0x3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