#include<ultra64.h>

extern Vtx ManLuarm_2c_v[];
extern Vtx ManLuarm_2c_vmcur[];
extern Tri ManLuarm_2c_tri[];
extern Lights1 ManLuarm_2c_material[];
extern Mtx ManLuarm_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 */


/* ======== g2 ======== */

static	Gfx ManLuarm_2c_grp_g2[]={

	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(St2uarm_b_txt,G_IM_FMT_RGBA,G_IM_SIZ_16b,16,16,0,7),

	gsSPVertex(&ManLuarm_2c_v[0], 5, 0),
	gsSP1Triangle(0, 1, 2, 0),
	gsSP1Triangle(1, 0, 3, 0),
	gsSP1Triangle(4, 0, 2, 0),
	gsSP1Triangle(3, 0, 4, 0),

	gs_Nin_LoadTextureImage(St2uarm_f_txt,G_IM_FMT_RGBA,G_IM_SIZ_16b,16,16,0,7),

	gsSPVertex(&ManLuarm_2c_v[5], 4, 0),
	gsSP1Triangle(0, 1, 2, 0),
	gsSP1Triangle(2, 3, 0, 0),
	gsSPEndDisplayList(),
}; /* g2 */ 

/* ======== g1 ======== */

static	Gfx ManLuarm_2c_grp_g1[]={
	gsSPDisplayList(ManLuarm_2c_grp_g2),
	gsSPEndDisplayList(),
}; /* g1 */ 

/* ======== db ======== */

Gfx ManLuarm_2c_model[]={
	gsSPDisplayList(ManLuarm_2c_grp_g1),
	gsSPEndDisplayList(),
}; /* db */ 

Gfx *ManLuarm_2c_modelT = NULL;

#undef G_CC_PRIMSHADE

#undef gs_Nin_LoadTextureImage

#undef gs_Nin_SetUpTileDescrip

/* 9 vertices */
Vtx ManLuarm_2c_v[]={
	{ 3,-20,-15,0, 247, 430,  5,-105,-56,255 },   /* v0 p11/V2 used 4 times */ 
	{ 30,28,-8,0, -28, 481,  84,48,-68,255 },   /* v1 p11/V1 used 2 times */ 
	{ 26,-3,81,0, 0, 0,  84,43,72,255 },   /* v2 p9/V3 used 2 times */ 
	{ -27,29,-14,0, 558, 506,  -54,102,-29,255 },   /* v3 p11/V3 used 2 times */ 
	{ -17,-3,80,0, 444, 0,  -94,-60,45,255 },   /* v4 p8/V1 used 2 times */ 
	{ -27,29,-14,0, 46, 506,  -54,102,-29,255 },   /* v5 p12/V3 used 2 times */ 
	{ -17,-3,80,0, 141, 0,  -94,-60,45,255 },   /* v6 p7/V2 used 1 times */ 
	{ 26,-3,81,0, 512, 0,  84,43,72,255 },   /* v7 p12/V1 used 2 times */ 
	{ 30,28,-8,0, 535, 481,  84,48,-68,255 },   /* v8 p12/V2 used 1 times */ 
};


