Exemplo n.º 1
0
Menu::~Menu()
{
	DeleteGraph   (h_twi);
	DeleteGraph   (h_cursor);
	DeleteSoundMem(hs_choice);
	DeleteSoundMem(hs_move);
}
Exemplo n.º 2
0
void SoundManager::ChangeLoadTableMain( const std::string &tableStr, const bool &isLoadSound )
{
	//! まず初期化
	if(isLoadSound){
		for(uint32_t i = 0; i < m_vBGM.size(); ++i){
			DeleteSoundMem(m_vBGM.at(i).m_soundId);
		}
		m_vBGM.clear();
	}
	else{
		for(uint32_t i = 0; i < m_vSE.size(); ++i){
			DeleteSoundMem(m_vSE.at(i).m_soundId);
		}
		m_vSE.clear();
	}

	//! サウンドテーブルの読み込みとそこからファイルのロード
	std::string pathStr = JSON_SOUND_PATH;
	pathStr += tableStr;
	idxfstream ifs(pathStr.c_str());

	picojson::value root;
	picojson::parse( root, ifs);
	
	picojson::value null;
	picojson::value sceneData = root.get("soundTable");
	for(uint32_t i = 0;; ++i){
		if( sceneData == null || sceneData.get(i) == null){
			break;
		}
		SOUND_INFO data;
		data.Init();
		data.m_soundTag = sceneData.get(i).get("tag").get<std::string>();
		data.m_soundName = sceneData.get(i).get("file").get<std::string>();
		std::string filePath = "";
		if(isLoadSound){
			filePath = BGM_PATH;
		}
		else{
			filePath = SE_PATH;
		}
		filePath += data.m_soundName.c_str();
		int32_t soundId = LoadSoundMem(filePath.c_str());
		if(soundId != -1){
			data.m_soundId = soundId;
			if(isLoadSound){
				m_vBGM.push_back(data);
				DEBUG_PRINT("【BGMロード tag : %s ,FileName : %s】\n", data.m_soundTag.c_str(), data.m_soundName.c_str());
			}
			else{
				m_vSE.push_back(data);
				DEBUG_PRINT("【SEロード tag : %s ,FileName : %s】\n", data.m_soundTag.c_str(), data.m_soundName.c_str());
			}
		}
		else{
			DEBUG_PRINT("【サウンドファイルロードエラー : %s】\n", filePath.c_str());
		}
	}
}
Exemplo n.º 3
0
Pshot::~Pshot()
{
	for (auto &shot : Ashot)	delete shot;
	for (auto &shot : Bshot)	delete shot;
	for (auto &shot : Cshot)	delete shot;
	for (int &Gr_Handle : hg)	DeleteGraph(Gr_Handle);
	for (int &Gr_Handle : hg2)	DeleteGraph(Gr_Handle);
	DeleteGraph(hg_fire);
	DeleteSoundMem(hs_shot);
	DeleteSoundMem(hs_hit);
}
Exemplo n.º 4
0
Title::~Title()
{
	DeleteGraph(titleImage[0]);
	DeleteGraph(titleImage[1]);
	DeleteGraph(titleImage[2]);
	DeleteGraph(titleImage[3]);
	DeleteGraph(titleImage[4]);
	DeleteGraph(titleImage[5]);
	DeleteGraph(_selectHandle);

	DeleteSoundMem(titleBGM);
	DeleteSoundMem(selectBGM);
}
Exemplo n.º 5
0
// データ破棄
void GameRoad::DataDel(void)
{
    for(int i=0; i<_RO_SP_END; i++) {
        DeleteGraph( sp_num[i] ) ;
    }
    for(int i=0; i<8; i++) {
        for(int j=0; j<5; j++) {
            DeleteGraph( ichi_num[i][j] );
        }
    }
    for(int i=0; i<_RO_SE_END; i++) {
        DeleteSoundMem( se_num[i] );
    }
}
Exemplo n.º 6
0
Enemy::~Enemy()
{
	delete shot;
	delete shot2;
	delete shot3;

	// 画像アンロード
	switch (type)
	{
	case 0:
		DeleteGraph(gh_ene00);
		break;
	case 1:
		break;
	case 2:
		for (int i = 0; i < sizeof(gh_ene02) / sizeof(gh_ene02[0]); i++)
			DeleteGraph(gh_ene02[i]);
		break;
	case 3:
		break;
	case 4:
		for (int i = 0; i < sizeof(gh_ene04) / sizeof(gh_ene04[0]); i++)
			DeleteGraph(gh_ene04[i]);
		break;
	case 5:
		break;
	case 6:
		break;
	case 7:
		break;

	default:
		printfDx("ERROR:Enemy.cpp");
		break;
	}

	if (gh_shot00 != NULL)	DeleteGraph(gh_shot00);
	if (sh_voice != NULL)	DeleteSoundMem(sh_voice);
}
Exemplo n.º 7
0
void Stage::StageSet(eStage estage)
{
	// まず素材用のメモリを開放します
	for (int &Gr_Handle : hg)
	{
		if(Gr_Handle != NULL)	DeleteGraph(Gr_Handle);
	}

	if (hs_bgm != NULL)	DeleteSoundMem(hs_bgm);

	// ステージ用素材ロード
	switch (estage)
	{
	case eStage::stage1 :
		hs_bgm				= LoadSoundMem("SOUND/s0.mp3");
		hg.at(eBG_back)		= LoadGraph("GRAPH/GAME/BACKGROUND/RasterOnly/rbg00.png");
		hg.at(eBG_middle)	= LoadGraph("GRAPH/GAME/BACKGROUND/sumple_middle.png");
		hg.at(eBG_front)	= LoadGraph("GRAPH/GAME/BACKGROUND/RasterOnly/rbg01.png");
		break;
	case eStage::stage2 :
		break;
	case eStage::stage3 :
		break;
	case eStage::stage4 :
		break;
	case eStage::stage5 :
		break;
	case eStage::stage6 :
		break;
	case eStage::stage0 :
		break;
	}

	// 敵データを読み込む
	Game::LoadEnemy(estage);
	Game::StageCall();

	PlaySoundMem(hs_bgm, DX_PLAYTYPE_LOOP);
}
Exemplo n.º 8
0
Player::~Player() {
	for (int h : hg)	DeleteGraph(h);
	DeleteSoundMem(hs_shiftUp);
	DeleteSoundMem(hs_shiftDown);
	DeleteSoundMem(hs_dead);
}
Exemplo n.º 9
0
//bgmの削除
void delete_bgm() {
	DeleteSoundMem(area[stage].bgm.handle);
}
	// サウンドハンドルを削除する
	static void Delete(std::string FileName){
		DeleteSoundMem(getInstance().SdHwnd[FileName]);
		getInstance().SdHwnd.erase(FileName);
	};
