#include<ultra64.h>

extern Vtx MC_BTbase_Joint_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_Joint[]={

	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_Joint_v[0], 15, 0),
	gsSP1Triangle(0, 1, 2, 0),
	gsSP1Triangle(0, 3, 1, 0),
	gsSP1Triangle(0, 4, 3, 0),
	gsSP1Triangle(4, 5, 6, 0),
	gsSP1Triangle(6, 3, 4, 0),
	gsSP1Triangle(7, 8, 9, 0),
	gsSP1Triangle(7, 9, 10, 0),
	gsSP1Triangle(11, 12, 13, 0),
	gsSP1Triangle(11, 13, 14, 0),
	gsDPPipeSync(),
        gsDPSetTextureLUT(G_TT_NONE),
	gsSPEndDisplayList(),
}; /* DXFdata */ 

#undef G_CC_PRIMSHADE

#undef gs_Nin_LoadTextureImage

#undef gs_Nin_SetUpTileDescrip

/* 15 vertices */
Vtx MC_BTbase_Joint_v[]={
	{ 10,-25,180,0, -76, 320, 97,-69,12,255 },   /* v0 used p201/V1 3 times */
	{ 35,5,-40,0, 951, 5, 109,-49,5,255 },   /* v1 used p196/V2 4 times */
	{ 10,-5,180,0, -98, 165, 26,117,10,255 },   /* v2 used p196/V3 2 times */
	{ 0,-50,-30,0, 964, 437, -84,-83,5,255 },   /* v3 used p201/V3 3 times */
	{ -10,-25,180,0, -76, 320, -96,-69,9,255 },   /* v4 used p201/V2 3 times */
	{ -10,-5,180,0, -98, 165, -81,82,27,255 },   /* v5 used p198/V2 2 times */
	{ -35,5,-40,0, 951, 5, -108,-49,5,255 },   /* v6 used p204/V1 2 times */
	{ -35,5,-40,0, 779, 230, 0,120,4,255 },   /* v7 used p202/V1 4 times */
	{ -10,-5,180,0, -161, 281, -81,82,27,255 },   /* v8 used p202/V2 2 times */
	{ 10,-5,180,0, -161, 281, 26,117,10,255 },   /* v9 used p202/V3 4 times */
	{ 35,5,-40,0, 779, 230, 0,120,4,255 },   /* v10 used p203/V3 2 times */
	{ -10,-5,180,0, 153, 275, -81,82,27,255 },   /* v11 used p200/V1 2 times */
	{ -10,-25,180,0, 153, 433, -96,-69,9,255 },   /* v12 used p199/V2 2 times */
	{ 10,-25,180,0, 358, 433, 97,-69,12,255 },   /* v13 used p200/V2 2 times */
	{ 10,-5,180,0, 358, 275, 26,117,10,255 },   /* v14 used p200/V3 2 times */
};


/*   0 vertices */
/*   1 Materials */

#define	LDIRX	0
#define	LDIRY	0
#define	LDIRZ	120
#define	AMBDIV	1
