Skip to content

Commit

Permalink
Some cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
MEEPofFaith committed Feb 24, 2024
1 parent 59a4e1c commit 36e4f5b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 25 deletions.
34 changes: 10 additions & 24 deletions src/drunkustry/graphics/DrunkRendering.java
Original file line number Diff line number Diff line change
@@ -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.*;
Expand All @@ -27,47 +25,35 @@ 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());
});
}

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.
Expand Down
1 change: 0 additions & 1 deletion src/drunkustry/graphics/DrunkShaders.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.*;
Expand Down

0 comments on commit 36e4f5b

Please sign in to comment.