From c194f59e171a1e58ce1704f37d99ffcd09a42433 Mon Sep 17 00:00:00 2001 From: skal Date: Mon, 2 Feb 2026 15:55:03 +0100 Subject: fix(gpu): Resolve high-DPI squished rendering and 3D shadow bugs - Implemented dynamic resolution support in all shaders and effects. - Added explicit viewport setting for all render passes to ensure correct scaling. - Fixed 3D shadow mapping by adding PLANE support and standardizing soft shadow logic. - Propagated resize events through the Effect hierarchy. - Applied project-wide code formatting. --- tools/spectool.cc | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'tools') diff --git a/tools/spectool.cc b/tools/spectool.cc index a9bf551..aa28a0b 100644 --- a/tools/spectool.cc +++ b/tools/spectool.cc @@ -97,26 +97,27 @@ int analyze_audio(const char* in_path, const char* out_path) { for (int i = num_frames - 1; i >= first_frame; --i) { bool all_zeros = true; for (int j = 0; j < DCT_SIZE; ++j) { - if (fabsf(spec_data[i * DCT_SIZE + j]) > epsilon) { - all_zeros = false; - break; - } + if (fabsf(spec_data[i * DCT_SIZE + j]) > epsilon) { + all_zeros = false; + break; + } } if (all_zeros) { - last_frame = i; + last_frame = i; } else { - break; + break; } } // Create a new vector with the trimmed data std::vector trimmed_data; if (first_frame < last_frame) { - trimmed_data.assign(spec_data.begin() + first_frame * DCT_SIZE, - spec_data.begin() + last_frame * DCT_SIZE); + trimmed_data.assign(spec_data.begin() + first_frame * DCT_SIZE, + spec_data.begin() + last_frame * DCT_SIZE); } - printf("Trimming: Original frames: %d -> Trimmed frames: %zu\n", num_frames, trimmed_data.size() / DCT_SIZE); + printf("Trimming: Original frames: %d -> Trimmed frames: %zu\n", num_frames, + trimmed_data.size() / DCT_SIZE); // Write to .spec file FILE* f_out = fopen(out_path, "wb"); -- cgit v1.2.3