From aa3e6db1629b47168bbd5bb3f9a52492b7768836 Mon Sep 17 00:00:00 2001 From: hgn Date: Sat, 8 Nov 2025 20:42:37 +0000 Subject: [PATCH] axiseseys --- source/engine/model_entity.h | 1 + source/engine/vg_input.c | 92 +++++++++++++++++++++++++++++------- source/engine/vg_input.h | 5 +- 3 files changed, 79 insertions(+), 19 deletions(-) diff --git a/source/engine/model_entity.h b/source/engine/model_entity.h index be0c9c0..4ba5e7e 100644 --- a/source/engine/model_entity.h +++ b/source/engine/model_entity.h @@ -748,6 +748,7 @@ enum entity_event_result enum ent_event_flags { + k_ent_event_data_void = 0x0, k_ent_event_data_const_i32 = 0x1, k_ent_event_data_const_f32 = 0x2, k_ent_event_data_const_entity_id = 0x4, diff --git a/source/engine/vg_input.c b/source/engine/vg_input.c index 24acafb..74c5709 100644 --- a/source/engine/vg_input.c +++ b/source/engine/vg_input.c @@ -443,11 +443,25 @@ static _input_states[2][k_input_count]; struct bind { u16 device, input_index; - u32 id; + u16 id; + i16 polarity; u32 modifiers; }; struct stretchy_allocator _bind_allocator; +enum input_id _input_get( const c8 *name ) +{ + for( i32 i=0; iname, 0, name, 0 ) ) + { + return i; + } + } + return -1; +} + i32 _input_bind_ccmd( struct console_arguments *args ) { const c8 *buttons = console_get_argument( args, 0 ); @@ -457,31 +471,30 @@ i32 _input_bind_ccmd( struct console_arguments *args ) return -1; } + i32 input_polarity = 0; const c8 *input_name = console_get_argument( args, 1 ); + + if( input_name[0] == '-' ) input_polarity = -1; + if( input_name[0] == '+' ) input_polarity = +1; + if( input_polarity ) + input_name ++; + if( !input_name ) { $log( $error, {"Usage: bind