first attempt at merging sliders
This commit is contained in:
@@ -44,7 +44,9 @@ import itdelatrisu.opsu.objects.Slider;
|
||||
import itdelatrisu.opsu.objects.Spinner;
|
||||
import itdelatrisu.opsu.objects.curves.Curve;
|
||||
import itdelatrisu.opsu.objects.curves.Vec2f;
|
||||
import itdelatrisu.opsu.render.CurveRenderState;
|
||||
import itdelatrisu.opsu.render.FrameBufferCache;
|
||||
import itdelatrisu.opsu.render.KnorkeCurveRenderStuff;
|
||||
import itdelatrisu.opsu.replay.PlaybackSpeed;
|
||||
import itdelatrisu.opsu.replay.Replay;
|
||||
import itdelatrisu.opsu.replay.ReplayFrame;
|
||||
@@ -52,9 +54,7 @@ import itdelatrisu.opsu.ui.*;
|
||||
import itdelatrisu.opsu.ui.animations.AnimationEquation;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.IdentityHashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.Stack;
|
||||
import java.util.*;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
import org.lwjgl.opengl.Display;
|
||||
@@ -72,6 +72,7 @@ import org.newdawn.slick.state.transition.EasedFadeOutTransition;
|
||||
import org.newdawn.slick.state.transition.EmptyTransition;
|
||||
import org.newdawn.slick.state.transition.FadeInTransition;
|
||||
import yugecin.opsudance.*;
|
||||
import yugecin.opsudance.objects.curves.FakeCombinedCurve;
|
||||
import yugecin.opsudance.ui.SBOverlay;
|
||||
|
||||
/**
|
||||
@@ -281,6 +282,8 @@ public class Game extends BasicGameState {
|
||||
private final Cursor mirrorCursor;
|
||||
private final SBOverlay sbOverlay;
|
||||
|
||||
private FakeCombinedCurve knorkesliders;
|
||||
|
||||
public Game(int state) {
|
||||
this.state = state;
|
||||
mirrorCursor = new Cursor(true);
|
||||
@@ -1453,6 +1456,15 @@ public class Game extends BasicGameState {
|
||||
}
|
||||
this.leadInTime += epiImgTime;
|
||||
SoundController.mute(false);
|
||||
|
||||
// let's create knorkesliders
|
||||
List<Vec2f> curvepoints = new ArrayList<>();
|
||||
for (GameObject gameObject : gameObjects) {
|
||||
if (gameObject.isSlider()) {
|
||||
curvepoints.addAll(Arrays.asList(((Slider) gameObject).getCurve().getCurvePoints()));
|
||||
}
|
||||
}
|
||||
knorkesliders = new FakeCombinedCurve(curvepoints.toArray(new Vec2f[curvepoints.size()]));
|
||||
}
|
||||
|
||||
|
||||
@@ -1495,12 +1507,26 @@ public class Game extends BasicGameState {
|
||||
GameMod.loadModState(previousMods);
|
||||
}
|
||||
|
||||
private float slidercurveFrom;
|
||||
private float slidercurveTo;
|
||||
|
||||
public void setSlidercurveFrom(int slidercurveFrom) {
|
||||
float pos = slidercurveFrom / knorkesliders.getCurvePoints().length;
|
||||
this.slidercurveFrom = Math.min(pos, this.slidercurveFrom);
|
||||
}
|
||||
|
||||
public void setSlidercurveTo(int slidercurveTo) {
|
||||
float pos = slidercurveTo / knorkesliders.getCurvePoints().length;
|
||||
this.slidercurveTo = Math.max(pos, this.slidercurveTo);
|
||||
}
|
||||
|
||||
/**
|
||||
* Draws hit objects, hit results, and follow points.
|
||||
* @param g the graphics context
|
||||
* @param trackPosition the track position
|
||||
*/
|
||||
private void drawHitObjects(Graphics g, int trackPosition) {
|
||||
knorkesliders.draw(Color.white, this.slidercurveFrom, this.slidercurveTo);
|
||||
// include previous object in follow points
|
||||
int lastObjectIndex = -1;
|
||||
if (objectIndex > 0 && objectIndex < beatmap.objects.length &&
|
||||
|
||||
Reference in New Issue
Block a user