/* 
 * 変換日付 Fri Jun 18 09:33:01 1999
 * 1999/6/17 バージョン
 * パレット有効
 * XXコードの頂点破棄
 * 使用テキスチャ─チェック
 * 頂点カラーを評価しない
 * ビュア─の設定対応
 */
#include <mbi.h>
#include <u64macro.h>

/* テクスチャポインター */
extern unsigned short anime_1_txt[];
/* パレットポインター */
extern unsigned short anime_2_txt[];

extern unsigned char hi_light_txt[];
static unsigned short tent[16];
/* texture = 3 */
static unsigned char tent_bace[128];
static unsigned char tent_roll[128];

/* ビュア─設定のパレット */
/* ビュア─設定のテキスチャ─ */
/* vretex = 33 */
static Vtx tent_shape_v[] = {
/* 0番目 */ {  12,   30,   10,    0,  512,  -64,  111,   20,   40,   50},
/* 1番目 */ {  10,   28,   17,    0, -341,  256,  111,   20,   40,   50},
/* 2番目 */ {  12,   21,   15,    0,  512,  576,  111,   20,   40,   50},
/* 3番目 */ { -12,   21,   15,    0,  512,  576, -111,   20,   40,  250},
/* 4番目 */ { -10,   28,   17,    0, -341,  256, -111,   20,   40,  250},
/* 5番目 */ { -12,   30,   10,    0,  512,  -64, -111,   20,   40,  250},
/* 6番目 */ { -24,    0,  -24,    0, -137, -307,    0,  120,    0,  255},
/* 7番目 */ { -24,    0,   24,    0, -137,  512,    0,  120,    0,  255},
/* 8番目 */ {  24,    0,  -24,    0,  683, -307,    0,  120,    0,  255},
/* 9番目 */ {  24,    0,   24,    0,  683,  512,    0,  120,    0,  255},
/* 10番目 */ {  10,   25,   13,    0,  717,  512,   14,   63,  101,  106},
/* 11番目 */ {  15,    0,   25,    0,  819, 1024,    0,   63,  101,  106},
/* 12番目 */ {  25,    0,   25,    0, 1024, 1024,   30,   63,  101,  106},
/* 13番目 */ {  25,    0,   25,    0, 1024, 1024,    0,   63,  101,  106},
/* 14番目 */ {   0,   50,    0,    0,  512,    0,    0,   63,  101,  106},
/* 15番目 */ { -25,    0,   25,    0,    0, 1024,    0,   63,  101,  106},
/* 16番目 */ { -10,   25,   13,    0,  307,  512,  -14,   63,  101,  106},
/* 17番目 */ {  25,    0,  -25,    0, 1024, 1024,  101,   63,  -30,   50},
/* 18番目 */ {   0,   50,    0,    0,  512,    0,  101,   63,    0,   50},
/* 19番目 */ {  25,    0,   25,    0,    0, 1024,  101,   63,   30,   50},
/* 20番目 */ { -25,    0,   25,    0, 1024, 1024, -101,   63,   30,  255},
/* 21番目 */ {   0,   50,    0,    0,  512,    0, -101,   63,    0,  255},
/* 22番目 */ { -25,    0,  -25,    0,    0, 1024, -101,   63,  -30,  255},
/* 23番目 */ { -25,    0,   25,    0,    0, 1024,  -30,   63,  101,  106},
/* 24番目 */ { -15,    0,   25,    0,  205, 1024,    0,   63,  101,  106},
/* 25番目 */ {  10,   28,   17,    0,  758,  819,  -12,   54,  106,  255},
/* 26番目 */ {   0,   28,   11,    0,  512, 1024,    0,  111,  -44,  244},
/* 27番目 */ { -10,   28,   17,    0,  266,  819,   12,   54,  106,  228},
/* 28番目 */ {  12,   30,   10,    0,  758, 1024,  -13,  110,  -44,  255},
/* 29番目 */ { -12,   30,   10,    0,  266, 1024,   13,  110,  -44,  232},
/* 30番目 */ { -12,   21,   15,    0,  266,  614,   13, -110,   44,   98},
/* 31番目 */ {   0,   23,   14,    0,  512,  614,    0, -111,   44,  100},
/* 32番目 */ {  12,   21,   15,    0,  758,  614,  -13, -110,   44,  130},

};

