From 953377d4ecf608bd5dbf92782d8a5b9e778037fb Mon Sep 17 00:00:00 2001 From: Frank Villaro-Dixon Date: Fri, 2 Jan 2015 17:25:17 +0100 Subject: [PATCH] some useless comments and litte audio bug --- audio/OxiD_-_8bit.mp3.beats.bak | 0 src/music.c | 11 +++-------- 2 files changed, 3 insertions(+), 8 deletions(-) delete mode 100644 audio/OxiD_-_8bit.mp3.beats.bak diff --git a/audio/OxiD_-_8bit.mp3.beats.bak b/audio/OxiD_-_8bit.mp3.beats.bak deleted file mode 100644 index e69de29..0000000 diff --git a/src/music.c b/src/music.c index 2930be0..9ee15cd 100644 --- a/src/music.c +++ b/src/music.c @@ -34,7 +34,7 @@ music_load_beats(struct s_game *g, int music) { // {{{ free(beats_file); - while(fgets(buffer, sizeof(buffer), f) && i < MAX_MUSICS_NUM) { + while(fgets(buffer, sizeof(buffer), f)) { //ugly, but it's a one time beats = realloc(beats, (i+1) * sizeof(*beats)); beats[i] = (long)atof(strtrim(buffer)); @@ -42,6 +42,8 @@ music_load_beats(struct s_game *g, int music) { // {{{ } g->audio.beats[music] = beats; + g->audio.num_beats[music] = i; + fclose(f); } //}}} @@ -109,8 +111,6 @@ int did_have_beat(struct s_game *g) { int music = g->audio.currently_playing; - printf(">> %d\n", g->audio.currently_playing); - if(music == -1) return 0; @@ -121,12 +121,7 @@ did_have_beat(struct s_game *g) { (actual_time.tv_nsec - g->start_time.tv_nsec) / 1e9; - printf(">> %d, done: %d\n", g->audio.num_beats[music], g->audio.beat_already_done); - -// printf("Secs passed: %lf, actual: %lf\n", secs_passed, mus_beats[already_done]); - if(g->audio.num_beats[music] > g->audio.beat_already_done) { - puts("Hallo"); if(g->audio.beats[music][g->audio.beat_already_done] < secs_passed) { g->audio.beat_already_done++; return 1;