1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-19 02:12:57 +08:00

Cast less.

This commit is contained in:
Dean Herbert 2016-11-28 22:47:50 +09:00
parent 9114c9dec4
commit 785ae892f4

View File

@ -54,10 +54,11 @@ namespace osu.Game.Modes.Osu.Objects
progress = MathHelper.Clamp(progress, 0, 1);
double index = progress * (calculatedPath.Count - 1);
int flooredIndex = (int)index;
Vector2 pos = calculatedPath[(int)index];
if (index != (int)index)
pos += (calculatedPath[(int)index + 1] - pos) * (float)(index - (int)index);
Vector2 pos = calculatedPath[flooredIndex];
if (index != flooredIndex)
pos += (calculatedPath[flooredIndex + 1] - pos) * (float)(index - flooredIndex);
return pos;
}