v0.4.2: fixed some bugs with tilemap updating
This commit is contained in:
parent
a8e04b51ca
commit
e43e7b995d
|
@ -88,11 +88,17 @@ public class Tilemap extends Visual {
|
||||||
|
|
||||||
quads = Quad.createSet( size );
|
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(){
|
public synchronized void updateMap(){
|
||||||
updated.set( 0, 0, mapWidth, mapHeight );
|
updated.set( 0, 0, mapWidth, mapHeight );
|
||||||
|
if (buffer != null) {
|
||||||
|
buffer.delete();
|
||||||
|
}
|
||||||
|
buffer = null;
|
||||||
|
camX = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public synchronized void updateMapCell(int cell){
|
public synchronized void updateMapCell(int cell){
|
||||||
|
|
|
@ -233,7 +233,6 @@ public class PrisonBossLevel extends Level {
|
||||||
|
|
||||||
private void changeMap(int[] map){
|
private void changeMap(int[] map){
|
||||||
this.map = map.clone();
|
this.map = map.clone();
|
||||||
GameScene.resetMap();
|
|
||||||
buildFlagMaps();
|
buildFlagMaps();
|
||||||
cleanWalls();
|
cleanWalls();
|
||||||
|
|
||||||
|
@ -251,6 +250,8 @@ public class PrisonBossLevel extends Level {
|
||||||
addVisuals(); //this also resets existing visuals
|
addVisuals(); //this also resets existing visuals
|
||||||
resetTraps();
|
resetTraps();
|
||||||
|
|
||||||
|
|
||||||
|
GameScene.resetMap();
|
||||||
Dungeon.observe();
|
Dungeon.observe();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -307,9 +308,9 @@ public class PrisonBossLevel extends Level {
|
||||||
maze.connected.put(null, new Room.Door(10, 2));
|
maze.connected.put(null, new Room.Door(10, 2));
|
||||||
maze.connected.put(maze, new Room.Door(20, 29));
|
maze.connected.put(maze, new Room.Door(20, 29));
|
||||||
MazePainter.paint(this, maze);
|
MazePainter.paint(this, maze);
|
||||||
GameScene.resetMap();
|
|
||||||
buildFlagMaps();
|
buildFlagMaps();
|
||||||
cleanWalls();
|
cleanWalls();
|
||||||
|
GameScene.resetMap();
|
||||||
|
|
||||||
GameScene.flash(0xFFFFFF);
|
GameScene.flash(0xFFFFFF);
|
||||||
Sample.INSTANCE.play(Assets.SND_BLAST);
|
Sample.INSTANCE.play(Assets.SND_BLAST);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user