#include<ultra64.h>

extern Vtx DEMO_Slippy_ago_v[];
extern Vtx DEMO_Slippy_ago_vmcur[];
extern Tri DEMO_Slippy_ago_tri[];
extern Mtx DEMO_Slippy_ago_matrix[];

extern unsigned short DEMO_FOXwhite_txt[];
extern unsigned short DEMO_Falco_red_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)

/* main display list */


/* ======== o1 ======== */

Gfx DEMO_Slippy_ago[]={

	gs_Nin_SetUpTileDescrip(G_IM_FMT_RGBA,G_IM_SIZ_16b,16,16,0,0,G_TX_MIRROR,4,0,G_TX_MIRROR,4,0),
	gs_Nin_LoadTextureImage(DEMO_FOXwhite_txt,G_IM_FMT_RGBA,G_IM_SIZ_16b,16,16,0,7),

	gsSPVertex(&DEMO_Slippy_ago_v[3], 14, 0),
	gsSP1Triangle(0, 1, 2, 0),
	gsSP1Triangle(3, 4, 0, 0),
	gsSP1Triangle(5, 0, 4, 0),
	gsSP1Triangle(0, 6, 3, 0),
	gsSP1Triangle(1, 0, 5, 0),
	gsSP1Triangle(7, 3, 6, 0),
	gsSP1Triangle(6, 8, 7, 0),
	gsSP1Triangle(9, 10, 11, 0),
	gsSP1Triangle(12, 10, 9, 0),
	gsSP1Triangle(10, 12, 13, 0),
	gsSP1Triangle(5, 11, 1, 0),
	gsSP1Triangle(9, 5, 4, 0),
	gsSP1Triangle(11, 5, 9, 0),
	gsSP1Triangle(2, 1, 11, 0),
	gsSPVertex(&DEMO_Slippy_ago_v[7], 1, 0),
	gsSPVertex(&DEMO_Slippy_ago_v[10], 3, 1),
	gsSPVertex(&DEMO_Slippy_ago_v[15], 4, 4),
	gsSP1Triangle(5, 4, 6, 0),
	gsSP1Triangle(3, 6, 4, 0),
	gsSP1Triangle(6, 2, 5, 0),
	gsSP1Triangle(0, 7, 3, 0),
	gsSP1Triangle(1, 2, 6, 0),
	gsSP1Triangle(6, 3, 7, 0),
	gsSP1Triangle(6, 7, 1, 0),

	gs_Nin_LoadTextureImage(DEMO_Falco_red_txt,G_IM_FMT_RGBA,G_IM_SIZ_16b,16,16,0,7),

	gsSPVertex(&DEMO_Slippy_ago_v[19], 4, 0),
	gsSP1Triangle(0, 1, 2, 0),
	gsSP1Triangle(0, 3, 1, 0),
	gsSPEndDisplayList(),
}; /* o1 */ 

/* 23 vertices */
Vtx DEMO_Slippy_ago_v[]={
	{ -10,-19,-60,0, 0, 0, -10, -117, -17, 0 },   /* v0 p20/V1 used 1 times */ 
	{ -48,-9,-32,0, 0, 0, -39, -111, -14, 0 },   /* v1 p20/V2 used 1 times */ 
	{ -13,6,-60,0, 0, 0, -11, 75, -93, 0 },   /* v2 p20/V3 used 1 times */ 
	{ -13,6,-60,0, -255, 921, -11, 75, -93, 0 },   /* v3 p19/V1 used 5 times */ 
	{ 26,-12,-60,0, -255, 806, 52, -4, -108, 0 },   /* v4 p24/V1 used 4 times */ 
	{ -10,-19,-60,0, -255, 1055, -10, -117, -17, 0 },   /* v5 p15/V1 used 2 times */ 
	{ -24,17,-30,0, 0, 914, -67, 94, -30, 0 },   /* v6 p19/V3 used 3 times */ 
	{ 18,22,-30,0, 0, 636, 33, 112, -26, 0 },   /* v7 p14/V3 used 4 times */ 
	{ 55,8,-30,0, 0, 512, 65, 87, -51, 0 },   /* v8 p14/V1 used 5 times */ 
	{ -48,-9,-32,0, -13, 1211, -87, 81, -12, 0 },   /* v9 p19/V2 used 3 times */ 
	{ -24,17,30,0, 512, 914, -75, 91, 19, 0 },   /* v10 p22/V3 used 4 times */ 
	{ -48,-9,32,0, 525, 1211, -91, 63, 42, 0 },   /* v11 p3/V2 used 3 times */ 
	{ 55,8,30,0, 512, 512, 65, 94, 36, 0 },   /* v12 p26/V1 used 7 times */ 
	{ 77,-19,15,0, 383, 552, 9, -117, 17, 0 },   /* v13 p16/V1 used 3 times */ 
	{ 77,-19,-15,0, 128, 552, 97, 62, -34, 0 },   /* v14 p23/V1 used 4 times */ 
	{ 26,-12,60,0, 768, 806, 50, -47, 97, 0 },   /* v15 p16/V2 used 4 times */ 
	{ -10,-19,60,0, 768, 1055, -11, -118, 7, 0 },   /* v16 p16/V3 used 3 times */ 
	{ -13,6,60,0, 768, 921, -11, 75, 92, 0 },   /* v17 p21/V3 used 6 times */ 
	{ 18,22,30,0, 512, 636, 27, 110, 37, 0 },   /* v18 p22/V2 used 3 times */ 
	{ -10,-19,60,0, 512, 512, -11, -118, 7, 0 },   /* v19 p17/V1 used 2 times */ 
	{ 77,-19,-15,0, 192, 885, 2, -119, -5, 0 },   /* v20 p17/V3 used 2 times */ 
	{ 77,-19,15,0, 319, 885, 9, -117, 17, 0 },   /* v21 p18/V3 used 1 times */ 
	{ -10,-19,-60,0, 0, 512, -10, -117, -17, 0 },   /* v22 p17/V2 used 1 times */ 
};


