v0.8.2: Various stability improvements/fixes:

- fixed concurrency errrors in Sample.java
- added a null safety check to IconTitle
- fixed further rare freezing errors with tengu jumping
- reverted Android 'singleInstance' change, due to stability issues
This commit is contained in:
Evan Debenham 2020-07-09 13:42:35 -04:00
parent a2b4e3a9b6
commit 2478e18ba6
4 changed files with 16 additions and 11 deletions

View File

@ -35,7 +35,7 @@ public enum Sample {
private boolean enabled = true; private boolean enabled = true;
private float globalVolume = 1f; private float globalVolume = 1f;
public void reset() { public synchronized void reset() {
for (Sound sound : ids.values()){ for (Sound sound : ids.values()){
sound.dispose(); sound.dispose();
@ -45,13 +45,13 @@ public enum Sample {
} }
public void pause() { public synchronized void pause() {
for (Sound sound : ids.values()) { for (Sound sound : ids.values()) {
sound.pause(); sound.pause();
} }
} }
public void resume() { public synchronized void resume() {
for (Sound sound : ids.values()) { for (Sound sound : ids.values()) {
sound.resume(); sound.resume();
} }
@ -75,7 +75,7 @@ public enum Sample {
} }
public void unload( Object src ) { public synchronized void unload( Object src ) {
if (ids.containsKey( src )) { if (ids.containsKey( src )) {
ids.get( src ).dispose(); ids.get( src ).dispose();
ids.remove( src ); ids.remove( src );

View File

@ -22,7 +22,6 @@
android:label="${appName}" android:label="${appName}"
android:theme="@android:style/Theme.Black.NoTitleBar" android:theme="@android:style/Theme.Black.NoTitleBar"
android:resizeableActivity="true" android:resizeableActivity="true"
android:launchMode="singleInstance"
android:allowBackup="true" android:allowBackup="true"
android:fullBackupOnly="true" android:fullBackupOnly="true"
android:backupAgent=".AndroidBackupHandler"> android:backupAgent=".AndroidBackupHandler">

View File

@ -242,11 +242,15 @@ public class NewTengu extends Mob {
level.cleanTenguCell(); level.cleanTenguCell();
int tries = 100;
do { do {
newPos = ((NewPrisonBossLevel)Dungeon.level).randomTenguCellPos(); newPos = ((NewPrisonBossLevel)Dungeon.level).randomTenguCellPos();
} while ( level.trueDistance(newPos, enemy.pos) <= 3.5f tries--;
} while ( tries > 0 && (level.trueDistance(newPos, enemy.pos) <= 3.5f
|| level.trueDistance(newPos, Dungeon.hero.pos) <= 3.5f || level.trueDistance(newPos, Dungeon.hero.pos) <= 3.5f
|| Actor.findChar(newPos) != null); || Actor.findChar(newPos) != null));
if (tries <= 0) newPos = pos;
if (level.heroFOV[pos]) CellEmitter.get( pos ).burst( Speck.factory( Speck.WOOL ), 6 ); if (level.heroFOV[pos]) CellEmitter.get( pos ).burst( Speck.factory( Speck.WOOL ), 6 );

View File

@ -109,9 +109,11 @@ public class IconTitle extends Component {
} }
public void icon( Image icon ) { public void icon( Image icon ) {
if (icon != null) {
remove(imIcon); remove(imIcon);
add(imIcon = icon); add(imIcon = icon);
} }
}
public void label( String label ) { public void label( String label ) {
tfLabel.text( label ); tfLabel.text( label );