diff options
Diffstat (limited to 'src/app/main.cc')
| -rw-r--r-- | src/app/main.cc | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/app/main.cc b/src/app/main.cc index 3c80520..9bbbaaf 100644 --- a/src/app/main.cc +++ b/src/app/main.cc @@ -168,7 +168,7 @@ int main(int argc, char** argv) { #if !defined(STRIP_ALL) // Debug output when tempo changes significantly if (fabsf(g_tempo_scale - prev_tempo) > 0.05f) { - printf("[Tempo] t=%.2fs, tempo=%.3fx, music_time=%.3fs\n", + printf("[Tempo] t=%.3fs, tempo=%.3fx, music_time=%.3fs\n", (float)physical_time, g_tempo_scale, g_music_time); } #endif @@ -191,7 +191,7 @@ int main(int argc, char** argv) { #if !defined(STRIP_ALL) if (seek_time > 0.0) { - printf("Seeking to %.2f seconds...\n", seek_time); + printf("Seeking to %.3f seconds...\n", seek_time); // Simulate audio/game logic // We step at ~60hz @@ -213,7 +213,7 @@ int main(int argc, char** argv) { } audio_start(); - g_last_audio_time = audio_get_playback_time(); // Initialize after start + g_last_audio_time = 0.0f; // Initialize to zero (will use smooth interpolation) #if !defined(STRIP_ALL) // Hot-reload setup @@ -351,7 +351,7 @@ int main(int argc, char** argv) { // Graphics frame time - derived from platform's clock const double current_physical_time = platform_state.time + seek_time; const double graphics_frame_time = current_physical_time - last_frame_time; - // Audio playback time - master clock for audio events + // Audio playback time - smoothly interpolated at 60Hz const float current_audio_time = audio_get_playback_time(); // Delta time for audio processing, based on audio clock const float audio_dt = current_audio_time - g_last_audio_time; @@ -398,17 +398,18 @@ int main(int argc, char** argv) { // Use graphics time for the print interval to avoid excessive output if // audio clock is slow static float last_graphics_print_time = -1.0f; - if (current_physical_time - last_graphics_print_time >= + if (true || + current_physical_time - last_graphics_print_time >= 0.5f) { // Print every 0.5 seconds if (tempo_test_enabled) { printf( - "[GraphicsT=%.2f, AudioT=%.2f, MusicT=%.2f, Beat=%d, Phase=%.2f, " - "Peak=%.2f, Tempo=%.2fx]\n", + "[GraphicsT=%.3f, AudioT=%.3f, MusicT=%.3f, Beat=%d, Phase=%.3f, " + "Peak=%.3f, Tempo=%.3fx]\n", current_physical_time, current_audio_time, g_music_time, beat_number, beat_phase, visual_peak, g_tempo_scale); } else { printf( - "[GraphicsT=%.2f, AudioT=%.2f, Beat=%d, Phase=%.2f, Peak=%.2f]\n", + "[GraphicsT=%.3f, AudioT=%.3f, Beat=%d, Phase=%.3f, Peak=%.3f]\n", current_physical_time, current_audio_time, beat_number, beat_phase, visual_peak); } |
