@2x size images.
ComboBurst speed scaling. CircumscribedCircle drawing optimization.
This commit is contained in:
@@ -140,7 +140,7 @@ public class Slider implements HitObject {
|
||||
this.color = color;
|
||||
this.comboEnd = comboEnd;
|
||||
|
||||
if (hitObject.getSliderType() == 'P' && hitObject.getSliderX().length == 2)
|
||||
if (hitObject.getSliderType() == OsuHitObject.SLIDER_PASSTHROUGH && hitObject.getSliderX().length == 2)
|
||||
this.curve = new CircumscribedCircle(hitObject, color);
|
||||
else
|
||||
this.curve = new LinearBezier(hitObject, color);
|
||||
|
||||
@@ -55,6 +55,9 @@ public class CircumscribedCircle extends Curve {
|
||||
|
||||
/** The number of steps in the curve to draw. */
|
||||
private float step;
|
||||
|
||||
/** Points along the curve. */
|
||||
private Vec2f[] curve;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
@@ -120,6 +123,12 @@ public class CircumscribedCircle extends Curve {
|
||||
// finds the angles to draw for repeats
|
||||
this.drawEndAngle = (float) ((endAng + (startAng > endAng ? HALF_PI : -HALF_PI)) * 180 / Math.PI);
|
||||
this.drawStartAngle = (float) ((startAng + (startAng > endAng ? -HALF_PI : HALF_PI)) * 180 / Math.PI);
|
||||
|
||||
curve = new Vec2f[(int) step + 1];
|
||||
for (int i = 0; i < curve.length; i++) {
|
||||
float[] xy = pointAt(i / step);
|
||||
curve[i] = new Vec2f(xy[0], xy[1]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -172,13 +181,11 @@ public class CircumscribedCircle extends Curve {
|
||||
public void draw() {
|
||||
Image hitCircle = GameImage.HITCIRCLE.getImage();
|
||||
Image hitCircleOverlay = GameImage.HITCIRCLE_OVERLAY.getImage();
|
||||
float[][] xy = new float[(int) step + 1][];
|
||||
for (int i = 0; i < step; i++) {
|
||||
xy[i] = pointAt(i / step);
|
||||
hitCircleOverlay.drawCentered(xy[i][0], xy[i][1], Utils.COLOR_WHITE_FADE);
|
||||
hitCircleOverlay.drawCentered(curve[i].x, curve[i].y, Utils.COLOR_WHITE_FADE);
|
||||
}
|
||||
for (int i = 0; i < step; i++)
|
||||
hitCircle.drawCentered(xy[i][0], xy[i][1], color);
|
||||
hitCircle.drawCentered(curve[i].x, curve[i].y, color);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user