| 848 | |
| 849 | struct RightStickAccumulator { |
| 850 | void pool(int *x, int *y, int slowdown) |
| 851 | { |
| 852 | DWORD tc = SDL_GetTicks(); |
| 853 | hiresDX += rightStickX * (tc - lastTc); |
| 854 | hiresDY += rightStickY * (tc - lastTc); |
| 855 | *x += hiresDX / slowdown; |
| 856 | *y += -hiresDY / slowdown; |
| 857 | lastTc = tc; |
| 858 | // keep track of remainder for sub-pixel motion |
| 859 | hiresDX %= slowdown; |
| 860 | hiresDY %= slowdown; |
| 861 | } |
| 862 | |
| 863 | void clear() |
| 864 | { |
no outgoing calls
no test coverage detected