#include<ultra64.h>

extern Vtx ManLfarm_2b_v[];
extern Vtx ManLfarm_2b_vmcur[];
extern Tri ManLfarm_2b_tri[];
extern Lights1 ManLfarm_2b_material[];
extern Mtx ManLfarm_2b_matrix[];

extern unsigned short Sshoes_bottom_txt[];
extern unsigned short St2_hand_txt[];
extern unsigned short St2best_b_txt[];
extern unsigned short St2best_f_txt[];
extern unsigned short St2best_s_txt[];
extern unsigned short St2best_t_txt[];
extern unsigned short St2farm_b_txt[];
extern unsigned short St2farm_f_txt[];
extern unsigned short St2hara_txt[];
extern unsigned short St2met_b_txt[];
extern unsigned short St2met_f_txt[];
extern unsigned short St2met_gl_txt[];
extern unsigned short St2met_s_txt[];
extern unsigned short St2neck_txt[];
extern unsigned short St2shin_txt[];
extern unsigned short St2shoe_txt[];
extern unsigned short St2shoe_b_txt[];
extern unsigned short St2thigh_b_txt[];
extern unsigned short St2thigh_f_txt[];
extern unsigned short St2uarm_b_txt[];
extern unsigned short St2uarm_f_txt[];
extern unsigned short St2waist_b_txt[];
extern unsigned short St2waist_f_txt[];
extern unsigned short St2waist_s_txt[];
extern unsigned short black_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 ManLfarm_2b_model[]={

	gsSPTexture(65535, 65535,0, 0, 1),
	gsDPPipeSync(),
	gsDPSetCombineMode(G_CC_MODULATERGBDECALA,G_CC_PASS2),

	gs_Nin_SetUpTileDescrip(G_IM_FMT_RGBA,G_IM_SIZ_16b,16,16,0,0,G_TX_CLAMP,4,0,G_TX_CLAMP,4,0),
	gs_Nin_LoadTextureImage(St2farm_b_txt,G_IM_FMT_RGBA,G_IM_SIZ_16b,16,16,0,7),

	gsSPVertex(&ManLfarm_2b_v[0], 7, 0),
	gsSP1Triangle(0, 1, 2, 0),
	gsSP1Triangle(2, 3, 0, 0),
	gsSP1Triangle(4, 5, 6, 0),

	gs_Nin_LoadTextureImage(St2farm_f_txt,G_IM_FMT_RGBA,G_IM_SIZ_16b,16,16,0,7),

	gsSPVertex(&ManLfarm_2b_v[7], 5, 0),
	gsSP1Triangle(0, 1, 2, 0),
	gsSP1Triangle(1, 3, 4, 0),
	gsSP1Triangle(4, 2, 1, 0),
	gsSPEndDisplayList(),
};

Gfx *ManLfarm_2b_modelT = NULL;

#undef G_CC_PRIMSHADE

#undef gs_Nin_LoadTextureImage

#undef gs_Nin_SetUpTileDescrip

/* 12 vertices */

/******************************************************************************
	vertex & texture
******************************************************************************/


/******************************************************************************
	vertex & texture
******************************************************************************/

Vtx ManLfarm_2b_v[]={
	{ 26,-25,-18,0, -5, 511,  59,-95,-41,255 },   /* v0 p12/V3 used 2 times */ 
	{ 18,0,108,0, 35, 4,  101,49,37,255 },   /* v1 p16/V2 used 1 times */ 
	{ -13,-1,108,0, 429, 0,  -93,-59,49,255 },   /* v2 p12/V1 used 2 times */ 
	{ -15,-25,-19,0, 517, 511,  -79,-46,-76,255 },   /* v3 p12/V2 used 1 times */ 
	{ 4,20,-16,0, 240, 92,  0,107,-52,255 },   /* v4 p13/V1 used 1 times */ 
	{ 26,-25,-18,0, 517, 512,  59,-95,-41,255 },   /* v5 p13/V2 used 1 times */ 
	{ -15,-25,-19,0, -5, 511,  -79,-46,-76,255 },   /* v6 p13/V3 used 1 times */ 
	{ 26,-25,-18,0, 643, 493,  59,-95,-41,255 },   /* v7 p14/V1 used 1 times */ 
	{ 4,20,-16,0, 275, 514,  0,107,-52,255 },   /* v8 p15/V1 used 3 times */ 
	{ 18,0,108,0, 518, 0,  101,49,37,255 },   /* v9 p11/V2 used 2 times */ 
	{ -15,-25,-19,0, -54, 499,  -79,-46,-76,255 },   /* v10 p15/V2 used 1 times */ 
	{ -13,-1,108,0, -6, 0,  -93,-59,49,255 },   /* v11 p15/V3 used 2 times */ 
};


