Minor optimization

This commit is contained in:
Anuken
2025-04-16 13:06:15 -04:00
parent b45afe1f4c
commit 9cadf06c92
@@ -217,9 +217,10 @@ public class TileableLogicDisplay extends LogicDisplay{
processCommands(); processCommands();
} }
Draw.z(Layer.block + 0.001f); float offset = 0.001f + (rootDisplay.buffer == null ? 0f : (rootDisplay.buffer.hashCode() % 1_000_000) / 1_000_000f * 0.01f);
Draw.z(Layer.block + offset);
//TODO this is slow, many texture switches
Draw.blend(Blending.disabled); Draw.blend(Blending.disabled);
Draw.draw(Draw.z(), () -> { Draw.draw(Draw.z(), () -> {
if(rootDisplay.buffer != null){ if(rootDisplay.buffer != null){
@@ -232,7 +233,7 @@ public class TileableLogicDisplay extends LogicDisplay{
}); });
Draw.blend(); Draw.blend();
Draw.z(Layer.block + 0.002f); Draw.z(Layer.block + 0.02f);
Draw.rect(tileRegion[bitmasks[bits]], x, y); Draw.rect(tileRegion[bitmasks[bits]], x, y);
} }