something

This commit is contained in:
Awlex 2016-11-19 22:47:27 +01:00
parent 3bd16a8593
commit a671f9dba2
4 changed files with 23 additions and 22 deletions

View File

@ -70,8 +70,6 @@ public class ArcMover extends PolyMover {
percent = ((double) time - middle.getTime()) / (p2.getTime() - middle.getTime()); percent = ((double) time - middle.getTime()) / (p2.getTime() - middle.getTime());
angle = beta + (gamma - beta) * percent; angle = beta + (gamma - beta) * percent;
} }
if (angle > PI)
angle -= PI;
return new double[]{ return new double[]{
xm + r * cos(angle), xm + r * cos(angle),
ym + r * sin(angle) ym + r * sin(angle)

View File

@ -18,7 +18,8 @@ public class ArcFactory implements PolyMoverFactory {
public double[] getPointAt(int time) { public double[] getPointAt(int time) {
if (previous == null) { if (previous == null) {
return current.getPointAt(time); return current.getPointAt(time);
} else if (current == null) { }
if (current == null) {
return previous.getPointAt(time); return previous.getPointAt(time);
} }
@ -45,7 +46,9 @@ public class ArcFactory implements PolyMoverFactory {
startIndex++; startIndex++;
} }
GameObject middle = objects[startIndex + 1]; GameObject middle = objects[startIndex + 1];
if (middle.isSlider() || middle.isSpinner() || !ArcMover.canCricleExistBetweenItems(objects[startIndex], middle, objects[startIndex + 2])) if (middle.isSlider() || middle.isSpinner())
return;
if (!ArcMover.canCricleExistBetweenItems(objects[startIndex], middle, objects[startIndex + 2]))
current = new LineMover(objects, startIndex, 3); current = new LineMover(objects, startIndex, 3);
else else
current = new ArcMover(objects[startIndex], middle, objects[startIndex + 2]); current = new ArcMover(objects[startIndex], middle, objects[startIndex + 2]);
@ -57,7 +60,6 @@ public class ArcFactory implements PolyMoverFactory {
public void update(GameObject p) { public void update(GameObject p) {
GameObject[] items = current.getItems(); GameObject[] items = current.getItems();
System.out.println(items.length);
GameObject last = items[items.length - 1]; GameObject last = items[items.length - 1];
if (last != p) { if (last != p) {
previous = current; previous = current;

View File

@ -594,7 +594,7 @@ public class Options {
DISABLE_UPDATER ("Disable Automatic Updates", "DisableUpdater", "Disable automatic checking for updates upon starting opsu!.", false), DISABLE_UPDATER ("Disable Automatic Updates", "DisableUpdater", "Disable automatic checking for updates upon starting opsu!.", false),
ENABLE_WATCH_SERVICE ("Enable Watch Service", "WatchService", "Watch the beatmap directory for changes. Requires a restart.", false), ENABLE_WATCH_SERVICE ("Enable Watch Service", "WatchService", "Watch the beatmap directory for changes. Requires a restart.", false),
DANCE_MOVER_TYPE("Mover Type", "Mover type", "More Points", Dancer.multipoint) { DANCE_MOVER_TYPE("Mover Type", "Mover type", "More than 2 Points", Dancer.multipoint) {
@Override @Override
public void click(GameContainer container) { public void click(GameContainer container) {
bool = !bool; bool = !bool;

View File

@ -266,16 +266,17 @@ public class Dancer {
double[] spinnerStartPoint = spinner.getPoint(); double[] spinnerStartPoint = spinner.getPoint();
c.start = new Vec2f((float) spinnerStartPoint[0], (float) spinnerStartPoint[1]); c.start = new Vec2f((float) spinnerStartPoint[0], (float) spinnerStartPoint[1]);
} }
if (polyMoverFactory.isInitialized() && polyMoverFactory.getLatestIndex() < objectIndex + polyMoverFactory.getPrefferedBufferSize() - 1) {
polyMoverFactory.update(gameObjects[ objectIndex + polyMoverFactory.getPrefferedBufferSize() - 1]); if (polyMoverFactory.isInitialized() && polyMoverFactory.getLatestIndex() < objectIndex + polyMoverFactory.getPrefferedBufferSize()) {
polyMoverFactory.update(gameObjects[polyMoverFactory.getLatestIndex()]);
} }
else { else {
polyMoverFactory.init(gameObjects, objectIndex); polyMoverFactory.init(gameObjects, objectIndex - 1);
} }
} }
if (time < c.getTime()) { if (time < c.getTime()) {
if (!p.isSpinner() || !c.isSpinner()) { if (!p.isSpinner() || !c.isSpinner() && polyMoverFactory.isInitialized()) {
double[] point = polyMoverFactory.getPointAt(time); double[] point = polyMoverFactory.getPointAt(time);
x = (float) point[0]; x = (float) point[0];
y = (float) point[1]; y = (float) point[1];