got rid of dependency injection, it doesn't add anything at this point and only slows down things and makes a mess. Also some refactoring.
This commit is contained in:
@@ -8,7 +8,8 @@ import itdelatrisu.opsu.objects.GameObject;
|
||||
import itdelatrisu.opsu.objects.curves.Vec2f;
|
||||
import org.newdawn.slick.Color;
|
||||
import org.newdawn.slick.Graphics;
|
||||
import yugecin.opsudance.options.Options;
|
||||
|
||||
import static yugecin.opsudance.core.InstanceContainer.displayContainer;
|
||||
|
||||
/**
|
||||
* This class is just a dummy {@link GameObject} to place in the middle of 2 GameObjects.
|
||||
@@ -22,8 +23,8 @@ public class FakeGameObject extends GameObject {
|
||||
public FakeGameObject() {
|
||||
this.start = new Vec2f();
|
||||
this.end = new Vec2f();
|
||||
this.start.x = this.end.x = Options.width / 2;
|
||||
this.start.y = this.end.y = Options.height / 2;
|
||||
this.start.x = this.end.x = displayContainer.width / 2;
|
||||
this.start.y = this.end.y = displayContainer.height / 2;
|
||||
}
|
||||
|
||||
public FakeGameObject(GameObject start, GameObject end) {
|
||||
|
||||
@@ -5,7 +5,8 @@ import itdelatrisu.opsu.Utils;
|
||||
import itdelatrisu.opsu.objects.GameObject;
|
||||
import yugecin.opsudance.movers.Mover;
|
||||
import yugecin.opsudance.movers.factories.AutoMoverFactory;
|
||||
import yugecin.opsudance.options.Options;
|
||||
|
||||
import static yugecin.opsudance.core.InstanceContainer.*;
|
||||
|
||||
/**
|
||||
* Created by Alex Wieser on 09.10.2016.
|
||||
@@ -130,6 +131,6 @@ public class CombinedSpiralMover extends Mover {
|
||||
}
|
||||
|
||||
private boolean checkBounds(double[] pos) {
|
||||
return 0 < pos[0] && pos[0] < Options.width && 0 < pos[1] && pos[1] < Options.height;
|
||||
return 0 < pos[0] && pos[0] < displayContainer.width && 0 < pos[1] && pos[1] < displayContainer.height;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,8 @@ import awlex.ospu.movers.CombinedSpiralMover;
|
||||
import yugecin.opsudance.movers.Mover;
|
||||
import awlex.ospu.movers.SpiralToMover;
|
||||
import yugecin.opsudance.movers.factories.MoverFactory;
|
||||
import yugecin.opsudance.options.Options;
|
||||
|
||||
import static yugecin.opsudance.core.InstanceContainer.displayContainer;
|
||||
|
||||
/**
|
||||
* Created by Alex Wieser on 09.10.2016.
|
||||
@@ -87,7 +88,7 @@ public class SpiralMoverFactory implements MoverFactory {
|
||||
* @return
|
||||
*/
|
||||
private boolean checkBounds(double[] pos) {
|
||||
return 0 < pos[0] && pos[0] < Options.width && 0 < pos[1] && pos[1] < Options.height;
|
||||
return 0 < pos[0] && pos[0] < displayContainer.width && 0 < pos[1] && pos[1] < displayContainer.height;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
package awlex.ospu.spinners;
|
||||
|
||||
import itdelatrisu.opsu.Utils;
|
||||
import yugecin.opsudance.options.Options;
|
||||
import yugecin.opsudance.spinners.Spinner;
|
||||
|
||||
import static yugecin.opsudance.core.InstanceContainer.*;
|
||||
|
||||
/**
|
||||
* Created by Alex Wieser on 09.10.2016.
|
||||
* WHO DO YOU THINK I AM?
|
||||
@@ -42,11 +43,11 @@ public class SpiralSpinner extends Spinner {
|
||||
double ang;
|
||||
double rad;
|
||||
for (int i = 0; i < SIZE / 2; i++) {
|
||||
MAX_RAD = (int) (Options.height * .35);
|
||||
MAX_RAD = (int) (displayContainer.height * .35);
|
||||
ang = (DENSITY * (Math.PI / SIZE) * i);
|
||||
rad = (MAX_RAD / (SIZE / 2)) * i;
|
||||
int offsetX = Options.width / 2;
|
||||
int offsetY = Options.height / 2;
|
||||
int offsetX = displayContainer.width / 2;
|
||||
int offsetY = displayContainer.height / 2;
|
||||
points[SIZE / 2 - 1 - i] = new double[]{
|
||||
offsetX + rad * Math.cos(ang),
|
||||
offsetY + rad * Math.sin(ang)
|
||||
@@ -83,12 +84,12 @@ public class SpiralSpinner extends Spinner {
|
||||
}
|
||||
|
||||
private void rotatePointAroundCenter(double[] point, double beta) {
|
||||
double angle = Math.atan2(point[1] - Options.height / 2, point[0] - Options.width / 2);
|
||||
double rad = Utils.distance(point[0], point[1], Options.width / 2, Options.height / 2);
|
||||
double angle = Math.atan2(point[1] - displayContainer.height / 2, point[0] - displayContainer.width / 2);
|
||||
double rad = Utils.distance(point[0], point[1], displayContainer.width / 2, displayContainer.height / 2);
|
||||
|
||||
//rotationMatrix
|
||||
point[0] = Options.width / 2 + rad * (Math.cos(angle) * Math.cos(beta) - Math.sin(angle) * Math.sin(beta));
|
||||
point[1] = Options.height / 2 + rad * (Math.cos(angle) * Math.sin(beta) + Math.sin(angle) * Math.cos(beta));
|
||||
point[0] = displayContainer.width / 2 + rad * (Math.cos(angle) * Math.cos(beta) - Math.sin(angle) * Math.sin(beta));
|
||||
point[1] = displayContainer.height / 2 + rad * (Math.cos(angle) * Math.sin(beta) + Math.sin(angle) * Math.cos(beta));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user