#include<ultra64.h>

extern Vtx ManLfarm_2c_v[];
extern Vtx ManLfarm_2c_vmcur[];
extern Tri ManLfarm_2c_tri[];
extern Lights1 ManLfarm_2c_material[];
extern Mtx ManLfarm_2c_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_2c_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_2c_v[0], 6, 0),
	gsSP1Triangle(0, 1, 2, 0),
	gsSP1Triangle(3, 4, 5, 0),

	gs_Nin_LoadTextureImage(St2farm_f_txt,G_IM_FMT_RGBA,G_IM_SIZ_16b,16,16,0,7),

	gsSPVertex(&ManLfarm_2c_v[6], 4, 0),
	gsSP1Triangle(0, 1, 2, 0),
	gsSP1Triangle(1, 3, 2, 0),
	gsSPEndDisplayList(),
};

Gfx *ManLfarm_2c_modelT = NULL;

#undef G_CC_PRIMSHADE

#undef gs_Nin_LoadTextureImage

#undef gs_Nin_SetUpTileDescrip

/* 10 vertices */

/******************************************************************************
	vertex & texture
******************************************************************************/


/******************************************************************************
	vertex & texture
******************************************************************************/

Vtx ManLfarm_2c_v[]={
	{ 3,-1,109,0, 231, -65,  -9,-54,107,255 },   /* v0 p6/V1 used 1 times */ 
	{ -15,-25,-20,0, 517, 512,  -84,-49,-70,255 },   /* v1 p6/V2 used 1 times */ 
	{ 26,-25,-18,0, -5, 511,  86,-45,-68,255 },   /* v2 p6/V3 used 1 times */ 
	{ 26,-25,-18,0, 465, 511,  86,-45,-68,255 },   /* v3 p7/V1 used 1 times */ 
	{ -15,-25,-20,0, 46, 511,  -84,-49,-70,255 },   /* v4 p7/V2 used 1 times */ 
	{ 4,20,-16,0, 243, 302,  0,85,-83,255 },   /* v5 p7/V3 used 1 times */ 
	{ 26,-25,-18,0, 517, 511,  86,-45,-68,255 },   /* v6 p5/V1 used 1 times */ 
	{ 4,20,-16,0, 240, 460,  0,85,-83,255 },   /* v7 p5/V2 used 2 times */ 
	{ 3,-1,109,0, 280, -65,  -9,-54,107,255 },   /* v8 p5/V3 used 2 times */ 
	{ -15,-25,-20,0, -5, 512,  -84,-49,-70,255 },   /* v9 p8/V2 used 1 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, 
};