/*   0 vertices */
/*   1 Materials */

#define	LDIRX	0
#define	LDIRY	0
#define	LDIRZ	120
#define	AMBDIV	1
/* 16 x 16  G_IM_SIZ_16b G_IM_FMT_RGBA  */
unsigned short DEMO_FOXwhite_txt[] = {
	0xff23, 0xff23, 0xff23, 0xf6e1, 0xf6e1, 0xf721, 0xee9f, 0xee5d, 0xf6e1, 0xff23, 0xff21, 0xfee1, 0xee5d, 0xee9f, 0xff23, 0xff23, 
	0xff23, 0xff23, 0xfee1, 0xf6e1, 0xf6e1, 0xf723, 0xf69f, 0xee5f, 0xf6e1, 0xff63, 0xff63, 0xff21, 0xf69f, 0xee9f, 0xf721, 0xff23, 
	0xff23, 0xf6e1, 0xf6e1, 0xf723, 0xf6e1, 0xf6df, 0xf69f, 0xf69f, 0xff21, 0xff23, 0xff63, 0xff63, 0xf6e1, 0xf6e1, 0xf6e1, 0xf6e1, 
	0xf6e1, 0xf6a1, 0xfee3, 0xf725, 0xf721, 0xf69f, 0xee5d, 0xee5d, 0xf6e1, 0xf6df, 0xf6df, 0xff63, 0xf723, 0xeedf, 0xee9f, 0xf6e1, 
	0xf6e1, 0xf6e1, 0xff21, 0xff63, 0xf721, 0xf6df, 0xee5d, 0xee5d, 0xf6e1, 0xf69f, 0xf69f, 0xf6e1, 0xf721, 0xee9f, 0xee9f, 0xf6e1, 
	0xf6e1, 0xee9f, 0xf6e1, 0xf723, 0xeee1, 0xee9f, 0xee5d, 0xf69f, 0xf6e1, 0xf6e1, 0xf69f, 0xf69f, 0xf6e1, 0xeee1, 0xeee1, 0xf6e1, 
	0xee9f, 0xee5d, 0xf6e1, 0xff23, 0xf721, 0xf6df, 0xf69f, 0xf69f, 0xff21, 0xf6e1, 0xf69f, 0xf6e1, 0xf6e1, 0xee9f, 0xf6e1, 0xf6e3, 
	0xee9f, 0xee5d, 0xf6e1, 0xff21, 0xf6e1, 0xf6e1, 0xf6df, 0xf69f, 0xff21, 0xff23, 0xf6e1, 0xf6df, 0xf69f, 0xee5d, 0xee5f, 0xf6a1, 
	0xee5d, 0xee5d, 0xf6e1, 0xff21, 0xf6df, 0xf69f, 0xf69f, 0xf69f, 0xff63, 0xff63, 0xfee1, 0xf6df, 0xf69f, 0xee5f, 0xee5f, 0xee9f, 
	0xee5d, 0xee5d, 0xf6e1, 0xff63, 0xf6e1, 0xf69f, 0xf65f, 0xf6df, 0xf723, 0xff21, 0xf6e1, 0xf6e1, 0xf6e1, 0xf6e1, 0xf69f, 0xee9f, 
	0xee9f, 0xf6e1, 0xff23, 0xff23, 0xf6df, 0xf69f, 0xf69f, 0xee9f, 0xf6e1, 0xf6e1, 0xf6e1, 0xf6e1, 0xf723, 0xf6e1, 0xee9f, 0xee5f, 
	0xf69f, 0xf6e1, 0xff23, 0xff23, 0xf69f, 0xf69f, 0xee9f, 0xee9f, 0xee9f, 0xf69f, 0xf6df, 0xfee1, 0xf723, 0xf6e1, 0xf69f, 0xf69f, 
	0xf6e1, 0xf723, 0xff63, 0xff63, 0xff21, 0xf6e1, 0xee9f, 0xee9f, 0xee9f, 0xf69f, 0xf6df, 0xf6e1, 0xf721, 0xf721, 0xf6e1, 0xf6e1, 
	0xf6e3, 0xf723, 0xff65, 0xff63, 0xff23, 0xfee1, 0xf69f, 0xee9f, 0xeee1, 0xf6e1, 0xf6df, 0xee9f, 0xf69f, 0xf6e1, 0xff23, 0xfee3, 
	0xff23, 0xf723, 0xf723, 0xf721, 0xf6e1, 0xf6e1, 0xee9f, 0xeea1, 0xf6e1, 0xf721, 0xf6df, 0xee5d, 0xf69f, 0xf6e3, 0xff67, 0xff25, 
	0xff23, 0xff23, 0xf721, 0xf6e1, 0xf6e1, 0xf69f, 0xee5f, 0xee9f, 0xf6e1, 0xff21, 0xfee1, 0xf69f, 0xee9f, 0xf723, 0xff67, 0xff25, 
};
