From 9a73ab23e96c8180683ddda695b80d9bfe17c020 Mon Sep 17 00:00:00 2001 From: yugecin Date: Thu, 29 Sep 2016 21:40:42 +0200 Subject: [PATCH 1/7] render mirrored --- src/itdelatrisu/opsu/objects/Circle.java | 9 +++++- src/itdelatrisu/opsu/objects/DummyObject.java | 2 +- src/itdelatrisu/opsu/objects/GameObject.java | 2 +- src/itdelatrisu/opsu/objects/Slider.java | 30 +++++++++++++++++-- src/itdelatrisu/opsu/objects/Spinner.java | 5 +++- src/itdelatrisu/opsu/states/Game.java | 28 +++++++++++------ 6 files changed, 61 insertions(+), 15 deletions(-) diff --git a/src/itdelatrisu/opsu/objects/Circle.java b/src/itdelatrisu/opsu/objects/Circle.java index a03d4889..f000b234 100644 --- a/src/itdelatrisu/opsu/objects/Circle.java +++ b/src/itdelatrisu/opsu/objects/Circle.java @@ -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(); } /** diff --git a/src/itdelatrisu/opsu/objects/DummyObject.java b/src/itdelatrisu/opsu/objects/DummyObject.java index 40f51f08..7edc6a94 100644 --- a/src/itdelatrisu/opsu/objects/DummyObject.java +++ b/src/itdelatrisu/opsu/objects/DummyObject.java @@ -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) { diff --git a/src/itdelatrisu/opsu/objects/GameObject.java b/src/itdelatrisu/opsu/objects/GameObject.java index a4f8ac78..ce5c2d06 100644 --- a/src/itdelatrisu/opsu/objects/GameObject.java +++ b/src/itdelatrisu/opsu/objects/GameObject.java @@ -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. diff --git a/src/itdelatrisu/opsu/objects/Slider.java b/src/itdelatrisu/opsu/objects/Slider.java index 8e2985fc..548a5bb1 100644 --- a/src/itdelatrisu/opsu/objects/Slider.java +++ b/src/itdelatrisu/opsu/objects/Slider.java @@ -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. diff --git a/src/itdelatrisu/opsu/objects/Spinner.java b/src/itdelatrisu/opsu/objects/Spinner.java index 48f0803f..6b48d7ba 100644 --- a/src/itdelatrisu/opsu/objects/Spinner.java +++ b/src/itdelatrisu/opsu/objects/Spinner.java @@ -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(); diff --git a/src/itdelatrisu/opsu/states/Game.java b/src/itdelatrisu/opsu/states/Game.java index a471f0bd..93c2e0f0 100644 --- a/src/itdelatrisu/opsu/states/Game.java +++ b/src/itdelatrisu/opsu/states/Game.java @@ -47,10 +47,7 @@ import itdelatrisu.opsu.render.FrameBufferCache; import itdelatrisu.opsu.replay.PlaybackSpeed; import itdelatrisu.opsu.replay.Replay; import itdelatrisu.opsu.replay.ReplayFrame; -import itdelatrisu.opsu.ui.Colors; -import itdelatrisu.opsu.ui.Fonts; -import itdelatrisu.opsu.ui.MenuButton; -import itdelatrisu.opsu.ui.UI; +import itdelatrisu.opsu.ui.*; import itdelatrisu.opsu.ui.animations.AnimationEquation; import java.io.File; @@ -269,8 +266,11 @@ public class Game extends BasicGameState { private Input input; private final int state; + private final Cursor mirrorCursor; + public Game(int state) { this.state = state; + mirrorCursor = new Cursor(); } @Override @@ -599,8 +599,14 @@ public class Game extends BasicGameState { if (isReplay) UI.draw(g, replayX, replayY, replayKeyPressed); - else if (GameMod.AUTO.isActive()) + else if (GameMod.AUTO.isActive()) { UI.draw(g, (int) autoMousePosition.x, (int) autoMousePosition.y, autoMousePressed); + double dx = autoMousePosition.x - Options.width / 2d; + double dy = autoMousePosition.y - Options.height / 2d; + double d = Math.sqrt(dx * dx + dy * dy); + double a = Math.atan2(dy, dx) + Math.PI; + mirrorCursor.draw((int) (Math.cos(a) * d + Options.width / 2), (int) (Math.sin(a) * d + Options.height / 2), autoMousePressed); + } else if (GameMod.AUTOPILOT.isActive()) UI.draw(g, (int) autoMousePosition.x, (int) autoMousePosition.y, Utils.isGameKeyPressed()); else @@ -1389,9 +1395,13 @@ public class Game extends BasicGameState { GameObject gameObj = gameObjects[idx]; // normal case - if (!loseState) - gameObj.draw(g, trackPosition); - + if (!loseState) { + gameObj.draw(g, trackPosition, false); + g.pushTransform(); + g.rotate(Options.width / 2f, Options.height / 2f, 180f); + gameObj.draw(g, trackPosition, true); + g.popTransform(); + } // death: make objects "fall" off the screen else { // time the object began falling @@ -1417,7 +1427,7 @@ public class Game extends BasicGameState { g.translate(0, dt * dt * container.getHeight()); Vec2f rotationCenter = gameObj.getPointAt(beatmap.objects[idx].getTime()); g.rotate(rotationCenter.x, rotationCenter.y, rotSpeed * dt); - gameObj.draw(g, trackPosition); + gameObj.draw(g, trackPosition, false); g.popTransform(); } From 33895b24c88bf18d48a4a3e776ea5a846356a08f Mon Sep 17 00:00:00 2001 From: yugecin Date: Thu, 29 Sep 2016 21:55:23 +0200 Subject: [PATCH 2/7] =?UTF-8?q?mirrored=20objects=20+180=C2=B0=20hue?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/itdelatrisu/opsu/objects/Circle.java | 15 +++++++++++++++ src/itdelatrisu/opsu/objects/Slider.java | 16 ++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/src/itdelatrisu/opsu/objects/Circle.java b/src/itdelatrisu/opsu/objects/Circle.java index f000b234..3ccfdcc6 100644 --- a/src/itdelatrisu/opsu/objects/Circle.java +++ b/src/itdelatrisu/opsu/objects/Circle.java @@ -90,6 +90,20 @@ public class Circle extends GameObject { @Override public void draw(Graphics g, int trackPosition, boolean mirror) { + Color orig = color; + if (mirror) { + double H = 180d; + double U = Math.cos(H * Math.PI / 180d); + double W = Math.sin(H * Math.PI / 180d); + + Color n = new Color(0, 0, 0); + n.r = (float) ((0.299d + 0.701d * U + 0.168d * W) * color.r + (0.587d - 0.587d * U + 0.330d * W) * color.g + (0.114d - 0.114d * U - 0.497 * W) * color.b); + n.g = (float) ((0.299 + 0.299 * U - 0.328 * W) * color.r + (0.587d - 0.413 * U + 0.035 * W) * color.g + (0.114d - 0.114d * U - 0.292 * W) * color.b); + n.b = (float) ((0.299d + 0.300d * U + 1.250d * W) * color.r + (0.587d - 0.585d * U + 1.050d * W) * color.g + (0.114 - 0.886 * U - 0.203 * W) * color.b); + n.a = color.a; + color = n; + } + int timeDiff = hitObject.getTime() - trackPosition; final int approachTime = game.getApproachTime(); final int fadeInTime = game.getFadeInTime(); @@ -129,6 +143,7 @@ public class Circle extends GameObject { Colors.WHITE_FADE.a = oldAlpha; g.popTransform(); + color = orig; } /** diff --git a/src/itdelatrisu/opsu/objects/Slider.java b/src/itdelatrisu/opsu/objects/Slider.java index 548a5bb1..e0fe3719 100644 --- a/src/itdelatrisu/opsu/objects/Slider.java +++ b/src/itdelatrisu/opsu/objects/Slider.java @@ -177,6 +177,20 @@ public class Slider extends GameObject { @Override public void draw(Graphics g, int trackPosition, boolean mirror) { + Color orig = color; + if (mirror) { + double H = 180d; + double U = Math.cos(H * Math.PI / 180d); + double W = Math.sin(H * Math.PI / 180d); + + Color n = new Color(0, 0, 0); + n.r = (float) ((0.299d + 0.701d * U + 0.168d * W) * color.r + (0.587d - 0.587d * U + 0.330d * W) * color.g + (0.114d - 0.114d * U - 0.497 * W) * color.b); + n.g = (float) ((0.299 + 0.299 * U - 0.328 * W) * color.r + (0.587d - 0.413 * U + 0.035 * W) * color.g + (0.114d - 0.114d * U - 0.292 * W) * color.b); + n.b = (float) ((0.299d + 0.300d * U + 1.250d * W) * color.r + (0.587d - 0.585d * U + 1.050d * W) * color.g + (0.114 - 0.886 * U - 0.203 * W) * color.b); + n.a = color.a; + color = n; + } + int timeDiff = hitObject.getTime() - trackPosition; final int approachTime = game.getApproachTime(); final int fadeInTime = game.getFadeInTime(); @@ -329,6 +343,8 @@ public class Slider extends GameObject { } Colors.WHITE_FADE.a = oldAlpha; + + color = orig; } /** From d3af3c17d0770f7301ce77610ca1db02d195e2fc Mon Sep 17 00:00:00 2001 From: yugecin Date: Thu, 29 Sep 2016 22:41:56 +0200 Subject: [PATCH 3/7] move shit to utils --- src/itdelatrisu/opsu/Utils.java | 12 ++++++++++++ src/itdelatrisu/opsu/objects/Circle.java | 11 +---------- src/itdelatrisu/opsu/objects/Slider.java | 11 +---------- 3 files changed, 14 insertions(+), 20 deletions(-) diff --git a/src/itdelatrisu/opsu/Utils.java b/src/itdelatrisu/opsu/Utils.java index 9ff34ffe..1e669712 100644 --- a/src/itdelatrisu/opsu/Utils.java +++ b/src/itdelatrisu/opsu/Utils.java @@ -58,6 +58,7 @@ import org.lwjgl.BufferUtils; import org.lwjgl.opengl.Display; import org.lwjgl.opengl.GL11; import org.newdawn.slick.Animation; +import org.newdawn.slick.Color; import org.newdawn.slick.GameContainer; import org.newdawn.slick.Input; import org.newdawn.slick.state.StateBasedGame; @@ -575,4 +576,15 @@ public class Utils { return y < Options.height / 2d ? 1 : 4; } + public static Color shiftHue(Color color, double H) { + double U = Math.cos(H * Math.PI / 180d); + double W = Math.sin(H * Math.PI / 180d); + + Color n = new Color(0, 0, 0); + n.r = (float) ((0.299d + 0.701d * U + 0.168d * W) * color.r + (0.587d - 0.587d * U + 0.330d * W) * color.g + (0.114d - 0.114d * U - 0.497 * W) * color.b); + n.g = (float) ((0.299 + 0.299 * U - 0.328 * W) * color.r + (0.587d - 0.413 * U + 0.035 * W) * color.g + (0.114d - 0.114d * U - 0.292 * W) * color.b); + n.b = (float) ((0.299d + 0.300d * U + 1.250d * W) * color.r + (0.587d - 0.585d * U + 1.050d * W) * color.g + (0.114 - 0.886 * U - 0.203 * W) * color.b); + return n; + } + } diff --git a/src/itdelatrisu/opsu/objects/Circle.java b/src/itdelatrisu/opsu/objects/Circle.java index 3ccfdcc6..f76460b8 100644 --- a/src/itdelatrisu/opsu/objects/Circle.java +++ b/src/itdelatrisu/opsu/objects/Circle.java @@ -92,16 +92,7 @@ public class Circle extends GameObject { public void draw(Graphics g, int trackPosition, boolean mirror) { Color orig = color; if (mirror) { - double H = 180d; - double U = Math.cos(H * Math.PI / 180d); - double W = Math.sin(H * Math.PI / 180d); - - Color n = new Color(0, 0, 0); - n.r = (float) ((0.299d + 0.701d * U + 0.168d * W) * color.r + (0.587d - 0.587d * U + 0.330d * W) * color.g + (0.114d - 0.114d * U - 0.497 * W) * color.b); - n.g = (float) ((0.299 + 0.299 * U - 0.328 * W) * color.r + (0.587d - 0.413 * U + 0.035 * W) * color.g + (0.114d - 0.114d * U - 0.292 * W) * color.b); - n.b = (float) ((0.299d + 0.300d * U + 1.250d * W) * color.r + (0.587d - 0.585d * U + 1.050d * W) * color.g + (0.114 - 0.886 * U - 0.203 * W) * color.b); - n.a = color.a; - color = n; + color = Utils.shiftHue(color, 180d); } int timeDiff = hitObject.getTime() - trackPosition; diff --git a/src/itdelatrisu/opsu/objects/Slider.java b/src/itdelatrisu/opsu/objects/Slider.java index e0fe3719..1f7562dc 100644 --- a/src/itdelatrisu/opsu/objects/Slider.java +++ b/src/itdelatrisu/opsu/objects/Slider.java @@ -179,16 +179,7 @@ public class Slider extends GameObject { public void draw(Graphics g, int trackPosition, boolean mirror) { Color orig = color; if (mirror) { - double H = 180d; - double U = Math.cos(H * Math.PI / 180d); - double W = Math.sin(H * Math.PI / 180d); - - Color n = new Color(0, 0, 0); - n.r = (float) ((0.299d + 0.701d * U + 0.168d * W) * color.r + (0.587d - 0.587d * U + 0.330d * W) * color.g + (0.114d - 0.114d * U - 0.497 * W) * color.b); - n.g = (float) ((0.299 + 0.299 * U - 0.328 * W) * color.r + (0.587d - 0.413 * U + 0.035 * W) * color.g + (0.114d - 0.114d * U - 0.292 * W) * color.b); - n.b = (float) ((0.299d + 0.300d * U + 1.250d * W) * color.r + (0.587d - 0.585d * U + 1.050d * W) * color.g + (0.114 - 0.886 * U - 0.203 * W) * color.b); - n.a = color.a; - color = n; + color = Utils.shiftHue(color, 180d); } int timeDiff = hitObject.getTime() - trackPosition; From 923f8dcb49b0d67bd8b4c4b77fb40d05dba6bd68 Mon Sep 17 00:00:00 2001 From: yugecin Date: Thu, 29 Sep 2016 22:45:16 +0200 Subject: [PATCH 4/7] black sliders --- src/itdelatrisu/opsu/objects/Slider.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/itdelatrisu/opsu/objects/Slider.java b/src/itdelatrisu/opsu/objects/Slider.java index 1f7562dc..ddc50f83 100644 --- a/src/itdelatrisu/opsu/objects/Slider.java +++ b/src/itdelatrisu/opsu/objects/Slider.java @@ -32,6 +32,7 @@ import itdelatrisu.opsu.states.Game; import itdelatrisu.opsu.ui.Colors; import itdelatrisu.opsu.ui.animations.AnimationEquation; +import org.lwjgl.opengl.GL11; import org.newdawn.slick.Color; import org.newdawn.slick.GameContainer; import org.newdawn.slick.Graphics; @@ -109,6 +110,8 @@ public class Slider extends GameObject { private int repeats; + private static Color curveColor = new Color(0, 0, 0); + /** * Initializes the Slider data type with images and dimensions. * @param container the game container @@ -198,7 +201,7 @@ public class Slider extends GameObject { Vec2f endPos = curve.pointAt(1); float curveInterval = Options.isSliderSnaking() ? alpha : 1f; - curve.draw(color,curveInterval); + curve.draw(curveColor, curveInterval); color.a = alpha; g.pushTransform(); From 0d89c2612d31cbe03df031521d936cf2ab27bc3b Mon Sep 17 00:00:00 2001 From: yugecin Date: Thu, 29 Sep 2016 23:22:41 +0200 Subject: [PATCH 5/7] attempt to make sliderbody look better --- res/slidergradient.png | Bin 3918 -> 1492 bytes src/itdelatrisu/opsu/objects/Slider.java | 2 +- .../opsu/render/CurveRenderState.java | 4 ++-- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/res/slidergradient.png b/res/slidergradient.png index 6939923f2c7e555ce48a51772c4eea3fa35b8d80..1337613a92d7f781cf27628eb59ca314453b2dd2 100644 GIT binary patch literal 1492 zcmZ8hc~BE~6n?vGLK3b}5YQ-Y5rhgw6a=jnHpnRiP^?1QK~RuOiPe>G6kP*FkU>Oh zrznMB4b-*@D4>HtuuSctGa#1=gAr+QQ89=a!9=7RtTRskc>CLZZ{GKP`;K2>L|C8+ zZxIgwOoD^_wg8~aD_C;a%u^@-I)*v0M4?Cs&`@IZI*!GBbN2;B9{?~i)f+;zk1#+vYUKEncAAQl9HCFzj(!0O!7Fk=FKbIh!w*0KC)aKE zR57h6QJB@#)>@B^jajj0*ZBA--PW(a=C*F#tCCjr&pDoDw`>ovTK2U3O`2Z<#mQqYE4VG)Ntykm7BUd-wNe zS@h_ZG@JG4?3#aX6bvT!WT%cFti2=OUJ;WYLuOqMRzLS_Q|}s*U#NK`PZYH{G}q$8 zf~Q=1Rc&DP(eG_#c5a73~YT@kQ%rdz2gTzoJI3#(^r4;6Xb#x;{_|{0E{Wn2hDvwH< zanG$Ap@%qtQVZ*RHy0YayfqWEn8G8D5fPmP8?)uv@uQ4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^> zccA4wSm*?Eohv{rpLlZfY7~imEpVQr!BJ_jT*Z{T-@6D${<2QNY)~@f%2W-2`n6ucb)K)o&^-lec7?`x(@nX110s6BYQKA} zk1_{iahR|xmw1(-N?GnpmSN^PL?azcd!j5rgD~_j0mxYG2t^`tD)UYbz?N;Mk-`Z(oC1YGZ-FL35HQ9gHr~zd=^?3VI=T4-56u__3RSM zs_ui%VL?O9J1g2)mH2h@XtErZUOS0N4Fhl&8z={?;&BCJS?J7g{s0(Gf*obP4Fvyl z+8bUa>~@KfUFSL$xfT)Xw9mS9Qvvx^_bb3(_1#wq#(sVT?aw(Nr2z9}!_|m&M~LFT zj{WLNi(yO;7x`jh)7Ej~5eDE9K=6n&e@;dLo4Do)YqZNmpoMm-6zWP-%kHRj1@)lH8G`<7k4UmXOayIh&A~jb@1sM49rU&^> z{`BC5XZ~VBeeJ@A6s?D#0>dJD^uH?M=TF03qoyI0T0Yyq!CHlSlKoTOOcl(Pg;b}SWyJ{*h@ zxO4)m20X%e8m+3gBVL_E*9`unSqIEuk)0be?sZ(Hljup?kuwt80|77lb6C>fAqv2s zoy`IxU}{dcO!d0aQy6l=cdY_=FUS4tNq|@kfO|%_7S6J>6T(!m>M$S!bz*=1&U74X zCnO*ub#_+tU$tOGK|^9Gb<~PQ>!6*gE$=xvMw!UCMn+x25U%7@sC!kBGZtXljOk`5 z@p>THS^HFPJ7tl7X3?QjrQ#jY+c^k^!*q1@@db0mlO8E}(6%DCF~t!fkjKi{ za`-kt5w%fi{McD||osA`1G3E(WEm9L!fOl2=^|PL!JBq zYl0R4Rp*3qV0D~>%=WHy_LkwM$`zGf?QgHLg(iw$!AA!08^wXs01S Date: Thu, 29 Sep 2016 23:29:20 +0200 Subject: [PATCH 6/7] add option for mirrorcollage --- src/itdelatrisu/opsu/Options.java | 14 +++++++++++++ src/itdelatrisu/opsu/states/Game.java | 22 ++++++++++++-------- src/itdelatrisu/opsu/states/OptionsMenu.java | 1 + src/yugecin/opsudance/Dancer.java | 2 ++ 4 files changed, 30 insertions(+), 9 deletions(-) diff --git a/src/itdelatrisu/opsu/Options.java b/src/itdelatrisu/opsu/Options.java index 96a20d35..cbedc144 100644 --- a/src/itdelatrisu/opsu/Options.java +++ b/src/itdelatrisu/opsu/Options.java @@ -638,6 +638,20 @@ public class Options { } }, + DANCE_MIRROR ("Mirror collage", "MirrorCollage", "Hypnotizing stuff", false) { + @Override + public void click(GameContainer container) { + bool = !bool; + Dancer.mirror = bool; + } + + @Override + public void read(String s) { + super.read(s); + Dancer.mirror = bool; + } + }, + PIPPI_ENABLE ("Pippi", "Pippi", "Move in circles like dancing pippi (osu! april fools joke 2016)", false) { // TODO }, diff --git a/src/itdelatrisu/opsu/states/Game.java b/src/itdelatrisu/opsu/states/Game.java index 93c2e0f0..ae892fd7 100644 --- a/src/itdelatrisu/opsu/states/Game.java +++ b/src/itdelatrisu/opsu/states/Game.java @@ -601,11 +601,13 @@ public class Game extends BasicGameState { UI.draw(g, replayX, replayY, replayKeyPressed); else if (GameMod.AUTO.isActive()) { UI.draw(g, (int) autoMousePosition.x, (int) autoMousePosition.y, autoMousePressed); - double dx = autoMousePosition.x - Options.width / 2d; - double dy = autoMousePosition.y - Options.height / 2d; - double d = Math.sqrt(dx * dx + dy * dy); - double a = Math.atan2(dy, dx) + Math.PI; - mirrorCursor.draw((int) (Math.cos(a) * d + Options.width / 2), (int) (Math.sin(a) * d + Options.height / 2), autoMousePressed); + if (Dancer.mirror) { + double dx = autoMousePosition.x - Options.width / 2d; + double dy = autoMousePosition.y - Options.height / 2d; + double d = Math.sqrt(dx * dx + dy * dy); + double a = Math.atan2(dy, dx) + Math.PI; + mirrorCursor.draw((int) (Math.cos(a) * d + Options.width / 2), (int) (Math.sin(a) * d + Options.height / 2), autoMousePressed); + } } else if (GameMod.AUTOPILOT.isActive()) UI.draw(g, (int) autoMousePosition.x, (int) autoMousePosition.y, Utils.isGameKeyPressed()); @@ -1397,10 +1399,12 @@ public class Game extends BasicGameState { // normal case if (!loseState) { gameObj.draw(g, trackPosition, false); - g.pushTransform(); - g.rotate(Options.width / 2f, Options.height / 2f, 180f); - gameObj.draw(g, trackPosition, true); - g.popTransform(); + if (Dancer.mirror) { + g.pushTransform(); + g.rotate(Options.width / 2f, Options.height / 2f, 180f); + gameObj.draw(g, trackPosition, true); + g.popTransform(); + } } // death: make objects "fall" off the screen else { diff --git a/src/itdelatrisu/opsu/states/OptionsMenu.java b/src/itdelatrisu/opsu/states/OptionsMenu.java index 09387891..64921270 100644 --- a/src/itdelatrisu/opsu/states/OptionsMenu.java +++ b/src/itdelatrisu/opsu/states/OptionsMenu.java @@ -110,6 +110,7 @@ public class OptionsMenu extends BasicGameState { GameOption.DANCE_LAZY_SLIDERS, GameOption.DANCE_CIRCLE_STREAMS, GameOption.DANCE_ONLY_CIRCLE_STACKS, + GameOption.DANCE_MIRROR, }), PIPPI ("Pippi", new GameOption[] { GameOption.PIPPI_ENABLE, diff --git a/src/yugecin/opsudance/Dancer.java b/src/yugecin/opsudance/Dancer.java index 5b0197d3..319f68de 100644 --- a/src/yugecin/opsudance/Dancer.java +++ b/src/yugecin/opsudance/Dancer.java @@ -50,6 +50,8 @@ public class Dancer { public static Dancer instance = new Dancer(); + public static boolean mirror; // this should really get its own place somewhere... + private int dir; private GameObject p; private Random rand; From fa57e63a2faccb55e82039ff67b7fe8888a41d3d Mon Sep 17 00:00:00 2001 From: yugecin Date: Thu, 29 Sep 2016 23:34:11 +0200 Subject: [PATCH 7/7] option to hide approach circles --- src/itdelatrisu/opsu/Options.java | 14 ++++++++++++++ src/itdelatrisu/opsu/objects/Circle.java | 3 ++- src/itdelatrisu/opsu/objects/Slider.java | 3 ++- src/itdelatrisu/opsu/states/OptionsMenu.java | 1 + src/yugecin/opsudance/Dancer.java | 1 + 5 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/itdelatrisu/opsu/Options.java b/src/itdelatrisu/opsu/Options.java index cbedc144..6ef0585a 100644 --- a/src/itdelatrisu/opsu/Options.java +++ b/src/itdelatrisu/opsu/Options.java @@ -652,6 +652,20 @@ public class Options { } }, + DANCE_DRAW_APPROACH ("Draw approach circles", "DrawApproach", "Can get a bit busy when using mirror collage", true) { + @Override + public void click(GameContainer container) { + bool = !bool; + Dancer.drawApproach = bool; + } + + @Override + public void read(String s) { + super.read(s); + Dancer.drawApproach = bool; + } + }, + PIPPI_ENABLE ("Pippi", "Pippi", "Move in circles like dancing pippi (osu! april fools joke 2016)", false) { // TODO }, diff --git a/src/itdelatrisu/opsu/objects/Circle.java b/src/itdelatrisu/opsu/objects/Circle.java index f76460b8..93ce8fab 100644 --- a/src/itdelatrisu/opsu/objects/Circle.java +++ b/src/itdelatrisu/opsu/objects/Circle.java @@ -32,6 +32,7 @@ import itdelatrisu.opsu.ui.Colors; import org.newdawn.slick.Color; import org.newdawn.slick.GameContainer; import org.newdawn.slick.Graphics; +import yugecin.opsudance.Dancer; /** * Data type representing a circle object. @@ -120,7 +121,7 @@ public class Circle extends GameObject { float oldAlpha = Colors.WHITE_FADE.a; Colors.WHITE_FADE.a = color.a = alpha; - if (timeDiff >= 0 && !GameMod.HIDDEN.isActive()) + if (timeDiff >= 0 && !GameMod.HIDDEN.isActive() && Dancer.drawApproach) GameImage.APPROACHCIRCLE.getImage().getScaledCopy(approachScale).drawCentered(x, y, color); GameImage.HITCIRCLE.getImage().drawCentered(x, y, color); boolean overlayAboveNumber = Options.getSkin().isHitCircleOverlayAboveNumber(); diff --git a/src/itdelatrisu/opsu/objects/Slider.java b/src/itdelatrisu/opsu/objects/Slider.java index 8e9a6eb1..9552d6a9 100644 --- a/src/itdelatrisu/opsu/objects/Slider.java +++ b/src/itdelatrisu/opsu/objects/Slider.java @@ -37,6 +37,7 @@ import org.newdawn.slick.Color; import org.newdawn.slick.GameContainer; import org.newdawn.slick.Graphics; import org.newdawn.slick.Image; +import yugecin.opsudance.Dancer; /** * Data type representing a slider object. @@ -296,7 +297,7 @@ public class Slider extends GameObject { if (mirror) { g.rotate(x, y, -180f); } - if (!GameMod.HIDDEN.isActive()) { + if (!GameMod.HIDDEN.isActive() && Dancer.drawApproach) { GameImage.APPROACHCIRCLE.getImage().getScaledCopy(approachScale).drawCentered(x, y, color); } g.popTransform(); diff --git a/src/itdelatrisu/opsu/states/OptionsMenu.java b/src/itdelatrisu/opsu/states/OptionsMenu.java index 64921270..1ce8dc83 100644 --- a/src/itdelatrisu/opsu/states/OptionsMenu.java +++ b/src/itdelatrisu/opsu/states/OptionsMenu.java @@ -111,6 +111,7 @@ public class OptionsMenu extends BasicGameState { GameOption.DANCE_CIRCLE_STREAMS, GameOption.DANCE_ONLY_CIRCLE_STACKS, GameOption.DANCE_MIRROR, + GameOption.DANCE_DRAW_APPROACH, }), PIPPI ("Pippi", new GameOption[] { GameOption.PIPPI_ENABLE, diff --git a/src/yugecin/opsudance/Dancer.java b/src/yugecin/opsudance/Dancer.java index 319f68de..86dbf990 100644 --- a/src/yugecin/opsudance/Dancer.java +++ b/src/yugecin/opsudance/Dancer.java @@ -51,6 +51,7 @@ public class Dancer { public static Dancer instance = new Dancer(); public static boolean mirror; // this should really get its own place somewhere... + public static boolean drawApproach; // this should really get its own place somewhere... private int dir; private GameObject p;