Skip to content

Commit

Permalink
Default editor carve size is based on the picked wall texture atlas r…
Browse files Browse the repository at this point in the history
…owScale
  • Loading branch information
Interrupt committed Dec 12, 2018
1 parent dfbbde0 commit 2ce10ce
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion DelvEdit/src/com/interrupt/dungeoneer/editor/EditorFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,9 @@ else if(pickedSurface.tileSurface == TileSurface.Ceiling) {
if(!selected) selectionHeights.set(t.ceilHeight, selZ);
}
else {
if(!selected) selectionHeights.set(0.5f, -0.5f);
TextureAtlas atlas = TextureAtlas.getRepeatingAtlasByIndex(pickedWallTextureAtlas);
float size = atlas.rowScale * atlas.scale;
if(!selected) selectionHeights.set(size - 0.5f, -0.5f);
}

if(slopePointMode || slopeEdgeMode)
Expand Down Expand Up @@ -4046,6 +4048,12 @@ public void doCarve() {
t.floorHeight = selectedTile.floorHeight;
t.ceilHeight = selectedTile.ceilHeight;

if(pickedSurface == null || !pickedSurface.isPicked) {
TextureAtlas atlas = TextureAtlas.getRepeatingAtlasByIndex(pickedWallTextureAtlas);
float size = atlas.rowScale * atlas.scale;
t.ceilHeight = size - 0.5f;
}

t.floorHeight = selectionHeights.y;

setTile(t);
Expand Down

0 comments on commit 2ce10ce

Please sign in to comment.