#include<ultra64.h>

extern Vtx TI_Atackbommer_Magazine_v[];
extern Vtx TI_Atackbommer_Magazine_vmcur[];
extern Tri TI_Atackbommer_Magazine_tri[];

extern unsigned short TI_Duct04_txt[];
extern unsigned short TI_Duct05_txt[];
extern unsigned short TI_Paint01_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 */


/* ======== TI_Atackbommer_Magazine ======== */

Gfx TI_Atackbommer_Magazine[]={

	gs_Nin_SetUpTileDescrip(G_IM_FMT_RGBA,G_IM_SIZ_16b,16,16,0,0,G_TX_CLAMP,4,0,G_TX_CLAMP,4,0),
	gs_Nin_LoadTextureImage(TI_Duct04_txt,G_IM_FMT_RGBA,G_IM_SIZ_16b,16,16,0,7),


	gsSPVertex(&TI_Atackbommer_Magazine_v[0],10,0),
	gsSP1Triangle(0, 1, 2, 0),
	gsSP1Quadrangle(3, 6, 4, 5, 0),
	gsSP1Triangle(7, 8, 9, 0),
	gs_Nin_SetUpTileDescrip(G_IM_FMT_RGBA,G_IM_SIZ_16b,16,16,0,0,G_TX_CLAMP,4,0,G_TX_WRAP,4,0),
	gs_Nin_LoadTextureImage(TI_Duct05_txt,G_IM_FMT_RGBA,G_IM_SIZ_16b,16,16,0,7),


	gsSPVertex(&TI_Atackbommer_Magazine_v[10],3,0),
	gsSP1Triangle(0, 1, 2, 0),

	gsSPVertex(&TI_Atackbommer_Magazine_v[13],3,0),
	gsSP1Triangle(0, 1, 2, 0),

	gs_Nin_SetUpTileDescrip(G_IM_FMT_RGBA,G_IM_SIZ_16b,16,16,0,0,G_TX_CLAMP,4,0,G_TX_CLAMP,4,0),
	gs_Nin_LoadTextureImage(TI_Paint01_txt,G_IM_FMT_RGBA,G_IM_SIZ_16b,16,16,0,7),

	gsSPVertex(&TI_Atackbommer_Magazine_v[16],11,0),
	gsSP2Triangles(0, 1, 2, 0, 2, 3, 4, 0),
	gsSP2Triangles(4, 3, 5, 0, 6, 7, 8, 0),
	gsSP2Triangles(6, 8, 9, 0, 10, 1, 0, 0),
	gsSPEndDisplayList(),
}; /* TI_Atackbommer_Magazine */ 

#undef G_CC_PRIMSHADE

#undef gs_Nin_LoadTextureImage

#undef gs_Nin_SetUpTileDescrip

