From 38ab1473f271f68eb3f5fe2734b2c352c022bbb8 Mon Sep 17 00:00:00 2001 From: Anuken Date: Fri, 28 Feb 2020 13:46:16 -0500 Subject: [PATCH] Backport of fixed lighting + overflow crash fix --- core/src/mindustry/graphics/LightRenderer.java | 11 ++++++++--- .../world/blocks/distribution/OverflowGate.java | 5 +++++ gradle.properties | 2 +- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/core/src/mindustry/graphics/LightRenderer.java b/core/src/mindustry/graphics/LightRenderer.java index 0c0f94e02c..58c91b4f30 100644 --- a/core/src/mindustry/graphics/LightRenderer.java +++ b/core/src/mindustry/graphics/LightRenderer.java @@ -24,6 +24,10 @@ public class LightRenderer{ lights.add(run); } + public void add(Position pos, float radius, Color color, float opacity){ + add(pos.getX(), pos.getY(), radius, color, opacity); + } + public void add(float x, float y, float radius, Color color, float opacity){ if(!enabled()) return; @@ -180,13 +184,14 @@ public class LightRenderer{ Draw.color(); buffer.beginDraw(Color.clear); - Draw.blend(Blending.normal); + Gl.blendEquationSeparate(Gl.funcAdd, Gl.max); + for(Runnable run : lights){ run.run(); } Draw.reset(); - Draw.blend(); buffer.endDraw(); + Gl.blendEquationSeparate(Gl.funcAdd, Gl.funcAdd); Draw.color(); Shaders.light.ambient.set(state.rules.ambientLight); @@ -196,4 +201,4 @@ public class LightRenderer{ lights.clear(); } -} +} \ No newline at end of file diff --git a/core/src/mindustry/world/blocks/distribution/OverflowGate.java b/core/src/mindustry/world/blocks/distribution/OverflowGate.java index e73bb140a8..3236010b2a 100644 --- a/core/src/mindustry/world/blocks/distribution/OverflowGate.java +++ b/core/src/mindustry/world/blocks/distribution/OverflowGate.java @@ -54,6 +54,11 @@ public class OverflowGate extends Block{ } if(entity.lastItem != null){ + if(entity.lastInput == null){ + entity.lastItem = null; + return; + } + entity.time += 1f / speed * Time.delta(); Tile target = getTileTarget(tile, entity.lastItem, entity.lastInput, false); diff --git a/gradle.properties b/gradle.properties index 2b37ed7cd1..c20f31f7e3 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,3 @@ org.gradle.daemon=true org.gradle.jvmargs=-Xms256m -Xmx1024m -archash=f2bb11a4dbb6febed118a772ce61a253e1d863c5 +archash=bff072e2d671c74a32b41353125c2aa6ba8c0314