Vultraz

Untitled

Jan 13th, 2016
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.57 KB | None | 0 0
  1. /**
  2.  * Small helper function to translate slider step values into
  3.  * accelerated speed multipliers. The associative table is as follows:
  4.  *
  5.  * SLIDER_VALUE: 0    1    2    3    4    5    6    7    8    9    10   11
  6.  * SPEED_MULTIP: 0.25 0.50 0.75 1.00 1.25 1.50 1.75 2.00 3.00 4.00 8.00 16.00
  7.  */
  8.  
  9. static double get_turbo_speed(int value)
  10. {
  11.     double res;
  12.  
  13.     if (value >= 0 && <= 7) {
  14.         res = 0.25 * (value + 1);
  15.     } else if (value == 8 || value == 9) {
  16.         res = value - 5;
  17.     } else if (value == 10) {
  18.         res = 8
  19.     } else if (value == 11) {
  20.         res = 16;
  21.     }
  22.  
  23.     return res;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment