From: hgn Date: Thu, 13 Jun 2024 10:18:17 +0000 (+0100) Subject: misc todo X-Git-Url: https://harrygodden.com/git/?a=commitdiff_plain;h=0f41dbf5b35fae41f1ed1937631d7a1027c06efc;p=vg.git misc todo --- diff --git a/submodules/SDL_GameControllerDB b/submodules/SDL_GameControllerDB index c5b4df0..6ed8d05 160000 --- a/submodules/SDL_GameControllerDB +++ b/submodules/SDL_GameControllerDB @@ -1 +1 @@ -Subproject commit c5b4df0e1061175cb11e3ebbf8045178339864a5 +Subproject commit 6ed8d054340ee8a93a684e11360b66cd8a5c168e diff --git a/submodules/anyascii b/submodules/anyascii index eb5332d..44e971c 160000 --- a/submodules/anyascii +++ b/submodules/anyascii @@ -1 +1 @@ -Subproject commit eb5332d0b5e48d58397e6f27475a18e058330d23 +Subproject commit 44e971c774d9ec67ca6c1f16c5a476724821ab63 diff --git a/submodules/qoi b/submodules/qoi index dfc056e..b8d77df 160000 --- a/submodules/qoi +++ b/submodules/qoi @@ -1 +1 @@ -Subproject commit dfc056e813c98d307238d35f7f041a725d699dfc +Subproject commit b8d77df1e80b652a57f0b7270449b179a6b91f40 diff --git a/submodules/stb b/submodules/stb index 5736b15..8b5f1f3 160000 --- a/submodules/stb +++ b/submodules/stb @@ -1 +1 @@ -Subproject commit 5736b15f7ea0ffb08dd38af21067c314d6a3aae9 +Subproject commit 8b5f1f37b5b75829fc72d38e7b5d4bcbf8a26d55 diff --git a/vg_async.c b/vg_async.c index 0d7809d..7916282 100644 --- a/vg_async.c +++ b/vg_async.c @@ -5,9 +5,6 @@ struct vg_async vg_async; enum vg_thread_purpose vg_thread_purpose(void); enum engine_status _vg_engine_status(void); -/* - * Allocate an asynchronous call with a bit of memory - */ vg_async_item *vg_async_alloc( u32 size ) { /* ditch out here if engine crashed. this serves as the 'quit checking' */ @@ -69,15 +66,9 @@ vg_async_item *vg_async_alloc( u32 size ) void vg_async_stall(void) { vg_assert_thread(k_thread_purpose_loader); -#if 0 - vg_info( "async_stall: %d\n", SDL_SemValue( vg_async.sem_wait_for_flush ) ); -#endif SDL_SemWait( vg_async.sem_wait_for_flush ); } -/* - * Mark the call as being filled and ready to go - */ void vg_async_dispatch( vg_async_item *item, void (*runner)( void *payload, u32 size ) ) { @@ -90,9 +81,6 @@ void vg_async_dispatch( vg_async_item *item, SDL_AtomicUnlock( &vg_async.sl_index ); } -/* - * Make a simple async call without allocating extra. - */ void vg_async_call( void (*runner)( void *payload, u32 size ), void *payload, u32 size ) { @@ -103,9 +91,6 @@ void vg_async_call( void (*runner)( void *payload, u32 size ), vg_async_dispatch( call, runner ); } -/* - * Run as much of the async buffer as possible - */ void vg_run_async_checked(void) { SDL_AtomicLock( &vg_async.sl_index ); @@ -127,12 +112,11 @@ void vg_run_async_checked(void) } } } - else{ + else + { SDL_AtomicUnlock( &vg_async.sl_index ); return; } - - /* TODO: if exceed max frametime.... */ } if( !SDL_SemValue( vg_async.sem_wait_for_flush ) ){ diff --git a/vg_async.h b/vg_async.h index e0a2528..7f28c8e 100644 --- a/vg_async.h +++ b/vg_async.h @@ -10,7 +10,8 @@ static void vg_assert_thread( enum vg_thread_purpose required ); typedef struct vg_async_item vg_async_item; -struct vg_async_item{ +struct vg_async_item +{ vg_async_item *next; void *payload; @@ -30,14 +31,24 @@ struct vg_async } extern vg_async; -/* TODO: Docu */ +void vg_async_init(void); +/* + * Make a simple async call without allocating extra. + */ void vg_async_call( void (*runner)( void *payload, u32 size ), void *payload, u32 size ); + +/* + * Run as much of the async buffer as possible + */ void vg_run_async_checked(void); -void vg_async_init(void); +/* + * Allocate an asynchronous call with a bit of memory + */ vg_async_item *vg_async_alloc( u32 size ); + /* * Mark the call as being filled and ready to go */ diff --git a/vg_audio.h b/vg_audio.h index 2787423..a579487 100644 --- a/vg_audio.h +++ b/vg_audio.h @@ -51,18 +51,23 @@ typedef struct audio_lfo audio_lfo; struct audio_clip { - union { /* TODO oof.. */ - u64 _p64_; + union + { const char *path; void *func; + + u64 _p64_; /* force width to be 64 because we save this structure on + disk in Skaterift yay */ }; u32 flags; u32 size; - union{ - u64 _p64; + union + { void *data; + + u64 _p64; }; }; diff --git a/vg_loader.h b/vg_loader.h index ec8fb0d..b69b287 100644 --- a/vg_loader.h +++ b/vg_loader.h @@ -10,6 +10,9 @@ #pragma once +#include "vg_platform.h" +#include "vg_engine.h" + struct vg_loader { /* Shutdown steps */ diff --git a/vg_rigidbody_collision.c b/vg_rigidbody_collision.c index f70a39b..1c1d058 100644 --- a/vg_rigidbody_collision.c +++ b/vg_rigidbody_collision.c @@ -262,7 +262,6 @@ int rb_capsule__box( m4x3f mtxA, rb_capsule *ca, v3_sub( c1, p1, d1 ); v3_sub( p1, p0, da ); - /* TODO: ? */ v3_normalize(d0); v3_normalize(d1); v3_normalize(da);