v3.3.0: removed deadlock-causing sync checks
This commit is contained in:
@@ -172,7 +172,7 @@ public class GameScene extends PixelScene {
|
||||
private BossHealthBar boss;
|
||||
|
||||
private GameLog log;
|
||||
|
||||
|
||||
private static CellSelector cellSelector;
|
||||
|
||||
private Group terrain;
|
||||
@@ -209,7 +209,7 @@ public class GameScene extends PixelScene {
|
||||
{
|
||||
inGameScene = true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void create() {
|
||||
|
||||
@@ -530,7 +530,7 @@ public class GameScene extends PixelScene {
|
||||
}
|
||||
|
||||
layoutTags();
|
||||
|
||||
|
||||
switch (InterlevelScene.mode) {
|
||||
case RESURRECT:
|
||||
Sample.INSTANCE.play(Assets.Sounds.TELEPORT);
|
||||
@@ -831,7 +831,7 @@ public class GameScene extends PixelScene {
|
||||
public static boolean updateTags = false;
|
||||
|
||||
private static float waterOfs = 0;
|
||||
|
||||
|
||||
@Override
|
||||
public synchronized void update() {
|
||||
lastOffset = null;
|
||||
@@ -869,7 +869,7 @@ public class GameScene extends PixelScene {
|
||||
Actor.process();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
//if cpu cores are limited, game should prefer drawing the current frame
|
||||
if (Runtime.getRuntime().availableProcessors() == 1) {
|
||||
actorThread.setPriority(Thread.NORM_PRIORITY - 1);
|
||||
@@ -1028,22 +1028,25 @@ public class GameScene extends PixelScene {
|
||||
public void addCustomWall( CustomTilemap visual){
|
||||
customWalls.add( visual.create() );
|
||||
}
|
||||
|
||||
private synchronized void addHeapSprite( Heap heap ) {
|
||||
|
||||
//FIXME added a sync check here in v3.2.5, which caused deadlocks
|
||||
// what I really need to do is have these queue additions that then happen on render thread
|
||||
// this can also apply to adding mob sprites
|
||||
private void addHeapSprite( Heap heap ) {
|
||||
ItemSprite sprite = heap.sprite = (ItemSprite)heaps.recycle( ItemSprite.class );
|
||||
sprite.revive();
|
||||
sprite.link( heap );
|
||||
heaps.add( sprite );
|
||||
}
|
||||
|
||||
private synchronized void addDiscardedSprite( Heap heap ) {
|
||||
private void addDiscardedSprite( Heap heap ) {
|
||||
heap.sprite = (DiscardedItemSprite)heaps.recycle( DiscardedItemSprite.class );
|
||||
heap.sprite.revive();
|
||||
heap.sprite.link( heap );
|
||||
heaps.add( heap.sprite );
|
||||
}
|
||||
|
||||
private synchronized void addBlobSprite( final Blob gas ) {
|
||||
private void addBlobSprite( final Blob gas ) {
|
||||
if (gas.emitter == null) {
|
||||
gases.add( new BlobEmitter( gas ) );
|
||||
}
|
||||
@@ -1340,7 +1343,7 @@ public class GameScene extends PixelScene {
|
||||
scene.terrainFeatures.growPlant( cell );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static void discoverTile( int pos, int oldValue ) {
|
||||
if (scene != null) {
|
||||
scene.tiles.discover( pos, oldValue );
|
||||
@@ -1581,7 +1584,7 @@ public class GameScene extends PixelScene {
|
||||
return wnd;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user