/*   0 vertices */
/* 16 x 16  G_IM_SIZ_16b G_IM_FMT_RGBA  */
unsigned short St2uarm_b_txt[] = {
	0x83cf, 0x83cf, 0x83cf, 0x8c11, 0x8c11, 0xa4d7, 0xbd9f, 0xb55d, 0xacd9, 0x9455, 0x8c11, 0x83cf, 0x83cf, 0x83cf, 0x83cf, 0x83cf, 
	0x9c95, 0xa495, 0x9c95, 0x9453, 0x9c95, 0xacd9, 0xb55b, 0xad19, 0xa4d9, 0xa4d7, 0xa495, 0x9453, 0x83cf, 0x83cf, 0x8bcf, 0x8c0f, 
	0xad19, 0xad19, 0xa4d7, 0x9c55, 0x9c95, 0xacd9, 0xad19, 0xad19, 0xad19, 0xad19, 0xacd9, 0xa497, 0x9453, 0x8c11, 0x8c11, 0x8c51, 
	0xb519, 0xad19, 0x9c95, 0x9c95, 0xa4d7, 0xad19, 0xad19, 0xad19, 0xb51b, 0xad19, 0xa4d7, 0xa4d5, 0x9453, 0x9451, 0x9453, 0x9451, 
	0xb55b, 0xb51b, 0xa495, 0x9c95, 0xad19, 0xb519, 0xb51b, 0xb55b, 0xb51b, 0xad19, 0xa4d7, 0x9c95, 0x9453, 0x9453, 0x9453, 0x9453, 
	0xa4d7, 0x9c57, 0x8bd1, 0x9413, 0xacd7, 0xad19, 0xbd5b, 0xbd9d, 0xbd5b, 0xb519, 0xad17, 0xa495, 0x9c93, 0x9453, 0x9453, 0x9453, 
	0x41d1, 0x39d1, 0x318f, 0x398f, 0x4a51, 0x4a51, 0x5a93, 0x62d3, 0x7353, 0x7b93, 0x7391, 0x83d1, 0x83d1, 0x8c11, 0x9453, 0x9c93, 
	0x39d3, 0x39d3, 0x39d5, 0x41d5, 0x4217, 0x4a17, 0x4217, 0x41d5, 0x39d5, 0x39d3, 0x3191, 0x3991, 0x398f, 0x318d, 0x4a4d, 0x6b0f, 
	0x4a17, 0x4215, 0x41d3, 0x39d3, 0x39d3, 0x41d3, 0x41d3, 0x4215, 0x4215, 0x4215, 0x39d3, 0x39d3, 0x39d3, 0x39d3, 0x39d3, 0x3191, 
	0x62df, 0x5add, 0x5a9b, 0x5259, 0x4a17, 0x41d3, 0x41d3, 0x4215, 0x4a17, 0x4215, 0x41d3, 0x39d1, 0x3191, 0x39d1, 0x39d3, 0x4215, 
	0x6b61, 0x6b61, 0x6b21, 0x631f, 0x5add, 0x529b, 0x5259, 0x5299, 0x5299, 0x4a59, 0x4a57, 0x4a17, 0x4215, 0x39d3, 0x39d3, 0x39d3, 
	0x6b61, 0x6b63, 0x6b61, 0x6b1f, 0x631f, 0x62dd, 0x5add, 0x5a9b, 0x529b, 0x5299, 0x5259, 0x4a59, 0x4a57, 0x4215, 0x39d3, 0x39d3, 
	0x6b61, 0x6b63, 0x6b63, 0x6b61, 0x631f, 0x631f, 0x62dd, 0x5add, 0x5adb, 0x529b, 0x5259, 0x4a59, 0x4a57, 0x4215, 0x39d3, 0x39d3, 
	0x6b61, 0x7363, 0x7363, 0x6b61, 0x6b61, 0x6b1f, 0x62dd, 0x5add, 0x5adb, 0x529b, 0x5259, 0x4a59, 0x4a57, 0x4215, 0x39d3, 0x39d3, 
	0x631f, 0x6b1f, 0x6b1f, 0x631f, 0x631f, 0x5add, 0x5a9b, 0x5299, 0x5259, 0x5259, 0x4a57, 0x4a17, 0x4215, 0x41d3, 0x39d3, 0x39d3, 
	0x5299, 0x5259, 0x4a57, 0x4a15, 0x4215, 0x4215, 0x4215, 0x4215, 0x4215, 0x41d3, 0x39d3, 0x39d3, 0x39d3, 0x39d1, 0x39d1, 0x39d1, 
};

