diff --git a/src/itdelatrisu/opsu/objects/Slider.java b/src/itdelatrisu/opsu/objects/Slider.java index c2064bbb..d86ba79e 100644 --- a/src/itdelatrisu/opsu/objects/Slider.java +++ b/src/itdelatrisu/opsu/objects/Slider.java @@ -124,6 +124,8 @@ public class Slider extends GameObject { public int baseSliderFrom; + private boolean reversed; + /** * Initializes the Slider data type with images and dimensions. * @param container the game container @@ -377,7 +379,17 @@ public class Slider extends GameObject { float curveIntervalTo = Options.isSliderSnaking() ? snakingSliderProgress : 1f; float curveIntervalFrom = 0f; if (Options.isShrinkingSliders()) { - float sliderprogress = (float) (trackPosition - getTime()) / sliderTimeTotal; + // 1 repeat = no repeats.. + if (repeats % 2 == 0 && curveIntervalTo == 1 && !reversed) { + // fix shrinking sliders for odd repeating sliders + reversed = true; + if (Options.isMergingSliders()) { + + } else { + curve.reverse(); + } + } + float sliderprogress = (trackPosition - getTime() - (sliderTime * (repeats - 1))) / sliderTime; if (sliderprogress > 0) { curveIntervalFrom = sliderprogress; } diff --git a/src/itdelatrisu/opsu/objects/curves/Curve.java b/src/itdelatrisu/opsu/objects/curves/Curve.java index 8509b637..4e23807a 100644 --- a/src/itdelatrisu/opsu/objects/curves/Curve.java +++ b/src/itdelatrisu/opsu/objects/curves/Curve.java @@ -159,6 +159,12 @@ public abstract class Curve { } } + public void reverse() { + if (renderState == null) + renderState = new CurveRenderState(hitObject, curve); + renderState.reverse(); + } + /** * 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 d44665f1..51872a38 100644 --- a/src/itdelatrisu/opsu/render/CurveRenderState.java +++ b/src/itdelatrisu/opsu/render/CurveRenderState.java @@ -66,6 +66,8 @@ public class CurveRenderState { private int lastPointDrawn; private int firstPointDrawn; + private boolean reversed; + /** * Set the width and height of the container that Curves get drawn into. * Should be called before any curves are drawn. @@ -110,6 +112,11 @@ public class CurveRenderState { createVertexBuffer(fbo.getVbo()); //write impossible value to make sure the fbo is cleared lastPointDrawn = -1; + reversed = false; + } + + public void reverse() { + reversed = !reversed; } /** @@ -322,7 +329,14 @@ public class CurveRenderState { if (clearFirst) { GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT); } - for (int i = from * 2; i < to * 2 - 1; ++i) + from = from * 2; + to = to * 2 - 1; + if (reversed) { + int a = from; + from = curve.length * 2 - 1 - to; + to = curve.length * 2 - 1 - a; + } + for (int i = from; i < to; ++i) GL11.glDrawArrays(GL11.GL_TRIANGLE_FAN, i * (NewCurveStyleState.DIVIDES + 2), NewCurveStyleState.DIVIDES + 2); GL11.glFlush(); GL20.glDisableVertexAttribArray(staticState.texCoordLoc);