// Copyright (C) 2011 Valeriano Alfonso Rodriguez (Kableado) #include #include #include "Util.h" #include "Input.h" // Globals InputKeyStatus _keys[InputKey_Max]; ///////////////////////////// // Input_Init // // Initializes the game input. int Input_Init(){ int i; // Mark released all the keys for(i=0;i=InputKey_Pressed){ _keys[key]=InputKey_Holded; }else{ _keys[key]=InputKey_Pressed; } } } ///////////////////////////// // Input_GetKey // // Reports a the status of a key. InputKeyStatus Input_GetKey(InputKey key){ return(_keys[key]); } ///////////////////////////// // Input_AnyKey // // int Input_AnyKey(){ int i; for(i=0;i0.0f){ vlen=sqrtf(vlen); vec2_scale(dir,dir,1.0f/vlen); return(1); }else{ return(0); } }