mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-10-02 03:00:29 +03:00
unhardcode logic display background color (#12178)
This commit is contained in:
@@ -52,6 +52,7 @@ public class LogicDisplay extends Block{
|
||||
|
||||
public int displaySize = 64;
|
||||
public float scaleFactor = 1f;
|
||||
public Color backgroundColor = Pal.darkerMetal;
|
||||
|
||||
static{
|
||||
Events.on(ResetEvent.class, e -> displays.clear());
|
||||
@@ -135,7 +136,7 @@ public class LogicDisplay extends Block{
|
||||
if(buffer == null){
|
||||
buffer = new FrameBuffer(displaySize, displaySize);
|
||||
//clear the buffer - some OSs leave garbage in it
|
||||
buffer.begin(Pal.darkerMetal);
|
||||
buffer.begin(backgroundColor);
|
||||
buffer.end();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -187,7 +187,7 @@ public class TileableLogicDisplay extends LogicDisplay{
|
||||
Draw.proj(0, 0, root.buffer.getWidth(), root.buffer.getHeight());
|
||||
|
||||
//clear the buffer - some OSs leave garbage in it
|
||||
root.buffer.begin(Pal.darkerMetal);
|
||||
root.buffer.begin(backgroundColor);
|
||||
if(root.prevBuffers != null){
|
||||
for(var other : root.prevBuffers){
|
||||
Draw.rect(Draw.wrap(other.buffer.getTexture()), (other.x - originX) * 32 + other.buffer.getWidth() / 2f, (other.y - originY) * 32 + other.buffer.getHeight() / 2f, other.buffer.getWidth(), -other.buffer.getHeight());
|
||||
|
||||
Reference in New Issue
Block a user