Exemplo n.º 11
0
void Darkroom::init2(void){
	limitTime = 60 * 90;
	DeleteGraph(background);
	switch(result.stage_color()){
	case 0:
		background = LoadGraph("res/bg/stage2_R_bg_y.png");
		break;
	case 1:
		background = LoadGraph("res/bg/stage2_G_bg_y.png");
		break;
	case 2:
		background = LoadGraph("res/bg/stage2_B_bg_y.png");	
		break;
	}
	DeleteGraph(forground);
	switch(result.stage_color()){
	case 0:
		forground = LoadGraph("res/bg/stage2_R_fg.png");
		break;
	case 1:
		forground = LoadGraph("res/bg/stage2_G_fg.png");
		break;
	case 2:
		forground = LoadGraph("res/bg/stage2_B_fg.png");	
		break;
	}
	DeleteSoundMem(bgm);
	bgm = LoadSoundMem("res/bgm/Stage2.mp3");


	for(int i = 0; i < SOUND_NUM; i++) {
		sound[i].x = rand() % WINDOW_WIDTH - 80 + 40;
		sound[i].y = rand() % WINDOW_HEIGHT - 80 + 20;
		sound[i].v_x = 1 + (double)(rand() % 100)/100;
		sound[i].v_y = 1 + (double)(rand() % 100)/100;
		sound[i].caught = FALSE;
		if( i < 48){
			sound[i].visible = TRUE;
		} else {
			sound[i].visible = FALSE;
			continue;
		}

		sound[i].count = rand() % 4 * 15;
		setSound(i % 3, &sound[i]);
	}
	
		for(int i = 0; i < ENEMY_NUM; i++) {
		enemy[i].x = rand() % WINDOW_WIDTH - 80 + 40;
		enemy[i].y = rand() % WINDOW_HEIGHT - 80 + 20;
		//enemy[i].v_x = 1 + (double)(rand() % 100)/100;
		//enemy[i].v_y = 1 + (double)(rand() % 100)/100;
		if(i < 4){
			enemy[i].visible = TRUE;
		} else {
			enemy[i].visible = FALSE;
			continue;		
		}

		enemy[i].count = rand() % 4 * 15;
		delete(enemy[i].pattern);
		if(i % 3 == 0){
			MoveCircular* p;
			p = new MoveCircular();
			p->angle = rand() % 360;
			p->radius = rand() % 150 + 20;
			//sound[i].wave.color = GetColor(255,128,128);					
			enemy[i].pattern = p;
		} else if(i % 3 == 1){
			MoveReflect* p;
			p = new MoveReflect();
			//enemy[i].wave.color = GetColor(128,255,128);
			enemy[i].pattern = p;
		} else {
			MoveSinWave* p = new MoveSinWave(enemy[i].y, rand() % 5 * 0.01 , rand() % 3 * 20 + 10);
			enemy[i].pattern = p;
		}
	}
	PlaySoundMem(bgm, DX_PLAYTYPE_LOOP);
}
Exemplo n.º 12
0
void Darkroom::init1(void){
	limitTime = 60 * 60;
	DeleteGraph(background);
	background = LoadGraph("res/bg/stage1_bg_y.png");	
	DeleteGraph(forground);
	forground = LoadGraph("res/bg/stage1_fg.png");
	DeleteSoundMem(bgm);
	bgm = LoadSoundMem("res/bgm/Stage1.mp3");

	
	for(int i = 0; i < SOUND_NUM; i++) {
		sound[i].x = rand() % WINDOW_WIDTH - 80 + 40;
		sound[i].y = rand() % WINDOW_HEIGHT - 80 + 20;
		sound[i].v_x = 1 + (double)(rand() % 100)/100;
		sound[i].v_y = 1 + (double)(rand() % 100)/100;
		sound[i].caught = FALSE;
		if( i < 24){
			sound[i].visible = TRUE;
		} else {
			sound[i].visible = FALSE;
			continue;
		}
		sound[i].count = rand() % 4 * 15;
		if(i < 24 / 3){
			setSound(0, &sound[i]);
		} else if(i < 24 / 3 * 2){
			setSound(1, &sound[i]);
		} else {
			setSound(2, &sound[i]);
		}

	}

	for(int i = 0; i < 8; i++) {

		enemy[i].x = rand() % WINDOW_WIDTH - 80 + 40;
		enemy[i].y = rand() % WINDOW_HEIGHT - 80 + 20;
		if(i < 2){
			enemy[i].visible = TRUE;
		} else {
			enemy[i].visible = FALSE;
			continue;		
		}

		enemy[i].count = rand() % 4 * 15;
		delete(enemy[i].pattern);
		if(i % 4 == 0){
			//MoveSinWave* p;
			MoveSinWave* p = new MoveSinWave(enemy[i].y, rand() % 5 * 0.01 , rand() % 3 * 20 + 10);
			//p->angle = rand() % 360;
			//p->radius = rand() % 150 + 20;
			enemy[i].pattern = p;
		} else if(i % 4 == 1){
			MoveReflect* p;
			p = new MoveReflect();
			enemy[i].pattern = p;
		} else if(i % 4 == 2){
			MoveEscape* p;
			p = new MoveEscape();
			p->player_x = &(player.x);
			p->player_y = &(player.y);
			enemy[i].pattern = p;
		} else {
			MoveSinWave* p = new MoveSinWave(enemy[i].y, rand() % 5 * 0.01 , rand() % 3 * 20 + 10);
			p->dx = rand() % 5;
			enemy[i].pattern = p;
		}
	}
	PlaySoundMem(bgm, DX_PLAYTYPE_LOOP);
}
Exemplo n.º 13
0
void Darkroom::init4(void){
	limitTime = 60 * 120;
	DeleteGraph(background);
	switch(result.stage_color()){
	case 0:
		background = LoadGraph("res/bg/stage4_R_bg_y.png");
		break;
	case 1:
		background = LoadGraph("res/bg/stage4_G_bg_y.png");
		break;
	case 2:
		background = LoadGraph("res/bg/stage4_B_bg_y.png");	
		break;
	}
	DeleteGraph(forground);
	switch(result.stage_color()){
	case 0:
		forground = LoadGraph("res/bg/stage4_R_fg.png");
		break;
	case 1:
		forground = LoadGraph("res/bg/stage4_G_fg.png");
		break;
	case 2:
		forground = LoadGraph("res/bg/stage4_B_fg.png");	
		break;
	}
	DeleteSoundMem(bgm);
	bgm = LoadSoundMem("res/bgm/Stage3.mp3");


	for(int i = 0; i < SOUND_NUM; i++) {
		sound[i].x = rand() % WINDOW_WIDTH - 80 + 40;
		sound[i].y = rand() % WINDOW_HEIGHT - 80 + 20;
		sound[i].v_x = 1 + (double)(rand() % 100)/100;
		sound[i].v_y = 1 + (double)(rand() % 100)/100;
		sound[i].caught = FALSE;
		if( i < 64){
			sound[i].visible = TRUE;
		} else {
			sound[i].visible = FALSE;
			continue;
		}

		sound[i].count = rand() % 4 * 15;
		setSound(i % 3, &sound[i]);
	}

	for(int i = 0; i < ENEMY_NUM; i++) {
		enemy[i].x = rand() % WINDOW_WIDTH - 80 + 40;
		enemy[i].y = rand() % WINDOW_HEIGHT - 80 + 20;
		if(i < 6){
			enemy[i].visible = TRUE;
		} else {
			enemy[i].visible = FALSE;
			continue;		
		}

		enemy[i].count = rand() % 4 * 15;
		delete(enemy[i].pattern);
		if(i % 3 == 0){
			MoveCircular* p;
			p = new MoveCircular();
			p->angle = rand() % 360;
			p->radius = rand() % 150 + 20;				
			enemy[i].pattern = p;
		} else if(i % 3 == 1){
			MoveReflect* p;
			p = new MoveReflect();
			enemy[i].pattern = p;
		} else {
			MoveEscape* p;
			p = new MoveEscape();
			p->player_x = &(player.x);
			p->player_y = &(player.y);
			enemy[i].pattern = p;
		}
	}
	PlaySoundMem(bgm, DX_PLAYTYPE_LOOP);
}
Exemplo n.º 14
0
Stage::~Stage()
{
	for (int &Gr_Handle : hg)	DeleteGraph(Gr_Handle);
	
	if(hs_bgm != NULL)	DeleteSoundMem(hs_bgm);
}