diff --git a/src/itdelatrisu/opsu/ui/Cursor.java b/src/itdelatrisu/opsu/ui/Cursor.java index c7b46ffb..5c99f085 100644 --- a/src/itdelatrisu/opsu/ui/Cursor.java +++ b/src/itdelatrisu/opsu/ui/Cursor.java @@ -190,19 +190,25 @@ public class Cursor { // draw a fading trail float alpha = 0f; float t = 2f / cursorX.size(); - if (skin.isCursorTrailRotated()) - cursorTrail.setRotation(cursorAngle); + int cursorTrailWidth = cursorTrail.getWidth(), cursorTrailHeight = cursorTrail.getHeight(); + float cursorTrailRotation = (skin.isCursorTrailRotated()) ? cursorAngle : 0; Iterator iterX = cursorX.iterator(); Iterator iterY = cursorY.iterator(); + cursorTrail.startUse(); while (iterX.hasNext()) { int cx = iterX.next(); int cy = iterY.next(); alpha += t; - cursorTrail.setAlpha(alpha); + cursorTrail.setImageColor(1f, 1f, 1f, alpha); // if (cx != x || cy != y) - cursorTrail.drawCentered(cx, cy); + cursorTrail.drawEmbedded( + cx - (cursorTrailWidth / 2f), cy - (cursorTrailHeight / 2f), + cursorTrailWidth, cursorTrailHeight, cursorTrailRotation); } - cursorTrail.drawCentered(mouseX, mouseY); + cursorTrail.drawEmbedded( + mouseX - (cursorTrailWidth / 2f), mouseY - (cursorTrailHeight / 2f), + cursorTrailWidth, cursorTrailHeight, cursorTrailRotation); + cursorTrail.endUse(); // draw the other components if (newStyle && skin.isCursorRotated()) diff --git a/src/itdelatrisu/opsu/ui/StarStream.java b/src/itdelatrisu/opsu/ui/StarStream.java index 3d79aa52..ec42c2aa 100644 --- a/src/itdelatrisu/opsu/ui/StarStream.java +++ b/src/itdelatrisu/opsu/ui/StarStream.java @@ -77,9 +77,10 @@ public class StarStream { */ public void draw() { float t = animatedValue.getValue(); - starImg.setAlpha(Math.min((1 - t) * 5f, 1f)); - starImg.setRotation(angle); - starImg.draw(containerWidth - (distance * t), ((containerHeight - starImg.getHeight()) / 2) + yOffset); + starImg.setImageColor(1f, 1f, 1f, Math.min((1 - t) * 5f, 1f)); + starImg.drawEmbedded( + containerWidth - (distance * t), ((containerHeight - starImg.getHeight()) / 2) + yOffset, + starImg.getWidth(), starImg.getHeight(), angle); } /** @@ -107,8 +108,13 @@ public class StarStream { * Draws the star stream. */ public void draw() { + if (stars.isEmpty()) + return; + + starImg.startUse(); for (Star star : stars) star.draw(); + starImg.endUse(); } /**