#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),
	gsSP2Triangles(0, 1, 2, 0, 0, 3, 1, 0),
	gsSP2Triangles(0, 4, 3, 0, 4, 5, 6, 0),
	gsSP2Triangles(6, 3, 4, 0, 7, 8, 9, 0),
	gsSP1Triangle(7, 9, 10, 0),
	gsSP1Quadrangle(11, 12, 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},	/* 0 */
	{    35,     5,   -40,     0,   951,     5,   109,   -49,     5,   255},	/* 1 */
	{    10,    -5,   180,     0,   -98,   165,    26,   117,    10,   255},	/* 2 */
	{     0,   -50,   -30,     0,   964,   437,   -84,   -83,     5,   255},	/* 3 */
	{   -10,   -25,   180,     0,   -76,   320,   -96,   -69,     9,   255},	/* 4 */
	{   -10,    -5,   180,     0,   -98,   165,   -81,    82,    27,   255},	/* 5 */
	{   -35,     5,   -40,     0,   951,     5,  -108,   -49,     5,   255},	/* 6 */
	{   -35,     5,   -40,     0,   779,   230,     0,   120,     4,   255},	/* 7 */
	{   -10,    -5,   180,     0,  -161,   281,   -81,    82,    27,   255},	/* 8 */
	{    10,    -5,   180,     0,  -161,   281,    26,   117,    10,   255},	/* 9 */
	{    35,     5,   -40,     0,   779,   230,     0,   120,     4,   255},	/* 10 */
	{   -10,    -5,   180,     0,   153,   275,   -81,    82,    27,   255},	/* 11 */
	{   -10,   -25,   180,     0,   153,   433,   -96,   -69,     9,   255},	/* 12 */
	{    10,   -25,   180,     0,   358,   433,    97,   -69,    12,   255},	/* 13 */
	{    10,    -5,   180,     0,   358,   275,    26,   117,    10,   255},	/* 14 */
};


/*   0 vertices */
/*   1 Materials */

#define	LDIRX	0
#define	LDIRY	0
#define	LDIRZ	120
#define	AMBDIV	1
