Skip to content

Commit

Permalink
Cursor trail now considers actual FPS (not target FPS). (fixes #109)
Browse files Browse the repository at this point in the history
Signed-off-by: Jeffrey Han <[email protected]>
  • Loading branch information
itdelatrisu committed Jul 16, 2015
1 parent 4e2074e commit 5dac21a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/itdelatrisu/opsu/ui/Cursor.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
}
Expand Down

0 comments on commit 5dac21a

Please sign in to comment.