Minor clear optimization
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
package mindustry.world.blocks.logic;
|
package mindustry.world.blocks.logic;
|
||||||
|
|
||||||
|
import arc.*;
|
||||||
import arc.graphics.*;
|
import arc.graphics.*;
|
||||||
import arc.graphics.g2d.*;
|
import arc.graphics.g2d.*;
|
||||||
import arc.graphics.gl.*;
|
import arc.graphics.gl.*;
|
||||||
@@ -91,10 +92,9 @@ public class LogicDisplay extends Block{
|
|||||||
|
|
||||||
switch(type){
|
switch(type){
|
||||||
case commandClear -> {
|
case commandClear -> {
|
||||||
//calling glClear appears to be unreliable and leads to flickering
|
//discard any pending batched sprites, so they don't get drawn over the cleared screen later
|
||||||
Draw.color(x / 255f, y / 255f, p1 / 255f, 1f);
|
Draw.discard();
|
||||||
Fill.crect(0f, 0f, displaySize, displaySize);
|
Core.graphics.clear(x / 255f, y / 255f, p1 / 255f, 1f);
|
||||||
Draw.color(color);
|
|
||||||
}
|
}
|
||||||
case commandLine -> Lines.line(x, y, p1, p2);
|
case commandLine -> Lines.line(x, y, p1, p2);
|
||||||
case commandRect -> Fill.crect(x, y, p1, p2);
|
case commandRect -> Fill.crect(x, y, p1, p2);
|
||||||
|
|||||||
@@ -25,4 +25,4 @@ org.gradle.caching=true
|
|||||||
#used for slow jitpack builds; TODO see if this actually works
|
#used for slow jitpack builds; TODO see if this actually works
|
||||||
org.gradle.internal.http.socketTimeout=100000
|
org.gradle.internal.http.socketTimeout=100000
|
||||||
org.gradle.internal.http.connectionTimeout=100000
|
org.gradle.internal.http.connectionTimeout=100000
|
||||||
archash=13c2e55010
|
archash=d7512241d0
|
||||||
|
|||||||
Reference in New Issue
Block a user