summaryrefslogtreecommitdiff
path: root/tools/spectool.cc
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-02-02 15:55:03 +0100
committerskal <pascal.massimino@gmail.com>2026-02-02 15:55:03 +0100
commitc194f59e171a1e58ce1704f37d99ffcd09a42433 (patch)
treef77a32f2c4c23b335209b8df11cc82920388b51a /tools/spectool.cc
parent316825883c705ed0fe927c32e072f98141d3eaa3 (diff)
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.
Diffstat (limited to 'tools/spectool.cc')
-rw-r--r--tools/spectool.cc19
1 files changed, 10 insertions, 9 deletions
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<float> 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");