/* 16 x 16  G_IM_SIZ_16b G_IM_FMT_RGBA  */
unsigned short St2uarm_f_txt[] = {
	0x83cf, 0x83cf, 0x83cf, 0x8bcf, 0x8c0f, 0x9453, 0x9c95, 0xa4d7, 0xa4d7, 0xacd9, 0xb519, 0xad19, 0xa4d7, 0x9453, 0x8c11, 0x83cf, 
	0x8c0f, 0x83cf, 0x8bcf, 0x8bcf, 0x9411, 0xa4d7, 0xb55d, 0xbd9d, 0xbd9d, 0xbd9d, 0xbd9f, 0xc59f, 0xbd5d, 0xb519, 0xacd7, 0x9c95, 
	0x8c11, 0x8bcf, 0x8bcf, 0x8c11, 0xa4d7, 0xbd9d, 0xc5e1, 0xc5e1, 0xc5e1, 0xc5e1, 0xc5e1, 0xc5e1, 0xc5df, 0xbd9f, 0xbd5d, 0xad19, 
	0x8c51, 0x8c11, 0x8c11, 0x9453, 0xb55b, 0xc5e1, 0xc5e1, 0xc5e1, 0xc5e1, 0xc5e1, 0xc5e1, 0xc5e1, 0xc5e1, 0xc59f, 0xbd5d, 0xb519, 
	0x9451, 0x9451, 0x8c11, 0x9c95, 0xbd5d, 0xc5e1, 0xc5e1, 0xc5e1, 0xc5e1, 0xc5e1, 0xc5e1, 0xc5e1, 0xc5df, 0xbd9f, 0xbd5d, 0xb55b, 
	0x9493, 0x9453, 0x8c11, 0xa495, 0xbd9f, 0xc5e1, 0xc5e1, 0xc5e1, 0xc5e1, 0xc5e1, 0xc59f, 0xc59f, 0xc59d, 0xb55b, 0xa4d7, 0x9c97, 
	0x8c11, 0x8c11, 0x9411, 0xa495, 0xbd9d, 0xce21, 0xce21, 0xce21, 0xce21, 0xce21, 0xc5df, 0xa4d9, 0x83d5, 0x5291, 0x398d, 0x318f, 
	0x41d3, 0x39cf, 0x41cf, 0x5291, 0x6b13, 0x83d7, 0x9459, 0x945b, 0x9459, 0x7397, 0x5ad5, 0x39d1, 0x3191, 0x3193, 0x39d3, 0x39d3, 
	0x4217, 0x4215, 0x39d5, 0x39d5, 0x39d3, 0x3191, 0x3191, 0x39d3, 0x39d3, 0x39d5, 0x39d5, 0x41d5, 0x39d3, 0x4215, 0x5259, 0x4a57, 
	0x4215, 0x4215, 0x39d3, 0x39d3, 0x39d3, 0x39d3, 0x41d3, 0x41d5, 0x4215, 0x4215, 0x4215, 0x4215, 0x4a57, 0x5a9b, 0x631f, 0x631f, 
	0x41d3, 0x39d3, 0x3991, 0x39d1, 0x39d3, 0x4215, 0x4215, 0x4215, 0x4a57, 0x4a57, 0x5259, 0x529b, 0x5add, 0x631f, 0x6b61, 0x6b21, 
	0x39d3, 0x39d3, 0x39d1, 0x4215, 0x4a57, 0x4a57, 0x4a57, 0x4a59, 0x5299, 0x5a9b, 0x5add, 0x631f, 0x6b21, 0x6b61, 0x6b61, 0x6b61, 
	0x39d3, 0x39d1, 0x39d3, 0x4215, 0x4a57, 0x4a57, 0x5259, 0x5299, 0x529b, 0x5add, 0x62dd, 0x6b21, 0x6b63, 0x6b63, 0x6b63, 0x6b61, 
	0x39d3, 0x39d3, 0x39d1, 0x39d3, 0x4215, 0x4a57, 0x4a59, 0x5299, 0x529b, 0x5adb, 0x631f, 0x6b1f, 0x6b61, 0x7363, 0x6b61, 0x6b61, 
	0x39d3, 0x3991, 0x3991, 0x39d3, 0x39d3, 0x4215, 0x4a57, 0x4a59, 0x5299, 0x529b, 0x5add, 0x5add, 0x631f, 0x631f, 0x631f, 0x631f, 
	0x39d1, 0x3191, 0x3991, 0x39d1, 0x39d1, 0x39d3, 0x41d3, 0x4215, 0x4a17, 0x4a57, 0x4a57, 0x5259, 0x5299, 0x529b, 0x5299, 0x5299, 
};

