From c8b7f65809557e534eb185d9e5e52a5cd33a6e1c Mon Sep 17 00:00:00 2001 From: zicodxx Date: Sat, 16 Jul 2011 16:02:20 +0200 Subject: [PATCH] Fixing Redbook hooks: Initialize last_check_time in RBACheckFinishedHook(); Execute RBACheckFinishedHook() during EVENT_WINDOW_DRAW in standard_handler() as EVENT_IDLE rarely happens if you have a shivering Joystick connected for example --- CHANGELOG.txt | 3 ++- arch/sdl/rbaudio.c | 2 +- main/inferno.c | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 5ee51d44f..cb87241b3 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -2,7 +2,8 @@ D1X-Rebirth Changelog 20110716 -------- -main/songs.c: Correctly proceed to new Redbook track if songnum != Song_playing (hopefully - to confirm); Using songs_stop_all() in songs_uninit() to clear redundancy; added some notes to functions to shine a bit light on the mess of some functions +main/songs.c: Correctly proceed to new Redbook track if songnum != Song_playing (hopefully - to confirm); Using songs_stop_all() in songs_uninit() to clear redundancy; added some notes to functions to shine a bit light on the mess of some functions; Also if there's no escape song, continue level music +arch/sdl/rbaudio.c, main/inferno.c: Fixing Redbook hooks: Initialize last_check_time in RBACheckFinishedHook(); Execute RBACheckFinishedHook() during EVENT_WINDOW_DRAW in standard_handler() as EVENT_IDLE rarely happens if you have a shivering Joystick connected for example 20110715 -------- diff --git a/arch/sdl/rbaudio.c b/arch/sdl/rbaudio.c index e86038194..e7a28dd25 100644 --- a/arch/sdl/rbaudio.c +++ b/arch/sdl/rbaudio.c @@ -200,7 +200,7 @@ int RBAGetNumberOfTracks() // a real hook would be ideal, but is currently unsupported by SDL Audio CD void RBACheckFinishedHook() { - static fix64 last_check_time; + static fix64 last_check_time = 0; if (!s_cd) return; diff --git a/main/inferno.c b/main/inferno.c index 546a126ee..2210791d7 100644 --- a/main/inferno.c +++ b/main/inferno.c @@ -261,6 +261,7 @@ int standard_handler(d_event *event) } break; + case EVENT_WINDOW_DRAW: case EVENT_IDLE: //see if redbook song needs to be restarted RBACheckFinishedHook();