Add gridlines
Co-authored-by: r3cp3ct <45179536+r3cp3ct@users.noreply.github.com> Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
This commit is contained in:
parent
5f9f56e0a6
commit
30aef5bfc6
@ -123,7 +123,7 @@ public class EditorRenderer extends LevelRenderer{
|
|||||||
private void drawTileGrid(byte[] p, int x, int y) {
|
private void drawTileGrid(byte[] p, int x, int y) {
|
||||||
if (x%Tile.TILE_SCREEN_COUNT_X==0) {
|
if (x%Tile.TILE_SCREEN_COUNT_X==0) {
|
||||||
for (int yy=0;yy<Tile.TILE_HEIGHT;yy++) {
|
for (int yy=0;yy<Tile.TILE_HEIGHT;yy++) {
|
||||||
int index=(y*Tile.TILE_HEIGHT+yy)*Map.MAP_WIDTH+x*Tile.TILE_WIDTH;
|
int index=(int)(y*Tile.TILE_HEIGHT+yy-getY())*Map.MAP_WIDTH+(int)(x*Tile.TILE_WIDTH-getX());
|
||||||
if (index<0||index>=p.length) {
|
if (index<0||index>=p.length) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -132,7 +132,7 @@ public class EditorRenderer extends LevelRenderer{
|
|||||||
}
|
}
|
||||||
if (y%Tile.TILE_SCREEN_COUNT_Y==0) {
|
if (y%Tile.TILE_SCREEN_COUNT_Y==0) {
|
||||||
for (int xx=0;xx<Tile.TILE_HEIGHT;xx++) {
|
for (int xx=0;xx<Tile.TILE_HEIGHT;xx++) {
|
||||||
int index=y*Tile.TILE_HEIGHT*Map.MAP_WIDTH+(x*Tile.TILE_WIDTH+xx);
|
int index=(int)(y*Tile.TILE_HEIGHT-getY())*Map.MAP_WIDTH+(int)(x*Tile.TILE_WIDTH-getX()+xx);
|
||||||
if (index<0||index>=p.length) {
|
if (index<0||index>=p.length) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user