From 5dac21a5458bb2f3f963926f642a47d69628b72b Mon Sep 17 00:00:00 2001 From: Jeffrey Han Date: Thu, 16 Jul 2015 18:14:46 -0500 Subject: [PATCH] Cursor trail now considers actual FPS (not target FPS). (fixes #109) Signed-off-by: Jeffrey Han --- src/itdelatrisu/opsu/ui/Cursor.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/itdelatrisu/opsu/ui/Cursor.java b/src/itdelatrisu/opsu/ui/Cursor.java index 252a9c2c..a35c405c 100644 --- a/src/itdelatrisu/opsu/ui/Cursor.java +++ b/src/itdelatrisu/opsu/ui/Cursor.java @@ -125,7 +125,7 @@ public void draw(int mouseX, int mouseY, boolean mousePressed) { cursorMiddle = GameImage.CURSOR_MIDDLE.getImage(); int removeCount = 0; - int FPSmod = (Options.getTargetFPS() / 60); + float FPSmod = Math.max(container.getFPS(), 1) / 60f; Skin skin = Options.getSkin(); // scale cursor @@ -151,13 +151,13 @@ public void draw(int mouseX, int mouseY, boolean mousePressed) { lastX = mouseX; lastY = mouseY; - removeCount = (cursorX.size() / (6 * FPSmod)) + 1; + removeCount = (int) (cursorX.size() / (6 * FPSmod)) + 1; } else { // old style: sample one point at a time cursorX.add(mouseX); cursorY.add(mouseY); - int max = 10 * FPSmod; + int max = (int) (10 * FPSmod); if (cursorX.size() > max) removeCount = cursorX.size() - max; }