/*   0 vertices */
/* 16 x 16  G_IM_SIZ_16b G_IM_FMT_RGBA  */
unsigned short St2farm_b_txt[] = {
	0x19fb, 0x19fb, 0x19fb, 0x19fb, 0x19fb, 0x19fb, 0x19fb, 0x19bb, 0x19bb, 0x19bb, 0x19bb, 0x19bb, 0x19bb, 0x19bb, 0x19bb, 0x19bb, 
	0x21ed, 0x21ab, 0x21ad, 0x21ad, 0x21ab, 0x21ab, 0x21ad, 0x21ad, 0x21ad, 0x21ad, 0x21ed, 0x21ed, 0x21ed, 0x21ad, 0x21ad, 0x21ad, 
	0x7b8f, 0x7b8f, 0x7b8f, 0x7b8f, 0x734f, 0x738f, 0x7b91, 0x83d1, 0x83d1, 0x8413, 0x8c13, 0x8411, 0x83d1, 0x83d1, 0x7b8f, 0x7b8f, 
	0x9c93, 0x9493, 0x9453, 0x9453, 0x9453, 0x9453, 0x9493, 0x9493, 0x9c95, 0x9c95, 0x9c93, 0x9c95, 0x9c93, 0x9c95, 0x9493, 0x9453, 
	0x9c97, 0x9495, 0x9453, 0x9453, 0x9455, 0x9c95, 0x9c95, 0x9c95, 0x9495, 0x9455, 0x9455, 0x9495, 0x9c95, 0x9c95, 0x9c95, 0x9c95, 
	0xa4d7, 0x9c95, 0x9c95, 0x9455, 0x9c95, 0x9c95, 0x9c97, 0x9c97, 0x9c95, 0x9495, 0x9455, 0x9455, 0x9c95, 0x9c95, 0x9c95, 0x9c95, 
	0xad1b, 0xa4d9, 0x9cd7, 0x9455, 0x9c95, 0xa497, 0x9c97, 0x9c95, 0x9c95, 0x9c95, 0x9455, 0x9455, 0x9495, 0x9c95, 0x9c95, 0x9c95, 
	0xbd9f, 0xb55d, 0xad19, 0x9455, 0x9c95, 0xa4d7, 0xa4d7, 0x9c97, 0x9c97, 0x9c97, 0x9c95, 0x9495, 0x9c95, 0x9c95, 0x9c95, 0x9c97, 
	0xbd9f, 0xbd9f, 0xad1b, 0x9455, 0x9c95, 0xa4d9, 0xa4d9, 0xa4d9, 0xa4d9, 0xa4d9, 0xa4d7, 0x9c97, 0x9c97, 0x9c95, 0x9c95, 0x9c97, 
	0xbd9f, 0xbd9f, 0xb55b, 0x9c95, 0x9455, 0xa4d7, 0xad19, 0xad19, 0xad19, 0xad19, 0xa4d9, 0xa4d9, 0xa4d7, 0x9c97, 0x9c95, 0x9c95, 
	0xbd9f, 0xbd9f, 0xb55d, 0xa497, 0x9455, 0xa4d7, 0xa4d9, 0xad19, 0xad19, 0xad19, 0xad19, 0xa519, 0xa4d7, 0x9c97, 0x9c95, 0x9c95, 
	0xb55d, 0xbd9d, 0xb55d, 0xa4d7, 0x9c95, 0xa497, 0xa4d9, 0xad19, 0xad19, 0xad19, 0xad19, 0xa519, 0xa4d7, 0x9c95, 0x9c95, 0x9c95, 
	0xb51b, 0xb55b, 0xb51b, 0xa4d7, 0x9c95, 0x9cd7, 0xa4d9, 0xacd9, 0xad19, 0xad19, 0xa4d9, 0xa4d9, 0x9c97, 0x9495, 0x9c95, 0x9495, 
	0xa4d7, 0xa519, 0xa519, 0xa4d7, 0x9c95, 0x9c95, 0x9c95, 0x9c95, 0x9cd7, 0x9c97, 0x9c97, 0x9c95, 0x9453, 0x9453, 0x9453, 0x8c11, 
	0x9453, 0x9495, 0x9495, 0x9453, 0x8c11, 0x83cf, 0x83cf, 0x8c13, 0x9455, 0x9453, 0x8c11, 0x8c13, 0x8c53, 0x8c11, 0x8411, 0x840f, 
	0x8411, 0x8411, 0x83cf, 0x7b8f, 0x7b8d, 0x8c11, 0xa4d7, 0xb55d, 0xb55d, 0xad19, 0x9c95, 0x8c11, 0x8411, 0x840f, 0x840f, 0x840f, 
};

