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
30aef5bfc6
commit
e5dd00cff8
@ -123,18 +123,22 @@ public class EditorRenderer extends LevelRenderer{
|
||||
private void drawTileGrid(byte[] p, int x, int y) {
|
||||
if (x%Tile.TILE_SCREEN_COUNT_X==0) {
|
||||
for (int yy=0;yy<Tile.TILE_HEIGHT;yy++) {
|
||||
int index=(int)(y*Tile.TILE_HEIGHT+yy-getY())*Map.MAP_WIDTH+(int)(x*Tile.TILE_WIDTH-getX());
|
||||
int ypos=(int)(y*Tile.TILE_HEIGHT-getY()+yy);
|
||||
int xpos=(int)(x*Tile.TILE_WIDTH-getX());
|
||||
int index=ypos*Map.MAP_WIDTH+xpos;
|
||||
if (index<0||index>=p.length) {
|
||||
return;
|
||||
continue;
|
||||
}
|
||||
Draw(p,index,PaletteColor.BLACK,Alpha.ALPHA0);
|
||||
}
|
||||
}
|
||||
if (y%Tile.TILE_SCREEN_COUNT_Y==0) {
|
||||
for (int xx=0;xx<Tile.TILE_HEIGHT;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) {
|
||||
return;
|
||||
int ypos=(int)(y*Tile.TILE_HEIGHT-getY());
|
||||
int xpos=(int)(x*Tile.TILE_WIDTH-getX()+xx);
|
||||
int index=ypos*Map.MAP_WIDTH+xpos;
|
||||
if (xpos<0||xpos>=Map.MAP_WIDTH||ypos<0||ypos>=Map.MAP_HEIGHT||index<0||index>=p.length) {
|
||||
continue;
|
||||
}
|
||||
Draw(p,index,PaletteColor.BLACK,Alpha.ALPHA0);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user