From 0ad78b4ef1510cf334739faddd0c73d2280f4683 Mon Sep 17 00:00:00 2001 From: Paul Dino Jones Date: Thu, 16 Jan 2025 01:08:00 -0500 Subject: [PATCH] sound devices stay on main thread --- src/monocoque/gameloop/gameloop.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/monocoque/gameloop/gameloop.c b/src/monocoque/gameloop/gameloop.c index ea949ff..f566200 100644 --- a/src/monocoque/gameloop/gameloop.c +++ b/src/monocoque/gameloop/gameloop.c @@ -261,7 +261,7 @@ void looprun(MonocoqueSettings* ms, loop_data* f, SimData* simdata) for (int x = 0; x < numdevices; x++) { - if (devices[x].initialized == true) + if (devices[x].initialized == true && devices[x].type != 2) { device_loop_data* dld = f->device_batons + (sizeof(device_loop_data) * x); dld->simdevice = &devices[x]; @@ -278,15 +278,15 @@ void looprun(MonocoqueSettings* ms, loop_data* f, SimData* simdata) else { showstats(simdata); - //SimDevice* devices = f->simdevices; - //int numdevices = f->numdevices; - //for (int x = 0; x < numdevices; x++) - //{ - // if (devices[x].initialized == true) - // { - // devices[x].update(&devices[x], simdata); - // } - //} + SimDevice* devices = f->simdevices; + int numdevices = f->numdevices; + for (int x = 0; x < numdevices; x++) + { + if (devices[x].initialized == true && devices[x].type == 2) + { + devices[x].update(&devices[x], simdata); + } + } } } @@ -321,7 +321,7 @@ void shmdatamapcallback(uv_timer_t* handle) for (int x = 0; x < numdevices; x++) { - if (devices[x].initialized == true) + if (devices[x].initialized == true && devices[x].type != 2) { uv_timer_t* dt = (uv_timer_t*) f->device_timers + (uv_handle_size(UV_TIMER) * x); slogt("attempting device timer stop and release");