Advertisement
Guest User

Untitled

a guest
Mar 6th, 2015
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.58 KB | None | 0 0
  1. unsigned char joypadTable[3][3] =
  2.     {   SLOT_UNDEFINED, 4, 0,
  3.                      6, 5, 7,
  4.                      2, 3, 1
  5.     };
  6.  
  7. unsigned char GetNewWheelSlot_Joypad(int player)
  8. {
  9.     CPad *pad = GetPad(player);
  10.     float x = (float)pad->NewState.RightStickX / 128.0f;
  11.     float y = (float)pad->NewState.RightStickX / 128.0f;
  12.     int tbl_x = 0, tbl_y = 0;
  13.     if(x > CControls::m_fStickSensitivity)
  14.         tbl_x = 1;
  15.     else if(x < -CControls::m_fStickSensitivity)
  16.         tbl_x = 2;
  17.     if(y > CControls::m_fStickSensitivity)
  18.         tbl_y = 1;
  19.     else if(y < -CControls::m_fStickSensitivity)
  20.         tbl_y = 2;
  21.     return joypadTable[tbl_x][tbl_y];
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement