Cached Block#offset()

This commit is contained in:
Anuken
2020-07-19 16:34:06 -04:00
parent c398b89284
commit 6547a38567
24 changed files with 60 additions and 65 deletions

View File

@@ -112,14 +112,14 @@ public class MapRenderer implements Disposable{
if(wall.rotate){
mesh.draw(idxWall, region,
wx * tilesize + wall.offset(), wy * tilesize + wall.offset(),
wx * tilesize + wall.offset, wy * tilesize + wall.offset,
region.getWidth() * Draw.scl, region.getHeight() * Draw.scl, tile.rotdeg() - 90);
}else{
float width = region.getWidth() * Draw.scl, height = region.getHeight() * Draw.scl;
mesh.draw(idxWall, region,
wx * tilesize + wall.offset() + (tilesize - width) / 2f,
wy * tilesize + wall.offset() + (tilesize - height) / 2f,
wx * tilesize + wall.offset + (tilesize - width) / 2f,
wy * tilesize + wall.offset + (tilesize - height) / 2f,
width, height);
}
}else{