From a5986b5a2317ab394638e54145b2df38e79b97b3 Mon Sep 17 00:00:00 2001 From: hgn Date: Thu, 1 May 2025 18:32:45 +0100 Subject: [PATCH] Nothing --- vg_input.c | 23 ++++++++++++++--------- vg_m.h | 5 +++++ 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/vg_input.c b/vg_input.c index 3a1aa27..581ea3a 100644 --- a/vg_input.c +++ b/vg_input.c @@ -317,15 +317,17 @@ f32 vg_controller_axis( SDL_GameControllerAxis axis ) else return 0; } -static void vg_input_apply_to_u8( vg_input_op mode, u8 data, u8 *inout_result ){ +static void vg_input_apply_to_u8( vg_input_op mode, u8 data, u8 *inout_result ) +{ if ( mode == vg_mode_absmax ) *inout_result |= data; else if( mode == vg_mode_mul ) *inout_result &= data; else vg_fatal_error( "mode not supported for destination type (%d)", mode ); } -static void vg_input_apply_to_f32( vg_input_op mode, f32 data, - f32 *inout_result ){ - if ( mode == vg_mode_absmax ){ +static void vg_input_apply_to_f32( vg_input_op mode, f32 data, f32 *inout_result ) +{ + if( mode == vg_mode_absmax ) + { if( fabsf(data) > fabsf(*inout_result) ) *inout_result = data; } @@ -340,20 +342,23 @@ static void vg_input_apply_to_f32( vg_input_op mode, f32 data, * Run an input program. out_result must point to memory with sufficient * storage respective to the size set by type. */ -void vg_exec_input_program( enum vg_input_type type, vg_input_op *ops, - void *out_result ){ +void vg_exec_input_program( enum vg_input_type type, vg_input_op *ops, void *out_result ) +{ u8 *out_button = NULL; f32 *out_joy = NULL; - if( type == k_vg_input_type_button_u8 ){ + if( type == k_vg_input_type_button_u8 ) + { out_button = out_result; *out_button = 0; } - else if( type == k_vg_input_type_axis_f32 ){ + else if( type == k_vg_input_type_axis_f32 ) + { out_joy = out_result; out_joy[0] = 0.0f; } - else if( type == k_vg_input_type_joy_v2f ){ + else if( type == k_vg_input_type_joy_v2f ) + { out_joy = out_result; out_joy[0] = 0.0f; out_joy[1] = 0.0f; diff --git a/vg_m.h b/vg_m.h index d745401..d582bf0 100644 --- a/vg_m.h +++ b/vg_m.h @@ -753,6 +753,11 @@ static f32 q_dist( v4f q0, v4f q1 ){ return acosf( 2.0f * v4_dot(q0,q1) -1.0f ); } +static inline void q_copy( v4f a, v4f b ) +{ + b[0] = a[0]; b[1] = a[1]; b[2] = a[2]; b[3] = a[3]; +} + /* * ----------------------------------------------------------------------------- * Section 4.a 2x2 matrices -- 2.25.1