/* 31 vertices */
Vtx TI_Atackbommer_Magazine_v[]={
	{   127,   -20,    30,     0,   526,   611,    -4,   -28,   115,   255},	/* 0 */
	{     2,    77,    30,     0,   467,   144,   -57,    43,    95,   255},	/* 1 */
	{   -36,    25,    30,     0,  1285,    76,   -45,   -21,   108,   255},	/* 2 */
	{   -36,    25,   -30,     0,   116,   352,  -118,    18,     0,   255},	/* 3 */
	{     2,    77,    30,     0,   395,   145,   -57,    43,    95,   255},	/* 4 */
	{     2,    77,   -30,     0,   116,   145,   -95,    72,     0,   255},	/* 5 */
	{   -36,    25,    30,     0,   395,   351,   -45,   -21,   108,   255},	/* 6 */
	{   -36,    25,   -30,     0,  1286,    89,    -5,   -21,  -118,   255},	/* 7 */
	{     2,    77,   -30,     0,   467,   158,    65,    83,   -57,   255},	/* 8 */
	{   127,   -20,   -29,     0,   526,   631,    75,    49,   -80,   255},	/* 9 */
	{     9,   -84,     0,     0,   256,  -485,   -36,   -49,   102,   255},	/* 10 */
	{   -36,    25,    30,     0,   102,   716,   -45,   -21,   108,   255},	/* 11 */
	{   -36,    25,   -30,     0,   409,   716,  -118,    18,     0,   255},	/* 12 */
	{   127,   -20,    30,     0,    66,  -170,    89,    80,     0,   255},	/* 13 */
	{   108,   -84,     0,     0,   258,   397,    54,   -57,   -90,   255},	/* 14 */
	{   127,   -20,   -29,     0,   445,  -170,    75,    49,   -80,   255},	/* 15 */
	{   127,   -20,    30,     0,   512,     0,    -4,   -28,   115,   255},	/* 16 */
	{     9,   -84,     0,     0,     0,   512,   -36,   -49,   102,   255},	/* 17 */
	{   108,   -84,     0,     0,   512,   511,     0,   -50,   108,   255},	/* 18 */
	{     9,   -84,     0,     0,     0,   512,    -6,   -39,  -113,   255},	/* 19 */
	{   127,   -20,   -29,     0,   512,     0,    -6,   -39,  -113,   255},	/* 20 */
	{   -36,    25,   -30,     0,   -16,   -19,    -5,   -21,  -118,   255},	/* 21 */
	{     2,    77,   -30,     0,     0,   512,    65,    83,   -57,   255},	/* 22 */
	{     2,    77,    30,     0,   512,   512,    73,    95,     0,   255},	/* 23 */
	{   127,   -20,    30,     0,   512,     0,    89,    80,     0,   255},	/* 24 */
	{   127,   -20,   -29,     0,     4,     0,    75,    49,   -80,   255},	/* 25 */
	{   -36,    25,    30,     0,   -16,   -19,   -45,   -21,   108,   255},	/* 26 */
};

/* 16 x 16  G_IM_SIZ_16b G_IM_FMT_RGBA  */
unsigned short TI_Duct04_txt[] = {
	0x1001, 0x801, 0x1001, 0x73d7, 0x1, 0x73d7, 0x1001, 0x5001, 0x5001, 0x1001, 0x73d7, 0x1, 0x73d7, 0x1001, 0x801, 0x1001, 
	0x1001, 0x801, 0x1001, 0x424b, 0x1, 0x9347, 0x1801, 0x8001, 0x8001, 0x1801, 0xa347, 0x1, 0x424b, 0x1001, 0x1001, 0x1001, 
	0x1001, 0x6001, 0x1801, 0x9b89, 0x1, 0x6b95, 0x2801, 0x2801, 0x2801, 0x2801, 0x6b95, 0x1, 0x9b89, 0x1801, 0x6801, 0x1001, 
	0x2001, 0x3001, 0x2801, 0x73d7, 0x1, 0x845b, 0x4001, 0x4001, 0x4001, 0x4001, 0xc44d, 0x1, 0xbc07, 0x2801, 0x3001, 0x2001, 
	0x4001, 0x5001, 0x4001, 0xcc8d, 0x1, 0x9d21, 0xceab, 0xf7f5, 0xe731, 0xc669, 0x951f, 0x1, 0x73d7, 0x4001, 0x4001, 0x4001, 
	0x5001, 0x6001, 0x6801, 0xada5, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x94df, 0x6801, 0x5001, 0x5001, 
	0x7001, 0x7801, 0x8801, 0xa001, 0xcead, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0xc6ab, 0x9801, 0x8801, 0x7801, 0x7001, 
	0x3801, 0x2801, 0x2001, 0xb801, 0xf7f7, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0xfffb, 0xb001, 0x2801, 0x3001, 0x4001, 
	0x3801, 0x2801, 0x2001, 0xb001, 0xceab, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0xd6ef, 0xb801, 0x2801, 0x3001, 0x4001, 
	0x6001, 0x7001, 0x7801, 0x8801, 0x9d61, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0xada5, 0xa001, 0x9001, 0x7801, 0x6801, 
	0x5001, 0x1801, 0x5001, 0x845b, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x845b, 0x5801, 0x1801, 0x5001, 
	0x4001, 0x4001, 0x4001, 0x73d7, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0xcc8d, 0x4001, 0x4001, 0x4001, 
	0x2801, 0x3001, 0x3001, 0xbc07, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x73d7, 0x3001, 0x3001, 0x2801, 
	0x2001, 0x2001, 0x2801, 0x9b89, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x9b89, 0x2801, 0x2001, 0x2001, 
	0x1001, 0x1001, 0x1801, 0x424b, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x424b, 0x1801, 0x1001, 0x1001, 
	0x801, 0x801, 0x1001, 0x73d7, 0x1, 0x31c7, 0x4a8d, 0x7395, 0x7395, 0x4a8d, 0x29c5, 0x1, 0x73d7, 0x1001, 0x801, 0x1801, 
};

