summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore3
-rw-r--r--PROJECT_CONTEXT.md10
-rw-r--r--src/gpu/gpu.cc19
-rw-r--r--tools/asset_packer.cc6
4 files changed, 20 insertions, 18 deletions
diff --git a/.gitignore b/.gitignore
index e80b4ef..19f8336 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,7 @@
# Build artifacts
/build/
build/
+build_strip/
# Editor backups
*~
@@ -21,3 +22,5 @@ src/test_assets_data.cc
# Generated spectrograms
assets/final/*.spec
+
+assets/wav/
diff --git a/PROJECT_CONTEXT.md b/PROJECT_CONTEXT.md
index 7664d9c..72af824 100644
--- a/PROJECT_CONTEXT.md
+++ b/PROJECT_CONTEXT.md
@@ -28,15 +28,13 @@ Incoming tasks in no particular order:
- [x] 2. parse the keyboard key. Exit the demo when 'esc' is pressed. Toggle full-screen when 'f' is pressed.
- [x] 3. add binary crunchers for all platforms
- 4. add cross-compilation for PC+linux (x86_64) and PC+Windows (.exe binary)
-- 5. implement a spectrogram editor for representing .spec with elementary
- shapes (bezier curves, lines, random noise, rectangles...) as a mean
- of compression
+- 5. implement a spectrogram editor for representing .spec with elementary shapes (bezier curves, lines, random noise, rectangles...) as a mean of compression / spec generation
- 6. add a scripting tool to edit the demo (compiled into the binary at the end)
- [x] 7. compile wgpu-native in optimized mode (not unoptimized)
-- [x] 8. add a #define STRIP_ALL to remove all unnecessary code for the final build
- (for instance, command-line args parsing, or unnecessary options, constant
- parameters to function calls, etc.)
+- [x] 8. add a #define STRIP_ALL to remove all unnecessary code for the final build (for instance, command-line args parsing, or unnecessary options, constant parameters to function calls, etc.)
- [x] 9. work on the compact in-line and off-line asset system (@ASSET_SYSTEM.md)
+- 10. optimize spectool to remove trailing zeroes from a spec file before saving it
+- 11. implement a general [time / timer / beat] system in the demo, for effects timing
## Session Decisions and Current State
diff --git a/src/gpu/gpu.cc b/src/gpu/gpu.cc
index 6e058bb..f374908 100644
--- a/src/gpu/gpu.cc
+++ b/src/gpu/gpu.cc
@@ -156,10 +156,9 @@ void gpu_init(GLFWwindow *window) {
adapter_opts.compatibleSurface = g_surface;
adapter_opts.powerPreference = WGPUPowerPreference_HighPerformance;
- wgpuInstanceRequestAdapter(
- g_instance, &adapter_opts,
- {nullptr, WGPUCallbackMode_WaitAnyOnly, handle_request_adapter, &g_adapter,
- nullptr});
+ wgpuInstanceRequestAdapter(g_instance, &adapter_opts,
+ {nullptr, WGPUCallbackMode_WaitAnyOnly,
+ handle_request_adapter, &g_adapter, nullptr});
while (!g_adapter) {
wgpuInstanceWaitAny(g_instance, 0, nullptr, 0);
@@ -171,10 +170,9 @@ void gpu_init(GLFWwindow *window) {
device_desc.uncapturedErrorCallbackInfo.callback = handle_device_error;
#endif
- wgpuAdapterRequestDevice(
- g_adapter, &device_desc,
- {nullptr, WGPUCallbackMode_WaitAnyOnly, handle_request_device, &g_device,
- nullptr});
+ wgpuAdapterRequestDevice(g_adapter, &device_desc,
+ {nullptr, WGPUCallbackMode_WaitAnyOnly,
+ handle_request_device, &g_device, nullptr});
while (!g_device) {
wgpuInstanceWaitAny(g_instance, 0, nullptr, 0);
@@ -301,7 +299,7 @@ void gpu_draw(float audio_peak, float aspect_ratio, float time) {
color_attachment.resolveTarget = nullptr;
color_attachment.loadOp = WGPULoadOp_Clear;
color_attachment.storeOp = WGPUStoreOp_Store;
-
+
// Background flash effect
float flash = audio_peak * 0.6f;
color_attachment.clearValue = {0.05 + flash, 0.1 + flash, 0.2 + flash, 1.0};
@@ -331,4 +329,5 @@ void gpu_draw(float audio_peak, float aspect_ratio, float time) {
wgpuTextureRelease(surface_texture.texture);
}
-void gpu_shutdown() {} \ No newline at end of file
+void gpu_shutdown() {
+} \ No newline at end of file
diff --git a/tools/asset_packer.cc b/tools/asset_packer.cc
index 3442e1b..24bdd26 100644
--- a/tools/asset_packer.cc
+++ b/tools/asset_packer.cc
@@ -42,13 +42,15 @@ int main(int argc, char *argv[]) {
}
// Generate assets.h
- assets_h_file << "// This file is auto-generated by asset_packer.cc. Do not edit.\n\n";
+ assets_h_file
+ << "// This file is auto-generated by asset_packer.cc. Do not edit.\n\n";
assets_h_file << "#pragma once\n";
assets_h_file << "#include <cstdint>\n\n";
assets_h_file << "enum class AssetId : uint16_t {\n";
// Generate assets_data.cc header
- assets_data_cc_file << "// This file is auto-generated by asset_packer.cc. Do not edit.\n\n";
+ assets_data_cc_file
+ << "// This file is auto-generated by asset_packer.cc. Do not edit.\n\n";
assets_data_cc_file << "#include \"util/asset_manager.h\"\n";
assets_data_cc_file << "#include \"assets.h\"\n\n";