#include<ultra64.h>

extern Vtx SkiHandle_3c_v[];
extern Vtx SkiHandle_3c_vmcur[];
extern Tri SkiHandle_3c_tri[];
extern Lights1 SkiHandle_3c_material[];
extern Mtx SkiHandle_3c_matrix[];

extern unsigned short Sj4_arm_b_txt[];
extern unsigned short Sj4_arm_f_txt[];
extern unsigned short Sj4_handle_txt[];
extern unsigned short Sj4_in_f1_txt[];
extern unsigned short Sj4_in_f2_txt[];
extern unsigned short Sj4_in_floor_txt[];
extern unsigned short Sj4_in_top_txt[];
extern unsigned short Sj4_side_fL_txt[];
extern unsigned short Sj4_side_fR_txt[];
extern unsigned short Sj4_side_rL_txt[];
extern unsigned short Sj4_side_rR_txt[];
extern unsigned short Sj4_top_c_txt[];
extern unsigned short Sj4_top_f_txt[];
extern unsigned short Sj4_ura_c_txt[];
extern unsigned short Sj4_ura_f_txt[];
extern unsigned short Sj4_ura_rear_txt[];
extern unsigned short Sj4_ura_s2_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 SkiHandle_3c_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_MIRROR,4,0),
	gs_Nin_LoadTextureImage(Sj4_handle_txt,G_IM_FMT_RGBA,G_IM_SIZ_16b,16,16,0,7),

	gsSPVertex(&SkiHandle_3c_v[0], 5, 0),
	gsSP1Triangle(0, 1, 2, 0),
	gsSP1Triangle(3, 4, 2, 0),
	gsSP1Triangle(2, 1, 3, 0),
	gsSP1Triangle(2, 4, 0, 0),
	gsSP1Triangle(4, 1, 0, 0),
	gsSP1Triangle(4, 3, 1, 0),
	gsSPEndDisplayList(),
}; /* db */ 

Gfx SkiHandle_3c_modelT[] = {
	gsSPEndDisplayList()
};

#undef G_CC_PRIMSHADE

#undef gs_Nin_LoadTextureImage

#undef gs_Nin_SetUpTileDescrip

/* 5 vertices */
Vtx SkiHandle_3c_v[]={
	{ 35,0,127,0, 267, 502,  -3,0,120,255 },   /* v0 used p22/V3 3 times */
	{ 9,10,0,0, -10, 0,  60,104,0,255 },   /* v1 used p21/V2 4 times */
	{ -10,0,0,0, 267, 0,  -119,0,0,255 },   /* v2 used p22/V1 4 times */
	{ 35,0,-127,0, 267, -502,  -3,0,-119,255 },   /* v3 used p21/V3 3 times */
	{ 9,-11,0,0, 544, 0,  60,-103,0,255 },   /* v4 used p22/V2 4 times */
};


/*   0 vertices */
/* 16 x 16  G_IM_SIZ_16b G_IM_FMT_RGBA  */
unsigned short Sj4_handle_txt[] = {
	0x11c9, 0x11c9, 0x11c9, 0x11c9, 0x1189, 0x42d3, 0x84a3, 0x84a3, 0x5b99, 0x3ad3, 0x19cb, 0x1189, 0x11c9, 0x11c9, 0x11c9, 0x11c9, 
	0x11c9, 0x11c9, 0x11c9, 0x11c9, 0x1189, 0x42d3, 0x84a3, 0x84a3, 0x5b99, 0x3ad3, 0x19cb, 0x1189, 0x11c9, 0x11c9, 0x11c9, 0x11c9, 
	0x11c9, 0x11c9, 0x11c9, 0x11c9, 0x1189, 0x42d3, 0x84a3, 0x84a3, 0x5b99, 0x3ad3, 0x19cb, 0x1189, 0x11c9, 0x11c9, 0x11c9, 0x11c9, 
	0x11c9, 0x11c9, 0x11c9, 0x11c9, 0x1189, 0x42d3, 0x84a3, 0x84a3, 0x5b99, 0x3ad3, 0x19cb, 0x1189, 0x11c9, 0x11c9, 0x11c9, 0x11c9, 
	0x11c9, 0x11c9, 0x11c9, 0x11c9, 0x1189, 0x42d3, 0x84a3, 0x84a3, 0x5b99, 0x3ad3, 0x19cb, 0x1189, 0x11c9, 0x11c9, 0x11c9, 0x11c9, 
	0x11c9, 0x11c9, 0x11c9, 0x11c9, 0x1189, 0x42d3, 0x84a3, 0x84a3, 0x5b99, 0x3ad3, 0x19cb, 0x1189, 0x11c9, 0x11c9, 0x11c9, 0x11c9, 
	0x11c9, 0x11c9, 0x11c9, 0x11c9, 0x1189, 0x42d3, 0x84e3, 0x84a3, 0x5b99, 0x3ad3, 0x19cb, 0x1189, 0x11c9, 0x11c9, 0x11c9, 0x11c9, 
	0x1189, 0x1189, 0x1189, 0x1189, 0x1189, 0x42d3, 0x84e3, 0x84a3, 0x5b99, 0x3a91, 0x19c9, 0x1187, 0x1189, 0x1189, 0x1189, 0x1189, 
	0x21cb, 0x218b, 0x218b, 0x218b, 0x218b, 0x3a4f, 0x5b17, 0x5317, 0x4293, 0x320f, 0x218b, 0x218b, 0x218b, 0x218b, 0x218b, 0x218b, 
	0xc631, 0xbdef, 0xb5ad, 0xbdef, 0xbdef, 0xb5ad, 0xbdef, 0xbdef, 0xb5ad, 0xbdef, 0xc631, 0xbdef, 0xbdef, 0xc631, 0xbdef, 0xbe31, 
	0xa529, 0x9ce7, 0x8c63, 0x9ce7, 0x9ce7, 0x8c63, 0x9ce7, 0x9ce7, 0x8c63, 0x9ce7, 0x9ce7, 0x8c63, 0x9ce7, 0x9ce7, 0x8c63, 0x9ce7, 
	0xad6b, 0xa529, 0x9ce7, 0xa529, 0xa529, 0x9ce7, 0xa529, 0xa529, 0x9ce7, 0xa529, 0xa529, 0x9ce7, 0xa529, 0xa529, 0x9ce7, 0xa529, 
	0xa529, 0x9ce7, 0x94a5, 0x9ce7, 0xa529, 0x94a5, 0x9ce7, 0xa529, 0x94a5, 0x9ce7, 0xa529, 0x94a5, 0x9ce7, 0xa529, 0x94a5, 0x9ce7, 
	0xa529, 0xa529, 0x94a5, 0xa529, 0xad6b, 0x94a5, 0xa529, 0xad6b, 0x94a5, 0xa529, 0xad6b, 0x94a5, 0xa529, 0xad6b, 0x94a5, 0x9ce7, 
	0xa529, 0xa529, 0x9ce7, 0xa529, 0xad6b, 0x9ce7, 0xa529, 0xad6b, 0x9ce7, 0xa529, 0xad6b, 0x9ce7, 0xa529, 0xad6b, 0x9ce7, 0xa529, 
	0xb5ad, 0xb5ad, 0xad6b, 0xb5ad, 0xbdef, 0xad6b, 0xb5ad, 0xbdef, 0xad6b, 0xb5ad, 0xbdef, 0xad6b, 0xb5ad, 0xbdef, 0xad6b, 0xad6b, 
};