/* 16 x 16  G_IM_SIZ_16b G_IM_FMT_RGBA  */
unsigned short St2farm_f_txt[] = {
	0x19bb, 0x19bb, 0x19bb, 0x19bb, 0x19bb, 0x19bb, 0x19bb, 0x19bb, 0x19bb, 0x19bb, 0x19bb, 0x19fb, 0x19fb, 0x19fb, 0x19fb, 0x19fb, 
	0x21ed, 0x21ad, 0x21ad, 0x21ed, 0x21ed, 0x29ed, 0x29ed, 0x29ed, 0x29ed, 0x29ed, 0x29ed, 0x21ed, 0x21ad, 0x21ad, 0x21ad, 0x21ad, 
	0x7bd1, 0x7b8f, 0x7b8f, 0x7b91, 0x8413, 0x8c13, 0x9455, 0x9455, 0x9455, 0x9455, 0x9415, 0x83d1, 0x7bd1, 0x7bd1, 0x7b8f, 0x7b8f, 
	0x9453, 0x9453, 0x9493, 0x9c95, 0xad19, 0xad19, 0xb55b, 0xb55b, 0xb55b, 0xb55b, 0xb55b, 0xa4d7, 0x9cd5, 0x9c95, 0x9c93, 0x9453, 
	0x9495, 0x9c95, 0x9c97, 0xad19, 0xad5b, 0xb55b, 0xb55d, 0xb55d, 0xb55d, 0xb55d, 0xb55d, 0xad1b, 0xa4d7, 0x9cd7, 0x9c97, 0x9c95, 
	0x9c95, 0x9cd7, 0xa4d9, 0xad1b, 0xb55b, 0xb55d, 0xb55d, 0xb55d, 0xb55d, 0xb55d, 0xb55d, 0xad1b, 0xa4d9, 0x9cd7, 0xa4d7, 0xad19, 
	0x9cd7, 0xa4d7, 0xad19, 0xad5b, 0xb55d, 0xb55d, 0xb55d, 0xb55d, 0xb55d, 0xb55b, 0xb55b, 0xad1b, 0xa4d9, 0xa4d7, 0xad19, 0xb55d, 
	0x9cd7, 0xa4d9, 0xad1b, 0xb55b, 0xb55d, 0xb55d, 0xb55d, 0xb55d, 0xb55d, 0xb55b, 0xb55b, 0xb55b, 0xad19, 0xad19, 0xb55d, 0xbd9f, 
	0x9cd7, 0xa4d9, 0xad1b, 0xb55b, 0xb55d, 0xb55b, 0xb55b, 0xb55d, 0xb55d, 0xad5b, 0xb55b, 0xb55d, 0xad1b, 0xb55b, 0xbd9d, 0xbd9f, 
	0x9cd7, 0xa4d9, 0xad1b, 0xb55b, 0xb55d, 0xb55b, 0xb55b, 0xb55b, 0xb55b, 0xad1b, 0xad1b, 0xb55b, 0xad1b, 0xb55d, 0xbd9f, 0xbd9f, 
	0x9c95, 0xa4d7, 0xad19, 0xad1b, 0xb55b, 0xb55b, 0xb55b, 0xb55b, 0xad1b, 0xad1b, 0xad1b, 0xad19, 0xad1b, 0xb55d, 0xbd9f, 0xbd9f, 
	0x9c95, 0x9c95, 0xa4d7, 0xad19, 0xad19, 0xad19, 0xad1b, 0xad19, 0xacd9, 0xa4d9, 0xa4d7, 0xa4d7, 0xa4d9, 0xb55b, 0xbd5d, 0xb55d, 
	0x9453, 0x8c53, 0x9453, 0x9495, 0xa4d9, 0xa4d9, 0xa4d9, 0xa4d7, 0x9c95, 0x9c95, 0x9cd5, 0x9495, 0x9c95, 0xad1b, 0xb55d, 0xb55b, 
	0x840f, 0x7bcf, 0x83cf, 0x8c53, 0xad19, 0x9cd7, 0x9c97, 0x9495, 0x8c53, 0x9455, 0xa519, 0x9495, 0x8c51, 0x9c95, 0xa519, 0xa4d7, 
	0x7bcf, 0x7b8d, 0x7bcf, 0x9c95, 0xad19, 0x9453, 0x9453, 0x8c11, 0x83cf, 0x8c11, 0xad19, 0x9c95, 0x8c11, 0x8c11, 0x9453, 0x9453, 
	0x7bcf, 0x7bcd, 0x7bcf, 0x9455, 0xa4d7, 0x8c11, 0x83cf, 0x7bcf, 0x7b8d, 0x83cf, 0xa4d7, 0x9c97, 0x8c11, 0x840f, 0x8411, 0x8411, 
};

