v0.4.2: fixed some bugs with tilemap updating

This commit is contained in:
Evan Debenham 2016-08-27 01:13:56 -04:00 committed by Evan Debenham
parent a8e04b51ca
commit e43e7b995d
2 changed files with 10 additions and 3 deletions

View File

@ -88,11 +88,17 @@ public class Tilemap extends Visual {
quads = Quad.createSet( size );
updated.set( 0, 0, mapWidth, mapHeight );
updateMap();
}
//forces a full update, including new buffer and culling recalculation
public synchronized void updateMap(){
updated.set( 0, 0, mapWidth, mapHeight );
if (buffer != null) {
buffer.delete();
}
buffer = null;
camX = null;
}
public synchronized void updateMapCell(int cell){

View File

@ -233,7 +233,6 @@ public class PrisonBossLevel extends Level {
private void changeMap(int[] map){
this.map = map.clone();
GameScene.resetMap();
buildFlagMaps();
cleanWalls();
@ -251,6 +250,8 @@ public class PrisonBossLevel extends Level {
addVisuals(); //this also resets existing visuals
resetTraps();
GameScene.resetMap();
Dungeon.observe();
}
@ -307,9 +308,9 @@ public class PrisonBossLevel extends Level {
maze.connected.put(null, new Room.Door(10, 2));
maze.connected.put(maze, new Room.Door(20, 29));
MazePainter.paint(this, maze);
GameScene.resetMap();
buildFlagMaps();
cleanWalls();
GameScene.resetMap();
GameScene.flash(0xFFFFFF);
Sample.INSTANCE.play(Assets.SND_BLAST);