#include<ultra64.h>

extern Vtx DEMO_Falco_ago_v[];
extern Vtx DEMO_Falco_ago_vmcur[];
extern Tri DEMO_Falco_ago_tri[];
extern Mtx DEMO_Falco_ago_matrix[];

extern unsigned short DEMO_Falco_yellow_txt[];
extern unsigned short DEMO_Fox_yellow_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_Falco_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_Fox_yellow_txt,G_IM_FMT_RGBA,G_IM_SIZ_16b,16,16,0,7),


	gsSPVertex(&DEMO_Falco_ago_v[0],6,0),
	gsSP1Quadrangle(0, 1, 2, 3, 0),
	gsSP2Triangles(0, 4, 1, 0, 2, 5, 3, 0),
	gs_Nin_LoadTextureImage(DEMO_Falco_yellow_txt,G_IM_FMT_RGBA,G_IM_SIZ_16b,16,16,0,7),

	gsSPVertex(&DEMO_Falco_ago_v[6],10,0),
	gsSP2Triangles(0, 1, 2, 0, 2, 3, 4, 0),
	gsSP2Triangles(4, 0, 2, 0, 4, 3, 5, 0),
	gsSP2Triangles(4, 6, 0, 0, 5, 6, 4, 0),
	gsSP2Triangles(0, 6, 7, 0, 7, 6, 5, 0),
	gsSP2Triangles(8, 1, 0, 0, 8, 0, 7, 0),
	gsSP2Triangles(5, 9, 7, 0, 7, 9, 8, 0),
	gsSPEndDisplayList(),
}; /* o1 */ 

/* 12 vertices */
Vtx DEMO_Falco_ago_v[]={
	{    24,    -8,   -28,     0,    67,   694,    46,    52,   -98,     0},	/* 0 */
	{    24,    -8,    28,     0,   444,   694,    46,    52,    97,     0},	/* 1 */
	{    -3,    -8,    38,     0,   512,   512,     0,  -119,     0,     0},	/* 2 */
	{    -3,    -8,   -38,     0,     0,   512,     0,  -119,     0,     0},	/* 3 */
	{    78,    -9,     0,     0,   256,  1060,    51,    45,   -99,     0},	/* 4 */
	{   -30,    -8,     0,     0,   256,   329,   -53,   107,     0,     0},	/* 5 */
	{     7,    11,     0,     0,   256,   581,   -17,   119,     0,     0},	/* 6 */
	{   -30,    -8,     0,     0,   256,   329,   -53,   107,     0,     0},	/* 7 */
	{    -3,    -8,    38,     0,   512,   512,   -20,   106,    51,     0},	/* 8 */
	{    24,    -8,    28,     0,   444,   694,    46,    52,    97,     0},	/* 9 */
	{    34,    -1,    20,     0,   387,   764,    26,    98,    64,     0},	/* 10 */
	{    78,    -9,     0,     0,   256,  1060,    51,    45,   -99,     0},	/* 11 */
	{    45,     6,     0,     0,   256,   833,    33,   115,     0,     0},	/* 12 */
	{    34,    -1,   -20,     0,   124,   764,    26,    98,   -65,     0},	/* 13 */
	{    -3,    -8,   -38,     0,     0,   512,   -20,   106,   -52,     0},	/* 14 */
	{    24,    -8,   -28,     0,    67,   694,    46,    52,   -98,     0},	/* 15 */
};


/*   0 vertices */
/*   1 Materials */

#define	LDIRX	0
#define	LDIRY	0
#define	LDIRZ	120
#define	AMBDIV	1
