X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=src%2Fvg%2Fvg_input.h;h=ac2cce6e2cb4c7dcd8bbf85e829a43c6e67c450c;hb=0ab3fe912f415b666ed22e9e20bf4f3f2befd989;hp=3985f3c26975dcc89acb5dcfeb1776e078a58898;hpb=6aeba08ad9ad8bdecafcfd9f946173e99a84fc59;p=vg.git diff --git a/src/vg/vg_input.h b/src/vg/vg_input.h index 3985f3c..ac2cce6 100644 --- a/src/vg/vg_input.h +++ b/src/vg/vg_input.h @@ -5,10 +5,14 @@ #include "common.h" #include "vg/vg_loader.h" -static inline float vg_get_axis( const char *axis ); -static inline int vg_get_button( const char *button ); -static inline int vg_get_button_down( const char *button ); -static inline int vg_get_button_up( const char *button ); +VG_STATIC inline float vg_get_axis( const char *axis ); +VG_STATIC inline int vg_get_button( const char *button ); + +/* + * Cannot be used in fixed update + */ +VG_STATIC inline int vg_get_button_down( const char *button ); +VG_STATIC inline int vg_get_button_up( const char *button ); enum vg_button_state { @@ -26,7 +30,7 @@ enum EInputMode } vg_input_mode; -static struct axis_binding +VG_STATIC struct axis_binding { const char *name; union @@ -41,7 +45,7 @@ static struct axis_binding } vg_axis_binds[]; -static struct button_binding +VG_STATIC struct button_binding { const char *name; int bind; @@ -56,14 +60,14 @@ vg_controller_binds[]; #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wreturn-type" -static inline float vg_get_axis( const char *axis ) +VG_STATIC float vg_get_axis( const char *axis ) { for( int i = 0; i < vg_list_size( vg_axis_binds ); i ++ ) if( !strcmp( axis, vg_axis_binds[i].name ) ) return vg_axis_binds[i].value; } -static inline struct button_binding *vg_get_button_ptr( const char *button ) +VG_STATIC struct button_binding *vg_get_button_ptr( const char *button ) { for( int i=0; i