render mirrored
This commit is contained in:
@@ -89,7 +89,7 @@ public class Circle extends GameObject {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(Graphics g, int trackPosition) {
|
||||
public void draw(Graphics g, int trackPosition, boolean mirror) {
|
||||
int timeDiff = hitObject.getTime() - trackPosition;
|
||||
final int approachTime = game.getApproachTime();
|
||||
final int fadeInTime = game.getFadeInTime();
|
||||
@@ -98,6 +98,11 @@ public class Circle extends GameObject {
|
||||
float fadeinScale = (timeDiff - approachTime + fadeInTime) / (float) fadeInTime;
|
||||
float alpha = Utils.clamp(1 - fadeinScale, 0, 1);
|
||||
|
||||
g.pushTransform();
|
||||
if (mirror) {
|
||||
g.rotate(x, y, -180f);
|
||||
}
|
||||
|
||||
if (GameMod.HIDDEN.isActive()) {
|
||||
final int hiddenDecayTime = game.getHiddenDecayTime();
|
||||
final int hiddenTimeDiff = game.getHiddenTimeDiff();
|
||||
@@ -122,6 +127,8 @@ public class Circle extends GameObject {
|
||||
GameImage.HITCIRCLE_OVERLAY.getImage().drawCentered(x, y, Colors.WHITE_FADE);
|
||||
|
||||
Colors.WHITE_FADE.a = oldAlpha;
|
||||
|
||||
g.popTransform();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -43,7 +43,7 @@ public class DummyObject extends GameObject {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(Graphics g, int trackPosition) {}
|
||||
public void draw(Graphics g, int trackPosition, boolean mirror) {}
|
||||
|
||||
@Override
|
||||
public boolean update(boolean overlap, int delta, int mouseX, int mouseY, boolean keyPressed, int trackPosition) {
|
||||
|
||||
@@ -43,7 +43,7 @@ public abstract class GameObject {
|
||||
* @param g the graphics context
|
||||
* @param trackPosition the current track position
|
||||
*/
|
||||
public abstract void draw(Graphics g, int trackPosition);
|
||||
public abstract void draw(Graphics g, int trackPosition, boolean mirrored);
|
||||
|
||||
/**
|
||||
* Updates the hit object.
|
||||
|
||||
@@ -176,7 +176,7 @@ public class Slider extends GameObject {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(Graphics g, int trackPosition) {
|
||||
public void draw(Graphics g, int trackPosition, boolean mirror) {
|
||||
int timeDiff = hitObject.getTime() - trackPosition;
|
||||
final int approachTime = game.getApproachTime();
|
||||
final int fadeInTime = game.getFadeInTime();
|
||||
@@ -196,6 +196,11 @@ public class Slider extends GameObject {
|
||||
curve.draw(color,curveInterval);
|
||||
color.a = alpha;
|
||||
|
||||
g.pushTransform();
|
||||
if (mirror) {
|
||||
g.rotate(x, y, -180f);
|
||||
}
|
||||
|
||||
/*
|
||||
// end circle
|
||||
Vec2f endCircPos = curve.pointAt(curveInterval);
|
||||
@@ -208,6 +213,8 @@ public class Slider extends GameObject {
|
||||
if (!overlayAboveNumber)
|
||||
hitCircleOverlay.drawCentered(x, y, Colors.WHITE_FADE);
|
||||
|
||||
g.popTransform();
|
||||
|
||||
// ticks
|
||||
if (ticksT != null) {
|
||||
float tickScale = 0.5f + 0.5f * AnimationEquation.OUT_BACK.calc(decorationsAlpha);
|
||||
@@ -215,10 +222,21 @@ public class Slider extends GameObject {
|
||||
for (int i = 0; i < ticksT.length; i++) {
|
||||
Vec2f c = curve.pointAt(ticksT[i]);
|
||||
Colors.WHITE_FADE.a = decorationsAlpha;
|
||||
g.pushTransform();
|
||||
if (mirror) {
|
||||
g.rotate(c.x, c.y, -180f);
|
||||
}
|
||||
tick.drawCentered(c.x, c.y, Colors.WHITE_FADE);
|
||||
g.popTransform();
|
||||
Colors.WHITE_FADE.a = alpha;
|
||||
}
|
||||
}
|
||||
|
||||
g.pushTransform();
|
||||
if (mirror) {
|
||||
g.rotate(x, y, -180f);
|
||||
}
|
||||
|
||||
if (GameMod.HIDDEN.isActive()) {
|
||||
final int hiddenDecayTime = game.getHiddenDecayTime();
|
||||
final int hiddenTimeDiff = game.getHiddenTimeDiff();
|
||||
@@ -235,6 +253,8 @@ public class Slider extends GameObject {
|
||||
if (overlayAboveNumber)
|
||||
hitCircleOverlay.drawCentered(x, y, Colors.WHITE_FADE);
|
||||
|
||||
g.popTransform();
|
||||
|
||||
// repeats
|
||||
if (curveInterval == 1.0f) {
|
||||
for (int tcurRepeat = currentRepeats; tcurRepeat <= currentRepeats + 1; tcurRepeat++) {
|
||||
@@ -264,8 +284,14 @@ public class Slider extends GameObject {
|
||||
|
||||
if (timeDiff >= 0) {
|
||||
// approach circle
|
||||
if (!GameMod.HIDDEN.isActive())
|
||||
g.pushTransform();
|
||||
if (mirror) {
|
||||
g.rotate(x, y, -180f);
|
||||
}
|
||||
if (!GameMod.HIDDEN.isActive()) {
|
||||
GameImage.APPROACHCIRCLE.getImage().getScaledCopy(approachScale).drawCentered(x, y, color);
|
||||
}
|
||||
g.popTransform();
|
||||
} else {
|
||||
// Since update() might not have run before drawing during a replay, the
|
||||
// slider time may not have been calculated, which causes NAN numbers and flicker.
|
||||
|
||||
@@ -175,7 +175,10 @@ public class Spinner extends GameObject {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(Graphics g, int trackPosition) {
|
||||
public void draw(Graphics g, int trackPosition, boolean mirror) {
|
||||
if (mirror) {
|
||||
return;
|
||||
}
|
||||
// only draw spinners shortly before start time
|
||||
int timeDiff = hitObject.getTime() - trackPosition;
|
||||
final int fadeInTime = game.getFadeInTime();
|
||||
|
||||
Reference in New Issue
Block a user