X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=vg_input.h;h=e9ae65b1971c9d714e174e19e1a7bc0b1552f9b2;hb=76d234b7dc5e6500e8a54009b367e7620f11ef97;hp=6b8cd79ee04513aa7ba9e7146edd9ee779b4afae;hpb=c70327d950761c26f2a7c55eb622be7c042bb550;p=vg.git diff --git a/vg_input.h b/vg_input.h index 6b8cd79..e9ae65b 100644 --- a/vg_input.h +++ b/vg_input.h @@ -7,10 +7,9 @@ #define VG_MAX_CONTROLLERS 4 -VG_STATIC float controller_deadzone = 0.05f; +static float controller_deadzone = 0.05f; -struct -{ +struct{ const u8 *sdl_keys; struct vg_controller{ @@ -36,7 +35,7 @@ struct } static vg_input = { .active_controller_index = -2 }; -VG_STATIC u8 vg_getkey( SDL_Keycode kc ) +static u8 vg_getkey( SDL_Keycode kc ) { SDL_Scancode sc = SDL_GetScancodeFromKey( kc ); return vg_input.sdl_keys[sc]; @@ -45,7 +44,7 @@ VG_STATIC u8 vg_getkey( SDL_Keycode kc ) /* * takes SDL device index, and tries to open that on any free channel */ -VG_STATIC int vg_open_gamecontroller( Sint32 index ) +static int vg_open_gamecontroller( Sint32 index ) { struct vg_controller *controller = NULL; int vg_id = 0; @@ -114,7 +113,7 @@ VG_STATIC int vg_open_gamecontroller( Sint32 index ) } } -VG_STATIC void vg_input_device_event( SDL_Event *ev ) +static void vg_input_device_event( SDL_Event *ev ) { if( ev->type == SDL_CONTROLLERDEVICEADDED ){ int is_controller = SDL_IsGameController( ev->cdevice.which ); @@ -155,7 +154,7 @@ VG_STATIC void vg_input_device_event( SDL_Event *ev ) } } -VG_STATIC void vg_input_controller_event( SDL_Event *ev ) +static void vg_input_controller_event( SDL_Event *ev ) { if( ev->type == SDL_CONTROLLERAXISMOTION ){ for( int i=0; i