This commit is contained in:
Anuken
2026-06-13 22:33:28 -04:00
parent 5ffc3aca6a
commit 6313b5b589
8 changed files with 8 additions and 13 deletions
@@ -1275,13 +1275,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
/** Called only if {@link Block#drawCached} is true (off by default). */
public void drawCached(){
if(block.variants == 0 || block.variantRegions == null){
Draw.rect(block.region, x, y, drawrot());
}else{
Draw.rect(block.variantRegions[Mathf.randomSeed(tile.pos(), 0, Math.max(0, block.variantRegions.length - 1))], x, y, drawrot());
}
drawTeamTop();
draw();
}
public void recache(){
@@ -640,6 +640,7 @@ public class BlockRenderer{
SpriteCache.getDefaultShader().bind();
SpriteCache.getDefaultShader().setUniformMatrix4("u_projectionViewMatrix", camera.mat);
if(false)
queuedCacheIndices.each(spriteCacheIndex -> {
SpriteCache sprites = caches.get(spriteCacheIndex);
IntSeq cachesToDraw = queuedCacheDraws.get(spriteCacheIndex);
@@ -114,7 +114,7 @@ public class DirectionalUnloader extends Block{
}
@Override
public void drawCached(){
public void draw(){
Draw.rect(region, x, y);
Draw.rect(topRegion, x, y, rotdeg());
@@ -80,7 +80,7 @@ public class DuctRouter extends Block{
public @Nullable Item current;
@Override
public void drawCached(){
public void draw(){
Draw.rect(region, x, y);
if(sortItem != null){
Draw.color(sortItem.color);
@@ -65,7 +65,7 @@ public class OverflowDuct extends Block{
public @Nullable Item current;
@Override
public void drawCached(){
public void draw(){
Draw.rect(region, x, y);
Draw.rect(topRegion, x, y, rotdeg());
}
@@ -73,7 +73,7 @@ public class Sorter extends Block{
}
@Override
public void drawCached(){
public void draw(){
if(sortItem == null){
Draw.rect(cross, x, y);
@@ -36,7 +36,7 @@ public class LiquidJunction extends LiquidBlock{
public class LiquidJunctionBuild extends Building{
@Override
public void drawCached(){
public void draw(){
Draw.rect(region, x, y);
}
@@ -232,7 +232,7 @@ public class Unloader extends Block{
}
@Override
public void drawCached(){
public void draw(){
super.draw();
Draw.color(sortItem == null ? Color.clear : sortItem.color);