summaryrefslogtreecommitdiff
path: root/src/main.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cc')
-rw-r--r--src/main.cc13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/main.cc b/src/main.cc
index 4922d69..32f3c99 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -177,16 +177,17 @@ int main(int argc, char** argv) {
const float demo_duration = GetDemoDuration();
const float max_duration = (demo_duration > 0.0f) ? demo_duration : 60.0f;
- const float update_dt = 1.0f / 60.0f; // 60Hz update rate
+ const float update_dt = 1.0f / 60.0f; // 60Hz update rate
const int frames_per_update = (int)(32000 * update_dt); // ~533 frames
- const int samples_per_update = frames_per_update * 2; // Stereo
+ const int samples_per_update = frames_per_update * 2; // Stereo
AudioRingBuffer* ring_buffer = audio_get_ring_buffer();
std::vector<float> chunk_buffer(samples_per_update);
double physical_time = 0.0;
while (physical_time < max_duration) {
- // Update music time and tracker (using tempo logic from fill_audio_buffer)
+ // Update music time and tracker (using tempo logic from
+ // fill_audio_buffer)
fill_audio_buffer(physical_time);
// Read rendered audio from ring buffer
@@ -200,7 +201,8 @@ int main(int argc, char** argv) {
physical_time += update_dt;
// Progress indicator every second
- if ((int)physical_time % 1 == 0 && physical_time - update_dt < (int)physical_time) {
+ if ((int)physical_time % 1 == 0 &&
+ physical_time - update_dt < (int)physical_time) {
printf(" Rendering: %.1fs / %.1fs (music: %.1fs, tempo: %.2fx)\r",
physical_time, max_duration, g_music_time, g_tempo_scale);
fflush(stdout);
@@ -233,7 +235,8 @@ int main(int argc, char** argv) {
gpu_resize(last_width, last_height);
}
- const double current_time = platform_state.time + seek_time; // Offset logic time
+ const double current_time =
+ platform_state.time + seek_time; // Offset logic time
// Auto-exit when demo finishes (if duration is specified)
if (demo_duration > 0.0f && current_time >= demo_duration) {