diff --git a/src/itdelatrisu/opsu/objects/Slider.java b/src/itdelatrisu/opsu/objects/Slider.java index d86ba79e..35514ddd 100644 --- a/src/itdelatrisu/opsu/objects/Slider.java +++ b/src/itdelatrisu/opsu/objects/Slider.java @@ -383,9 +383,7 @@ public class Slider extends GameObject { if (repeats % 2 == 0 && curveIntervalTo == 1 && !reversed) { // fix shrinking sliders for odd repeating sliders reversed = true; - if (Options.isMergingSliders()) { - - } else { + if (!Options.isMergingSliders()) { curve.reverse(); } } @@ -396,7 +394,12 @@ public class Slider extends GameObject { } if (Options.isMergingSliders()) { if (Options.isShrinkingSliders() && curveIntervalFrom > 0) { - game.setSlidercurveFrom(baseSliderFrom + (int) (curveIntervalFrom * curve.getCurvePoints().length)); + int curvelen = curve.getCurvePoints().length; + if (repeats % 2 == 0) { + game.spliceSliderCurve(baseSliderFrom + (int) ((1f - curveIntervalFrom) * curvelen), baseSliderFrom + curvelen); + } else { + game.setSlidercurveFrom(baseSliderFrom + (int) (curveIntervalFrom * curvelen)); + } } game.setSlidercurveTo(baseSliderFrom + (int) (curveIntervalTo * curve.getCurvePoints().length)); } else { @@ -587,7 +590,7 @@ public class Slider extends GameObject { // calculate and send slider result hitResult(); if (Options.isMergingSliders()) { - game.setSlidercurveFrom(baseSliderFrom + curve.getCurvePoints().length); + game.setSlidercurveFrom(baseSliderFrom + curve.getCurvePoints().length + 1); } return true; } diff --git a/src/itdelatrisu/opsu/objects/curves/Curve.java b/src/itdelatrisu/opsu/objects/curves/Curve.java index 4e23807a..d09fc31d 100644 --- a/src/itdelatrisu/opsu/objects/curves/Curve.java +++ b/src/itdelatrisu/opsu/objects/curves/Curve.java @@ -160,11 +160,13 @@ public abstract class Curve { } public void reverse() { - if (renderState == null) - renderState = new CurveRenderState(hitObject, curve); renderState.reverse(); } + public void splice(int from, int to) { + renderState.splice(from, to); + } + /** * Returns the angle of the first control point. */ diff --git a/src/itdelatrisu/opsu/render/CurveRenderState.java b/src/itdelatrisu/opsu/render/CurveRenderState.java index 51872a38..21d7199c 100644 --- a/src/itdelatrisu/opsu/render/CurveRenderState.java +++ b/src/itdelatrisu/opsu/render/CurveRenderState.java @@ -68,6 +68,9 @@ public class CurveRenderState { private boolean reversed; + private int spliceFrom; + private int spliceTo; + /** * Set the width and height of the container that Curves get drawn into. * Should be called before any curves are drawn. @@ -113,12 +116,20 @@ public class CurveRenderState { //write impossible value to make sure the fbo is cleared lastPointDrawn = -1; reversed = false; + spliceFrom = spliceTo = -1; } public void reverse() { reversed = !reversed; } + public void splice(int from, int to) { + spliceFrom = from * 2; + spliceTo = to * 2; + firstPointDrawn = -1; // force redraw + lastPointDrawn = -1; // force redraw + } + /** * Draw a curve to the screen that's tinted with `color`. The first time * this is called this caches the image result of the curve and on subsequent @@ -336,8 +347,12 @@ public class CurveRenderState { from = curve.length * 2 - 1 - to; to = curve.length * 2 - 1 - a; } - for (int i = from; i < to; ++i) + for (int i = from; i < to; ++i) { + if (spliceFrom <= i && i <= spliceTo) { + continue; + } GL11.glDrawArrays(GL11.GL_TRIANGLE_FAN, i * (NewCurveStyleState.DIVIDES + 2), NewCurveStyleState.DIVIDES + 2); + } GL11.glFlush(); GL20.glDisableVertexAttribArray(staticState.texCoordLoc); GL20.glDisableVertexAttribArray(staticState.attribLoc); diff --git a/src/itdelatrisu/opsu/states/Game.java b/src/itdelatrisu/opsu/states/Game.java index 7c177319..6ea75fd9 100644 --- a/src/itdelatrisu/opsu/states/Game.java +++ b/src/itdelatrisu/opsu/states/Game.java @@ -1523,6 +1523,10 @@ public class Game extends BasicGameState { this.slidercurveTo = Math.max(pos, this.slidercurveTo); } + public void spliceSliderCurve(int from, int to) { + this.knorkesliders.splice(from, to); + } + /** * Draws hit objects, hit results, and follow points. * @param g the graphics context