shithub: m8c

Download patch

ref: a89aa398f35481ac0b98f47f8fd284132e2ecef7
parent: 997a030e208314e5538689d7362cccad61718164
author: laamaa <jonne.kokkonen@gmail.com>
date: Thu Sep 11 18:18:56 EDT 2025

add audio toggle logic to settings menu and update includes for audio/render integrations

--- a/src/settings.c
+++ b/src/settings.c
@@ -1,9 +1,12 @@
 #include "settings.h"
 
 #include "SDL2_inprint.h"
+#include "backends/audio.h"
 #include "common.h"
-#include <SDL3/SDL.h>
+#include "render.h"
+
 #include "fonts/fonts.h"
+#include <SDL3/SDL.h>
 
 // Internal state
 static int g_settings_open = 0;
@@ -199,12 +202,13 @@
     unsigned int *val = it->target;
     *val = *val ? 0 : 1;
     if (it->target == &conf->init_fullscreen) {
-      extern int toggle_fullscreen(config_params_s *config);
       toggle_fullscreen(conf);
     }
     if (it->target == &conf->integer_scaling) {
-      extern void renderer_fix_texture_scaling_after_window_resize(config_params_s * config);
       renderer_fix_texture_scaling_after_window_resize(conf);
+    }
+    if (it->target == &conf->audio_enabled && ctx->device_connected) {
+      audio_toggle(ctx->conf.audio_device_name, ctx->conf.audio_buffer_size);
     }
     g_needs_redraw = 1;
     break;
--