diff options
| author | skal <pascal.massimino@gmail.com> | 2026-01-31 15:57:00 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-01-31 15:57:00 +0100 |
| commit | 9a6cd87164995df93cf3df410ce37721910ce240 (patch) | |
| tree | 04bc3f733ca916ad13ea6304069f63cdacec5399 /src/gpu | |
| parent | 1016d65d4b5bf7cbd05bba4cf79dc2ce172c9fad (diff) | |
feat: Implement Sequence Compiler for data-driven choreography
Adds a 'seq_compiler' tool that converts a text-based timeline (assets/demo.seq) into a generated C++ file. This allows editing effect sequences and timing without modifying engine code. Replaces manual sequence creation with a generated 'LoadTimeline' function.
Diffstat (limited to 'src/gpu')
| -rw-r--r-- | src/gpu/demo_effects.cc | 12 | ||||
| -rw-r--r-- | src/gpu/demo_effects.h | 7 | ||||
| -rw-r--r-- | src/gpu/gpu.cc | 3 |
3 files changed, 4 insertions, 18 deletions
diff --git a/src/gpu/demo_effects.cc b/src/gpu/demo_effects.cc index 5fc7c15..869cd12 100644 --- a/src/gpu/demo_effects.cc +++ b/src/gpu/demo_effects.cc @@ -300,15 +300,3 @@ void ParticlesEffect::render(WGPURenderPassEncoder pass, float time, float beat, wgpuRenderPassEncoderDraw(pass, render_pass_.vertex_count, render_pass_.instance_count, 0, 0); } - -std::shared_ptr<Sequence> create_demo_sequence(WGPUDevice device, - WGPUQueue queue, - WGPUTextureFormat format) { - auto seq = std::make_shared<Sequence>(); - // Overlap them for now to replicate original behavior - seq->add_effect(std::make_shared<HeptagonEffect>(device, queue, format), 0.0f, - 1000.0f); - seq->add_effect(std::make_shared<ParticlesEffect>(device, queue, format), - 0.0f, 1000.0f); - return seq; -} diff --git a/src/gpu/demo_effects.h b/src/gpu/demo_effects.h index 81321d9..befb1fe 100644 --- a/src/gpu/demo_effects.h +++ b/src/gpu/demo_effects.h @@ -34,7 +34,6 @@ private: GpuBuffer uniforms_; }; -// Factory -std::shared_ptr<Sequence> create_demo_sequence(WGPUDevice device, - WGPUQueue queue, - WGPUTextureFormat format); +// Auto-generated function to populate the timeline +void LoadTimeline(MainSequence &main_seq, WGPUDevice device, WGPUQueue queue, + WGPUTextureFormat format); diff --git a/src/gpu/gpu.cc b/src/gpu/gpu.cc index d119e60..e76aecc 100644 --- a/src/gpu/gpu.cc +++ b/src/gpu/gpu.cc @@ -417,8 +417,7 @@ void gpu_init(GLFWwindow *window) { g_main_sequence.init(g_device, g_queue, g_config.format); - auto seq = create_demo_sequence(g_device, g_queue, g_config.format); - g_main_sequence.add_sequence(seq, 0.0f, 0); + LoadTimeline(g_main_sequence, g_device, g_queue, g_config.format); } void gpu_draw(float audio_peak, float aspect_ratio, float time, float beat) { |
