From 36e4f5b175d2c0d16660ecd4391d4d20a88572b7 Mon Sep 17 00:00:00 2001 From: MEEPofFaith <54301439+MEEPofFaith@users.noreply.github.com> Date: Sat, 24 Feb 2024 03:57:29 -0800 Subject: [PATCH] Some cleanup --- src/drunkustry/graphics/DrunkRendering.java | 34 ++++++--------------- src/drunkustry/graphics/DrunkShaders.java | 1 - 2 files changed, 10 insertions(+), 25 deletions(-) diff --git a/src/drunkustry/graphics/DrunkRendering.java b/src/drunkustry/graphics/DrunkRendering.java index b61b754..9d62406 100644 --- a/src/drunkustry/graphics/DrunkRendering.java +++ b/src/drunkustry/graphics/DrunkRendering.java @@ -1,9 +1,7 @@ package drunkustry.graphics; import arc.*; -import arc.graphics.*; import arc.graphics.g2d.*; -import arc.graphics.gl.*; import arc.math.*; import arc.util.*; import mindustry.game.EventType.*; @@ -27,37 +25,27 @@ private static void initAberration(){ if(!settings.getBool("du-aberration", true)) return; Events.run(Trigger.drawOver, () -> { - Draw.draw(begin + 0.02f, () -> { - chromaticAberration.begin(); - }); - Draw.draw(end, () -> { - chromaticAberration.end(); - }); + Draw.draw(begin + 0.02f, () -> chromaticAberration.begin()); + Draw.draw(end, () -> chromaticAberration.end()); }); } private static void initColor(){ if(!settings.getBool("du-color", true)) return; - Events.run(Trigger.drawOver, () -> { - Draw.draw(end, () -> { - colorHallucination.begin(); - Draw.rect(); - colorHallucination.end(); - }); - }); + Events.run(Trigger.drawOver, () -> Draw.draw(end, () -> { + colorHallucination.begin(); + Draw.rect(); + colorHallucination.end(); + })); } private static void initDistortion(){ if(!settings.getBool("du-distortion", true)) return; Events.run(Trigger.drawOver, () -> { - Draw.draw(begin + 0.01f, () -> { - distortion.begin(); - }); - Draw.draw(end, () -> { - distortion.end(); - }); + Draw.draw(begin + 0.01f, () -> distortion.begin()); + Draw.draw(end, () -> distortion.end()); }); } @@ -65,9 +53,7 @@ private static void initInversion(){ if(!settings.getBool("du-inversion", true)) return; Events.run(Trigger.drawOver, () -> { - Draw.draw(begin, () -> { - inversion.begin(); - }); + Draw.draw(begin, () -> inversion.begin()); Draw.draw(end, () -> { float t = Time.time / 60f * Mathf.PI / 4f * settings.getFloat("du-inversion", 1f); inversion.lerp = (Mathf.absin(t, 1f, 1f) + //TODO better lerp. Gets stuck in middle. diff --git a/src/drunkustry/graphics/DrunkShaders.java b/src/drunkustry/graphics/DrunkShaders.java index 7ec55b0..e995a52 100644 --- a/src/drunkustry/graphics/DrunkShaders.java +++ b/src/drunkustry/graphics/DrunkShaders.java @@ -6,7 +6,6 @@ import arc.graphics.Texture.*; import arc.graphics.gl.*; import arc.util.*; -import drunkustry.graphics.DrunkShaders.InversionShader.*; import mindustry.graphics.Shaders.*; import static arc.Core.*;