diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/audio/audio.cc | 3 | ||||
| -rw-r--r-- | src/audio/fdct.cc | 3 | ||||
| -rw-r--r-- | src/audio/idct.cc | 3 | ||||
| -rw-r--r-- | src/audio/window.cc | 3 | ||||
| -rw-r--r-- | src/gpu/gpu.cc | 20 | ||||
| -rw-r--r-- | src/platform.cc | 16 |
6 files changed, 30 insertions, 18 deletions
diff --git a/src/audio/audio.cc b/src/audio/audio.cc index e79e741..abdd2aa 100644 --- a/src/audio/audio.cc +++ b/src/audio/audio.cc @@ -39,7 +39,8 @@ void audio_init() { } } -void audio_update() {} +void audio_update() { +} void audio_shutdown() { ma_device_stop(&g_device); diff --git a/src/audio/fdct.cc b/src/audio/fdct.cc index ad95496..620fc37 100644 --- a/src/audio/fdct.cc +++ b/src/audio/fdct.cc @@ -10,7 +10,8 @@ void fdct_512(const float *input, float *output) { for (int k = 0; k < DCT_SIZE; ++k) { float sum = 0.0f; for (int n = 0; n < DCT_SIZE; ++n) { - sum += input[n] * cosf(PI / (float)DCT_SIZE * ((float)n + 0.5f) * (float)k); + sum += + input[n] * cosf(PI / (float)DCT_SIZE * ((float)n + 0.5f) * (float)k); } output[k] = sum; } diff --git a/src/audio/idct.cc b/src/audio/idct.cc index 97fc224..3ab4611 100644 --- a/src/audio/idct.cc +++ b/src/audio/idct.cc @@ -10,7 +10,8 @@ void idct_512(const float *input, float *output) { for (int n = 0; n < DCT_SIZE; ++n) { float sum = input[0] / 2.0f; for (int k = 1; k < DCT_SIZE; ++k) { - sum += input[k] * cosf(PI / (float)DCT_SIZE * (float)k * ((float)n + 0.5f)); + sum += + input[k] * cosf(PI / (float)DCT_SIZE * (float)k * ((float)n + 0.5f)); } output[n] = sum * (2.0f / (float)DCT_SIZE); } diff --git a/src/audio/window.cc b/src/audio/window.cc index 927a64e..6edde0c 100644 --- a/src/audio/window.cc +++ b/src/audio/window.cc @@ -8,6 +8,7 @@ void hamming_window_512(float *window) { const float PI = 3.14159265358979323846f; for (int i = 0; i < WINDOW_SIZE; ++i) { - window[i] = 0.54f - 0.46f * cosf(2.0f * PI * (float)i / (float)(WINDOW_SIZE - 1)); + window[i] = + 0.54f - 0.46f * cosf(2.0f * PI * (float)i / (float)(WINDOW_SIZE - 1)); } }
\ No newline at end of file diff --git a/src/gpu/gpu.cc b/src/gpu/gpu.cc index f32f049..43aef7c 100644 --- a/src/gpu/gpu.cc +++ b/src/gpu/gpu.cc @@ -148,10 +148,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); @@ -163,10 +162,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); @@ -271,7 +269,8 @@ void gpu_draw(float audio_peak, float aspect_ratio) { WGPUSurfaceGetCurrentTextureStatus_SuccessSuboptimal) return; - WGPUTextureView view = wgpuTextureCreateView(surface_texture.texture, nullptr); + WGPUTextureView view = + wgpuTextureCreateView(surface_texture.texture, nullptr); struct { float audio_peak; @@ -317,4 +316,5 @@ void gpu_draw(float audio_peak, float aspect_ratio) { wgpuTextureRelease(surface_texture.texture); } -void gpu_shutdown() {} +void gpu_shutdown() { +} diff --git a/src/platform.cc b/src/platform.cc index 7b1a0f8..235f4a5 100644 --- a/src/platform.cc +++ b/src/platform.cc @@ -46,9 +46,13 @@ void platform_shutdown() { glfwTerminate(); } -void platform_poll() { glfwPollEvents(); } +void platform_poll() { + glfwPollEvents(); +} -bool platform_should_close() { return glfwWindowShouldClose(window); } +bool platform_should_close() { + return glfwWindowShouldClose(window); +} void platform_toggle_fullscreen() { g_is_fullscreen = !g_is_fullscreen; @@ -66,9 +70,13 @@ void platform_toggle_fullscreen() { } } -GLFWwindow *platform_get_window() { return window; } +GLFWwindow *platform_get_window() { + return window; +} -double platform_get_time() { return glfwGetTime(); } +double platform_get_time() { + return glfwGetTime(); +} WGPUSurface platform_create_wgpu_surface(WGPUInstance instance) { return glfwCreateWindowWGPUSurface(instance, window); |