Gfx tent_model[] = {
 /* tent_1_mtr */
	gsSPTexture(0xFFFF, 0xFFFF, 0, 0, G_ON),
/* repeat = (1,1)  mirror = (1,1) clamp = (1,1) */
	gsDPPipeSync(),
	gsDPSetRenderMode(G_RM_FOG_SHADE_A,G_RM_AA_ZB_OPA_SURF2),
	gsDPSetCombineLERP(
		TEXEL0, 0, SHADE, 0,
		0, 0, 0, TEXEL0,
		PRIMITIVE, 0, COMBINED, 0,
		0, 0, 0, COMBINED),
	gsDPSetTextureLUT(G_TT_RGBA16),
	gsDPLoadTLUT_pal16(15,tent),
	gsDPLoadTextureBlock_4b(
			tent_roll,
			G_IM_FMT_CI,
			16, 16, 15,
			G_TX_MIRROR | G_TX_CLAMP, G_TX_MIRROR | G_TX_CLAMP,
			4, 4, 0, 0),
	gsDPSetPrimColor( 0, 128, 255, 255, 255, 255),
/* tent_1 */
	gsSPLoadGeometryMode(G_LIGHTING | G_CULL_BACK | G_FOG | G_SHADE | G_SHADING_SMOOTH | G_ZBUFFER),
	gsSPVertex(&tent_shape_v[0],6,0),
	gsSP2Triangles( 0, 1, 2, 0, 3, 4, 5, 0 ),
 /* tent_2_mtr */
/* repeat = (1,1)  mirror = (1,1) clamp = (1,1) */
	gsDPPipeSync(),
	gsDPLoadTLUT_pal16(15,tent),
	gsDPLoadTextureBlock_4b(
			tent_bace,
			G_IM_FMT_CI,
			16, 16, 15,
			G_TX_MIRROR | G_TX_CLAMP, G_TX_MIRROR | G_TX_CLAMP,
			4, 4, 0, 0),
/* tent_2 */
	gsSPVertex(&tent_shape_v[6],4,0),
	gsSP2Triangles( 0, 1, 2, 0, 2, 1, 3, 0 ),
 /* tent_3_mtr */
/* repeat = (1,1)  mirror = (1,1) clamp = (0,0) */
	gsDPPipeSync(),
	gsDPLoadTLUT_pal16(15,anime_2_txt),
	gsDPLoadTextureBlock_4b(
			anime_1_txt,
			G_IM_FMT_CI,
			32, 32, 15,
			G_TX_MIRROR | G_TX_WRAP, G_TX_MIRROR | G_TX_WRAP,
			5, 5, 0, 0),
/* tent_3 */
	gsSPVertex(&tent_shape_v[10],23,0),
	gsSP2Triangles( 0, 1, 2, 0, 0, 3, 4, 0 ),
	gsSP2Triangles( 4, 5, 6, 0, 7, 8, 9, 0 ),
	gsSP2Triangles( 10, 11, 12, 0, 13, 14, 6, 0 ),
	gsSP2Triangles( 0, 4, 6, 0, 15, 16, 17, 0 ),
	gsSP2Triangles( 15, 18, 16, 0, 16, 19, 17, 0 ),
	gsSP2Triangles( 20, 21, 17, 0, 21, 15, 17, 0 ),
	gsSP1Triangle( 21, 22, 15, 0),
	gsSPEndDisplayList(),
};

static unsigned short tent[] = {
0x0001,0x2041,0x4881,0x68c1,0x9101,0xb981,0x0001,0x0001,
0x0001,0x0001,0x0001,0x5a09,0x8b93,0xac9d,0xde65,0xffb3,
};

static unsigned char tent_bace[] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x11,0x11,0x00,0x00,0x00,
0x00,0x00,0x01,0x11,0x11,0x10,0x00,0x00,0x00,0x00,0x11,0x22,0x22,0x11,0x00,0x00,
0x00,0x00,0x12,0x22,0x22,0x21,0x00,0x00,0x00,0x01,0x22,0x23,0x32,0x22,0x10,0x00,
0x00,0x01,0x23,0x33,0x33,0x32,0x10,0x00,0x00,0x12,0x23,0x33,0x33,0x32,0x21,0x00,
0x00,0x12,0x33,0x44,0x44,0x33,0x21,0x00,0x00,0x12,0x34,0x44,0x44,0x43,0x21,0x00,
0x01,0x23,0x34,0x44,0x44,0x43,0x32,0x10,0x01,0x23,0x44,0x45,0x54,0x44,0x32,0x10,
0x01,0x23,0x45,0x55,0x55,0x54,0x32,0x10,0x01,0x34,0x55,0x55,0x55,0x55,0x43,0x10,
0x02,0x34,0x55,0x55,0x55,0x55,0x43,0x20,0x02,0x35,0x55,0x55,0x55,0x55,0x53,0x20,
}; /* tent_bace */
static unsigned char tent_roll[] = {
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0xee,0xff,0xff,0xff,
0xff,0xff,0xec,0xbb,0xbb,0xbc,0xef,0xff,0xff,0xfd,0xbb,0xde,0xed,0xcb,0xbd,0xff,
0xff,0xeb,0xde,0xff,0xff,0xfe,0xdb,0xde,0xff,0xcb,0xef,0xfb,0xbb,0xcf,0xfd,0xbd,
0xff,0xbc,0xff,0xbd,0xfd,0xbb,0xfe,0xbc,0xfe,0xbd,0xfd,0xbe,0xff,0xeb,0xcf,0xcb,
0xfe,0xbd,0xfd,0xbb,0xcf,0xfd,0xbf,0xdb,0xff,0xbc,0xff,0xcb,0xbf,0xfd,0xbf,0xeb,
0xff,0xcb,0xef,0xdb,0xcf,0xfd,0xbf,0xec,0xff,0xeb,0xde,0xff,0xff,0xeb,0xcf,0xfd,
0xff,0xfd,0xbb,0xde,0xed,0xbb,0xff,0xfd,0xff,0xff,0xec,0xbb,0xbb,0xcf,0xff,0xfe,
0xff,0xff,0xff,0xfe,0xef,0xff,0xff,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
}; /* tent_roll */


