| 826 | } |
| 827 | |
| 828 | static float lerp(float a, float b, int t, int d) |
| 829 | { |
| 830 | if (t <= 0) |
| 831 | { |
| 832 | return a; |
| 833 | } |
| 834 | |
| 835 | if (t >= d) |
| 836 | { |
| 837 | return b; |
| 838 | } |
| 839 | |
| 840 | float f = (float)t / (float)d; |
| 841 | return a + (b - a) * f; |
| 842 | } |
| 843 | |
| 844 | static float interpolate(Slope *aStartSlope, Slope *aEndSlope, float aMidValue, int aTime, int aDuration) |
| 845 | { |