#include<ultra64.h>

extern Vtx CN_ATC_03_v[];
extern Vtx CN_ATC_03_vmcur[];
extern Tri CN_ATC_03_tri[];
extern Mtx CN_ATC_03_matrix[];

extern unsigned short CN_Bill_04_txt[];
extern unsigned short CN_Bill_07_2_txt[];
extern unsigned short CN_Billroof_txt[];
extern unsigned short CN_BossTX_01_txt[];
extern unsigned short CN_BossTX_04_txt[];
extern unsigned short CN_BossTX_11_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 CN_ATC_03[]={

	gs_Nin_SetUpTileDescrip(G_IM_FMT_RGBA,G_IM_SIZ_16b,32,32,0,0,G_TX_WRAP,5,0,G_TX_WRAP,5,0),
	gs_Nin_LoadTextureImage(CN_BossTX_01_txt,G_IM_FMT_RGBA,G_IM_SIZ_16b,32,32,0,7),


	gsSPVertex(&CN_ATC_03_v[0],8,0),
	gsSP1Quadrangle(0, 1, 2, 3, 0),
	gsSP1Quadrangle(4, 5, 6, 7, 0),
	gs_Nin_LoadTextureImage(CN_BossTX_04_txt,G_IM_FMT_RGBA,G_IM_SIZ_16b,32,32,0,7),


	gsSPVertex(&CN_ATC_03_v[8],8,0),
	gsSP1Quadrangle(0, 1, 2, 3, 0),
	gsSP1Quadrangle(4, 1, 0, 5, 0),
	gsSP1Quadrangle(6, 4, 5, 7, 0),
	gs_Nin_SetUpTileDescrip(G_IM_FMT_RGBA,G_IM_SIZ_16b,32,32,0,0,G_TX_MIRROR,5,0,G_TX_MIRROR,5,0),
	gs_Nin_LoadTextureImage(CN_BossTX_11_txt,G_IM_FMT_RGBA,G_IM_SIZ_16b,32,32,0,7),

	gsSPVertex(&CN_ATC_03_v[16],4,0),
	gsSP1Quadrangle(0, 1, 2, 3, 0),
	gsSPEndDisplayList(),
}; /* o1 */ 

/* 20 vertices */
Vtx CN_ATC_03_v[]={
	{   387,    30,   -75,     0,  1024,  1023,    32,  -102,   -52,     0},	/* 0 */
	{   387,    30,    80,     0,     0,  1023,    65,   -72,    69,     0},	/* 1 */
	{    10,    -9,    80,     0,     0,     0,     7,   -66,    98,     0},	/* 2 */
	{    10,    -9,   -75,     0,  1024,     0,     4,   -37,  -114,     0},	/* 3 */
	{   400,   192,   -75,     0,  1024,  1024,    72,    96,     0,     0},	/* 4 */
	{    35,   292,   -75,     0,  1024,     0,    32,   116,     0,     0},	/* 5 */
	{    35,   292,    80,     0,     0,     0,    23,    84,    82,     0},	/* 6 */
	{   400,   192,    80,     0,     0,  1024,    26,    35,   111,     0},	/* 7 */
	{   400,   192,   -75,     0,  1023,  1024,     0,     0,  -120,     0},	/* 8 */
	{   387,    30,   -75,     0,  1023,     0,    32,  -102,   -52,     0},	/* 9 */
	{    10,    -9,   -75,     0,  1023,  -442,     4,   -37,  -114,     0},	/* 10 */
	{    35,   292,   -75,     0,  1023,  1466,   -45,     4,  -111,     0},	/* 11 */
	{   387,    30,    80,     0,     0,     0,    65,   -72,    69,     0},	/* 12 */
	{   400,   192,    80,     0,     0,  1024,    26,    35,   111,     0},	/* 13 */
	{    10,    -9,    80,     0,     0,  -442,     7,   -66,    98,     0},	/* 14 */
	{    35,   292,    80,     0,     0,  1466,    23,    84,    82,     0},	/* 15 */
	{    10,    -9,   -75,     0,     0,  1024,  -119,    10,     0,     0},	/* 16 */
	{    10,    -9,    80,     0,  1024,  1024,  -119,    10,     0,     0},	/* 17 */
	{    35,   292,    80,     0,  1024,     0,  -119,    10,     0,     0},	/* 18 */
	{    35,   292,   -75,     0,     0,     0,   -45,     4,  -111,     0},	/* 19 */
};


/*   0 vertices */
/*   1 Materials */

#define	LDIRX	0
#define	LDIRY	0
#define	LDIRZ	120
#define	AMBDIV	1
