#include<ultra64.h>

extern Vtx ManLhand_b_v[];
extern Vtx ManLhand_b_vmcur[];
extern Tri ManLhand_b_tri[];
extern Lights1 ManLhand_b_material[];
extern Mtx ManLhand_b_matrix[];

extern unsigned short Sm1hand_b_txt[];
extern unsigned short Sm1hand_f_txt[];
extern unsigned short Sm1hand_s_txt[];
extern unsigned short Sm1hand_t_txt[];
extern unsigned short Sm1hara_txt[];
extern unsigned short Sm1jacket_b_txt[];
extern unsigned short Sm1jacket_f_txt[];
extern unsigned short Sm1jacket_s_txt[];
extern unsigned short Sm1jacket_t_txt[];
extern unsigned short Sm1loarm_txt[];
extern unsigned short Sm1met_b_txt[];
extern unsigned short Sm1met_f_txt[];
extern unsigned short Sm1met_gl_txt[];
extern unsigned short Sm1met_s_txt[];
extern unsigned short Sm1met_t_txt[];
extern unsigned short Sm1momo_txt[];
extern unsigned short Sm1neck_txt[];
extern unsigned short Sm1shoes_txt[];
extern unsigned short Sm1shoes_b_txt[];
extern unsigned short Sm1sune_txt[];
extern unsigned short Sm1uparm_txt[];
extern unsigned short Sm1waist_b_txt[];
extern unsigned short Sm1waist_f_txt[];
extern unsigned short Sm1waist_s_txt[];
extern unsigned short Sshoes_bottom_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 ======== */


/* ======== g1 ======== */


/* ======== db ======== */

Gfx ManLhand_b_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,8,8,0,0,G_TX_CLAMP,3,0,G_TX_CLAMP,3,0),
	gs_Nin_LoadTextureImage(Sm1hand_b_txt,G_IM_FMT_RGBA,G_IM_SIZ_16b,8,8,0,7),

	gsSPVertex(&ManLhand_b_v[0], 4, 0),
	gsSP1Triangle(0, 1, 2, 0),
	gsSP1Triangle(2, 3, 0, 0),

	gs_Nin_LoadTextureImage(Sm1hand_f_txt,G_IM_FMT_RGBA,G_IM_SIZ_16b,8,8,0,7),

	gsSPVertex(&ManLhand_b_v[4], 3, 0),
	gsSP1Triangle(0, 1, 2, 0),

	gs_Nin_LoadTextureImage(Sm1hand_s_txt,G_IM_FMT_RGBA,G_IM_SIZ_16b,8,8,0,7),

	gsSPVertex(&ManLhand_b_v[7], 3, 0),
	gsSP1Triangle(0, 1, 2, 0),

	gs_Nin_LoadTextureImage(Sm1hand_t_txt,G_IM_FMT_RGBA,G_IM_SIZ_16b,8,8,0,7),

	gsSPVertex(&ManLhand_b_v[10], 4, 0),
	gsSP1Triangle(0, 1, 2, 0),
	gsSP1Triangle(2, 3, 0, 0),
	gsSPEndDisplayList(),
}; /* db */ 

Gfx ManLhand_b_modelT[] = {
	gsSPEndDisplayList()
};

#undef G_CC_PRIMSHADE

#undef gs_Nin_LoadTextureImage

#undef gs_Nin_SetUpTileDescrip

/* 14 vertices */
Vtx ManLhand_b_v[]={
	{ 24,0,-5,0, 250, 0,  90,0,-79,255 },   /* v0 used p1/V1 2 times */
	{ 27,-1,50,0, 266, 199,  85,0,85,255 },   /* v1 used p1/V2 1 times */
	{ -19,-20,56,0, 5, 223,  -27,-111,32,255 },   /* v2 used p1/V3 2 times */
	{ -14,0,-3,0, 35, 5,  -97,0,-69,255 },   /* v3 used p6/V2 1 times */
	{ -19,-20,56,0, 37, 119,  -27,-111,32,255 },   /* v4 used p3/V1 1 times */
	{ 27,-1,50,0, 290, 122,  85,0,85,255 },   /* v5 used p3/V2 1 times */
	{ -19,20,56,0, 47, 323,  -27,112,35,255 },   /* v6 used p3/V3 1 times */
	{ -14,0,-3,0, -69, 105,  -97,0,-69,255 },   /* v7 used p4/V1 1 times */
	{ -19,-20,56,0, 235, 23,  -27,-111,32,255 },   /* v8 used p4/V2 1 times */
	{ -19,20,56,0, 236, 254,  -27,112,35,255 },   /* v9 used p4/V3 1 times */
	{ 24,0,-5,0, 5, 0,  90,0,-79,255 },   /* v10 used p5/V1 2 times */
	{ -14,0,-3,0, 220, 5,  -97,0,-69,255 },   /* v11 used p5/V2 1 times */
	{ -19,20,56,0, 249, 223,  -27,112,35,255 },   /* v12 used p5/V3 2 times */
	{ 27,-1,50,0, -10, 199,  85,0,85,255 },   /* v13 used p2/V2 1 times */
};


