From: hgn Date: Fri, 3 Nov 2023 14:01:43 +0000 (+0000) Subject: i32r, q_dist fix X-Git-Url: https://harrygodden.com/git/?p=vg.git;a=commitdiff_plain;h=87adbb9de6b8c68b912179ae00cbd49181c2945a i32r, q_dist fix --- diff --git a/vg_async.h b/vg_async.h index 7537aae..b3c8a0a 100644 --- a/vg_async.h +++ b/vg_async.h @@ -101,10 +101,11 @@ static vg_async_item *vg_async_alloc( u32 size ) /* * Wait until the current stack of async calls is completely flushed out */ -static void vg_async_stall(void) -{ +static 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 ); } diff --git a/vg_m.h b/vg_m.h index abd4509..6d86177 100644 --- a/vg_m.h +++ b/vg_m.h @@ -699,7 +699,7 @@ static void q_mulv( v4f q, v3f v, v3f d ) v3_add( v1, v2, d ); } -static f32 q_dist( v4f q0, v3f q1 ){ +static f32 q_dist( v4f q0, v4f q1 ){ return acosf( 2.0f * v4_dot(q0,q1) -1.0f ); } diff --git a/vg_platform.h b/vg_platform.h index b22f989..aa4175d 100644 --- a/vg_platform.h +++ b/vg_platform.h @@ -125,6 +125,24 @@ static void vg_strcati32( vg_str *str, i32 value ){ vg_strcat( str, "0" ); } +static void vg_strcati32r( vg_str *str, i32 value, i32 n, char alt ){ + char temp[32]; + i32 i=0; + while( value ){ + if( i>=n ) + break; + + temp[ n-1 - (i ++) ] = '0' + (value % 10); + value /= 10; + } + + for( ;ii == -1 ) return 0; else return 1;