Skip to content

Commit

Permalink
Tile change now triggers lighting engine #11
Browse files Browse the repository at this point in the history
Tile change is used primarily by the chunkUpdate() and if water is
cascading it will cause many lighting updates.
  • Loading branch information
jleahey committed Dec 29, 2012
1 parent 2e6b269 commit 244d469
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/com/github/jleahey/minicraft/World.java
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,10 @@ public char removeTile(int x, int y) {

public void changeTile(int x, int y, Tile tile) {
tiles[x][y] = tile;
if (tile.type.lightBlocking > 0)
lightingEngine.addedTile(x, y);
else
lightingEngine.removedTile(x, y);
}

private char[] breakWood = new char[] { 'w', 'p', 'f' };
Expand Down

0 comments on commit 244d469

Please sign in to comment.