summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-01-31 15:47:33 +0100
committerskal <pascal.massimino@gmail.com>2026-01-31 15:47:33 +0100
commit1016d65d4b5bf7cbd05bba4cf79dc2ce172c9fad (patch)
treec77dc5c3f11c8344080bedc10e2e23f18efeddae /src
parent0bb7fa35cc340a65c944e546231632379bcfa30c (diff)
opt: Guard debug/seek features with STRIP_ALL
Ensures that code related to the --seek command line option (simulation loops, silent audio rendering) is completely compiled out when the DEMO_STRIP_ALL build option is enabled, preserving the 64k size constraint.
Diffstat (limited to 'src')
-rw-r--r--src/audio/audio.cc2
-rw-r--r--src/audio/audio.h2
-rw-r--r--src/gpu/gpu.cc2
-rw-r--r--src/gpu/gpu.h2
4 files changed, 8 insertions, 0 deletions
diff --git a/src/audio/audio.cc b/src/audio/audio.cc
index 517e376..a1a6f7b 100644
--- a/src/audio/audio.cc
+++ b/src/audio/audio.cc
@@ -48,6 +48,7 @@ void audio_start() {
}
}
+#ifndef STRIP_ALL
void audio_render_silent(float duration_sec) {
const int sample_rate = 32000;
const int chunk_size = 512;
@@ -60,6 +61,7 @@ void audio_render_silent(float duration_sec) {
total_frames -= frames_to_render;
}
}
+#endif
void audio_update() {
}
diff --git a/src/audio/audio.h b/src/audio/audio.h
index 67c83c2..1fb53b6 100644
--- a/src/audio/audio.h
+++ b/src/audio/audio.h
@@ -6,6 +6,8 @@
void audio_init();
void audio_start(); // Starts the audio device callback
+#ifndef STRIP_ALL
void audio_render_silent(float duration_sec); // Fast-forwards audio state
+#endif
void audio_update();
void audio_shutdown();
diff --git a/src/gpu/gpu.cc b/src/gpu/gpu.cc
index e68b84d..d119e60 100644
--- a/src/gpu/gpu.cc
+++ b/src/gpu/gpu.cc
@@ -425,9 +425,11 @@ void gpu_draw(float audio_peak, float aspect_ratio, float time, float beat) {
g_main_sequence.render_frame(time, beat, audio_peak, aspect_ratio, g_surface);
}
+#ifndef STRIP_ALL
void gpu_simulate_until(float time) {
g_main_sequence.simulate_until(time, 1.0f / 60.0f);
}
+#endif
void gpu_shutdown() {
g_main_sequence.shutdown();
diff --git a/src/gpu/gpu.h b/src/gpu/gpu.h
index 1d79781..b0b08c9 100644
--- a/src/gpu/gpu.h
+++ b/src/gpu/gpu.h
@@ -33,7 +33,9 @@ struct RenderPass {
void gpu_init(GLFWwindow *window);
void gpu_draw(float audio_peak, float aspect_ratio, float time, float beat);
+#ifndef STRIP_ALL
void gpu_simulate_until(float time);
+#endif
void gpu_shutdown();
// Helper functions (exposed for internal/future use)