v3.0.0: fixed rare freezes with gamescene flashing
This commit is contained in:
@@ -137,6 +137,7 @@ import com.watabou.noosa.Visual;
|
|||||||
import com.watabou.noosa.audio.Sample;
|
import com.watabou.noosa.audio.Sample;
|
||||||
import com.watabou.noosa.particles.Emitter;
|
import com.watabou.noosa.particles.Emitter;
|
||||||
import com.watabou.noosa.tweeners.Tweener;
|
import com.watabou.noosa.tweeners.Tweener;
|
||||||
|
import com.watabou.utils.Callback;
|
||||||
import com.watabou.utils.DeviceCompat;
|
import com.watabou.utils.DeviceCompat;
|
||||||
import com.watabou.utils.GameMath;
|
import com.watabou.utils.GameMath;
|
||||||
import com.watabou.utils.Point;
|
import com.watabou.utils.Point;
|
||||||
@@ -1355,12 +1356,18 @@ public class GameScene extends PixelScene {
|
|||||||
|
|
||||||
public static void flash( int color, boolean lightmode ) {
|
public static void flash( int color, boolean lightmode ) {
|
||||||
if (scene != null) {
|
if (scene != null) {
|
||||||
//greater than 0 to account for negative values (which have the first bit set to 1)
|
//don't want to do this on the actor thread
|
||||||
if (color > 0 && color < 0x01000000) {
|
ShatteredPixelDungeon.runOnRenderThread(new Callback() {
|
||||||
scene.fadeIn(0xFF000000 | color, lightmode);
|
@Override
|
||||||
} else {
|
public void call() {
|
||||||
scene.fadeIn(color, lightmode);
|
//greater than 0 to account for negative values (which have the first bit set to 1)
|
||||||
}
|
if (color > 0 && color < 0x01000000) {
|
||||||
|
scene.fadeIn(0xFF000000 | color, lightmode);
|
||||||
|
} else {
|
||||||
|
scene.fadeIn(color, lightmode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user