/* 16 x 16  G_IM_SIZ_16b G_IM_FMT_RGBA  */
unsigned short TI_Duct05_txt[] = {
	0x4801, 0x8843, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x8843, 0x4001, 
	0x4801, 0x8843, 0x1041, 0x2881, 0x3103, 0x4105, 0x4187, 0x4105, 0x4105, 0x38c5, 0x38c5, 0x3103, 0x2081, 0x1041, 0x2843, 0x4001, 
	0x3801, 0x3843, 0x28c5, 0x4989, 0x628f, 0x624f, 0x93db, 0xfff7, 0xd62b, 0x7b15, 0x59cb, 0x8419, 0x520d, 0x2907, 0x7043, 0x2801, 
	0x3001, 0x7043, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x8843, 0x4001, 
	0x4801, 0x8843, 0x1041, 0x2081, 0x3103, 0x4187, 0x4187, 0x528d, 0x4187, 0x49c9, 0x4187, 0x39c7, 0x2081, 0x1041, 0x2843, 0x4001, 
	0x4801, 0x8843, 0x2907, 0x520d, 0x7355, 0x7313, 0x93db, 0xfff7, 0xace3, 0xce6b, 0x9cdf, 0x8419, 0x628f, 0x3147, 0x8843, 0x4001, 
	0x3801, 0x7843, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x7043, 0x3001, 
	0x4801, 0x8043, 0x1041, 0x20c1, 0x3145, 0x4187, 0x49c9, 0x528d, 0x49c9, 0x49c9, 0x528d, 0x39c7, 0x2101, 0x1081, 0x8843, 0x4001, 
	0x3801, 0x8043, 0x2907, 0x520d, 0x8419, 0x7313, 0xace1, 0xfff7, 0xa45f, 0x93db, 0x7313, 0x7355, 0x6b53, 0x39cb, 0x7043, 0x3001, 
	0x4801, 0x8843, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x6843, 0x2801, 
	0x4001, 0x3843, 0x1041, 0x2081, 0x3145, 0x4187, 0x49c9, 0x528d, 0x49c9, 0x528d, 0x528d, 0x3145, 0x2881, 0x1041, 0x8843, 0x4001, 
	0x4801, 0x4043, 0x3147, 0x628f, 0x7355, 0x7b55, 0xce6b, 0xfff7, 0xfff7, 0xce6b, 0x9cdf, 0x8419, 0x4989, 0x28c5, 0x8843, 0x4001, 
	0x4801, 0x8843, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x8843, 0x4001, 
	0x3801, 0x7843, 0x1081, 0x2101, 0x3103, 0x4105, 0x38c5, 0x4187, 0x528d, 0x49c9, 0x4105, 0x3145, 0x2101, 0x1081, 0x2843, 0x3801, 
	0x4801, 0x8843, 0x39cb, 0x6b53, 0x9c5d, 0x7313, 0x8399, 0xc5a7, 0xfff7, 0xce6b, 0x83d9, 0x9cdd, 0x6b53, 0x39cb, 0x7043, 0x2801, 
	0x4801, 0x8843, 0x1, 0x1, 0xce27, 0x1, 0x1, 0xe6ad, 0xf7b5, 0x1, 0x1, 0xdeeb, 0x1, 0x1, 0x8843, 0x4801, 
};
