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.particles.Emitter;
|
||||
import com.watabou.noosa.tweeners.Tweener;
|
||||
import com.watabou.utils.Callback;
|
||||
import com.watabou.utils.DeviceCompat;
|
||||
import com.watabou.utils.GameMath;
|
||||
import com.watabou.utils.Point;
|
||||
@@ -1355,6 +1356,10 @@ public class GameScene extends PixelScene {
|
||||
|
||||
public static void flash( int color, boolean lightmode ) {
|
||||
if (scene != null) {
|
||||
//don't want to do this on the actor thread
|
||||
ShatteredPixelDungeon.runOnRenderThread(new Callback() {
|
||||
@Override
|
||||
public void call() {
|
||||
//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);
|
||||
@@ -1362,6 +1367,8 @@ public class GameScene extends PixelScene {
|
||||
scene.fadeIn(color, lightmode);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public static void gameOver() {
|
||||
|
||||
Reference in New Issue
Block a user