

function DrawBG_Stage4
{
	WriteZBuffer(false);
	UseZBuffer(false);

	
	SetGraphicAngle(0,0,0);
}

function BGData_Stage4
{

	stage_count++;
}



let STAGEBG_INIT=0;
let STAGEBG_DEST=1;

function Stage4_Const(let pattern)
{
	let dir=GetCurrentScriptDirectory~".\GameData\StageData\Image\";
	stage_tex=[
	];
	
	dir=GetCurrentScriptDirectory~".\GameData\SoundData\BGM\";
	bgm=[
	];
	
				 
	alternative(pattern%2)
	case(STAGEBG_INIT){Stage_Init;}
	case(STAGEBG_DEST){Stage_Dest;}

	function Stage_Init
	{
		stagenum=4;
		stagepart=0;
		
		ascent(a in 0..length(stage_tex)){LoadGraphic(stage_tex[a]);}
		ascent(a in 0..length(bgm)){LoadMusic(bgm[a]);}
		
		
		bg_vector3[0]=0;
		bg_vector3[1]=0;
		bg_vector3[2]=0;
		
		bg_eye_viewfrom[2]=45;
		bg_eye_viewfrom[1]=90;
		bg_eye_viewfrom[0]=500;
		
		bg_fog_perspectiveclip[0]=500;
		bg_fog_perspectiveclip[1]=1500;
		
		bg_fogcolor[0]=255;
		bg_fogcolor[1]=255;
		bg_fogcolor[2]=255;
		
		stage_count=0;
	}
	
	function Stage_Dest
	{
		ascent(a in 0..length(stage_tex)){DeleteGraphic(stage_tex[a]);}
		ascent(a in 0..length(bgm)){DeleteMusic(bgm[a]);}
	}
}