Esempio n. 1
0
Songs::Songs(Font *font) {
	n = 0;
	SetUseASyncLoadFlag(FALSE);
	int file = FileRead_open("song/song.csv", FALSE);
	SetUseASyncLoadFlag(TRUE);
	char buf[3][256];
	int id = 0;
	while (FileRead_scanf(file, "%d,%[^,\n\r],%[^,\n\r],%[^\n\r]", &id, buf[0], buf[1], buf[2]) != EOF) {
		song[n] = new Song(font, id, buf[1], buf[2], buf[0]);
		n++;
	}
	FileRead_close(file);
}
Esempio n. 2
0
void BmsPlayer::bmsPlay(){
	ChronoTimer calcflame;

	// メディアロード開始
	SetUseASyncLoadFlag(TRUE);
	setSoundToMem();
	setGraphToMem();

	SetUseASyncLoadFlag(FALSE);
	
	while (ProcessMessage() == 0 && GetASyncLoadNum() != 0){
		if (calcflame.GetLapTime() >= (1.0 / GetRefreshRate()) * 100000){
			system_graph.drawsystembg();
			system_graph.drawsystem();
			DrawFormatString(450, 60, GetColor(255, 255, 255), "GENRE : %s", parser->getHeader("GENRE").c_str());
			DrawFormatString(450, 75, GetColor(255, 255, 255), "TITLE : %s", parser->getHeader("TITLE").c_str());
			DrawFormatString(450, 90, GetColor(255, 255, 255), "ARTIST: %s", parser->getHeader("ARTIST").c_str());
			DrawFormatString(450, 105, GetColor(255, 255, 255), "BPM   : %s", parser->getHeader("BPM").c_str());
			DrawFormatString(450, 120, GetColor(255, 255, 255), "Loading...");

			ScreenFlip();
			ClearDrawScreen();
			calcflame.ResetTime();
		}
	}

	// ゲーム用タイマー
	input.ResetTime();

	// 入力関係
	Result score;

	int grph_i = 0;

	while (ProcessMessage() == 0)
	{
		// プレー処理
		play_channel_sound(1, input.GetLapTime());
		for (int j = 11; j < 20; j++){
			play_channel_sound(j, input.GetLapTime());
		}

		input.inputUpdate();
		checkJudge(input.GetLapTime());

		// 描画ブロック
		if (calcflame.GetLapTime() >= (1.0 / GetRefreshRate()) * 100000){
			system_graph.drawsystembg();

			SetDrawMode(DX_DRAWMODE_BILINEAR);
			grph_i += play_channel_graph(4, grph_i, input.GetLapTime());

			SetDrawMode(DX_DRAWMODE_NEAREST);

			drawInterface(input.GetLapTime());
			system_graph.drawsystem();

			DrawFormatString(150, 300, GetColor(255, 255, 255), "PERFECT %d", combo_debug);

			ScreenFlip();
			ClearDrawScreen();
			calcflame.ResetTime();
		}
	}

	// リザルトクラス呼び出しとか



	InitSoundMem();
}