/*   0 vertices */
/* 8 x 8  G_IM_SIZ_16b G_IM_FMT_RGBA  */
unsigned short Sm1hand_b_txt[] = {
	0xcd05, 0xbcc3, 0xbc83, 0xc4c3, 0xe583, 0xfe85, 0xfe41, 0xfe41, 
	0xbc83, 0xa401, 0xac41, 0xdd43, 0xfec9, 0xee09, 0xe581, 0xf601, 
	0xd501, 0xd501, 0xedc5, 0xfecb, 0xcd49, 0x7b03, 0xbcc5, 0xd545, 
	0xf601, 0xf601, 0xc505, 0x7305, 0x841, 0x1, 0x4181, 0x7b05, 
	0xee4f, 0xf645, 0x5a41, 0x841, 0x4a01, 0x2901, 0x3101, 0x2101, 
	0xc50b, 0xfe91, 0xdd83, 0x72c1, 0xdd8b, 0x93c3, 0xd58b, 0x7b03, 
	0xdd89, 0xc54f, 0xfed1, 0xac43, 0xe613, 0xa403, 0xe651, 0x9bc3, 
	0xf64d, 0x8b41, 0xd58b, 0x9bc3, 0xde11, 0x9bc3, 0xe60f, 0x93c3, 
};

/* 8 x 8  G_IM_SIZ_16b G_IM_FMT_RGBA  */
unsigned short Sm1hand_f_txt[] = {
	0x8b81, 0xddcd, 0x93c3, 0xdd8d, 0x8b83, 0xc50b, 0x7b01, 0xd58b, 
	0x6a81, 0x8b87, 0x5a41, 0x8347, 0x5201, 0x6ac5, 0x3981, 0x6245, 
	0x5201, 0x6ac5, 0x4181, 0x5a45, 0x3981, 0x49c3, 0x3101, 0x4181, 
	0x49c1, 0x7b05, 0x5201, 0x7305, 0x49c1, 0x6243, 0x4181, 0x7b05, 
	0x5a41, 0xac89, 0x6281, 0xac89, 0x8343, 0xc50b, 0x8341, 0xee0d, 
	0x8341, 0xe60d, 0x93c3, 0xe5cd, 0x9c03, 0xe60d, 0x9bc3, 0xfe8f, 
	0x9383, 0xe5cd, 0x9c03, 0xe5cd, 0x9bc3, 0xddcb, 0x9bc3, 0xf68d, 
	0x93c1, 0xddcb, 0x9c03, 0xdd8b, 0x9c03, 0xdd8b, 0x9bc3, 0xf64d, 
};

/* 8 x 8  G_IM_SIZ_16b G_IM_FMT_RGBA  */
unsigned short Sm1hand_s_txt[] = {
	0x3141, 0x6241, 0x9381, 0xccc1, 0xf605, 0xbc83, 0x9bc1, 0xb441, 
	0xa3c1, 0xdd41, 0xfe41, 0xfec7, 0xe587, 0xb441, 0xe581, 0xdd81, 
	0xedc1, 0xfe41, 0xfe85, 0xa445, 0x72c1, 0xf645, 0xfe47, 0xe583, 
	0xfe41, 0xfe85, 0x93c3, 0x1, 0x1, 0x5243, 0xa401, 0xd541, 
	0xfe41, 0xf605, 0x5201, 0x20c1, 0x3981, 0x1081, 0xc4c5, 0xfe83, 
	0xfe41, 0xfe43, 0xa401, 0xc4c1, 0xe581, 0x9381, 0xbcc9, 0xfecb, 
	0xfe41, 0xfe41, 0xf601, 0xfe01, 0xf601, 0xf601, 0xd541, 0xee0b, 
	0xfe41, 0xfe43, 0xfe41, 0xfe01, 0xfe01, 0xfe01, 0xfe01, 0xfe01, 
};

/* 8 x 8  G_IM_SIZ_16b G_IM_FMT_RGBA  */
unsigned short Sm1hand_t_txt[] = {
	0xfe41, 0xc447, 0xb389, 0xb389, 0xbbc9, 0xb389, 0xd489, 0xfe41, 
	0xfe81, 0xc2d1, 0xe075, 0xd831, 0xd02d, 0xe033, 0xf417, 0xfe81, 
	0xfe41, 0xfe81, 0xe317, 0xe833, 0xe873, 0xfc59, 0xfec1, 0xfe41, 
	0xedc1, 0xf641, 0xf641, 0xe317, 0xfc1b, 0xf641, 0xfe41, 0xfe01, 
	0xf601, 0xfe45, 0xf601, 0xf643, 0xee01, 0xedc3, 0xf601, 0xf605, 
	0xd541, 0xf643, 0xe5c1, 0xf603, 0xedc1, 0xedc3, 0xe5c1, 0xfe43, 
	0x9bc1, 0xe60b, 0x9bc3, 0xe5c9, 0xbc81, 0xdd43, 0x93c1, 0xfe47, 
	0x8b81, 0xe60d, 0x8343, 0xe5cd, 0xa403, 0xe5c9, 0x9381, 0xfe8b, 
};

