diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java index 76ac228ba..81b5cc379 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java @@ -20,6 +20,8 @@ */ package com.shatteredpixel.shatteredpixeldungeon.scenes; +import android.opengl.GLES20; + import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.Badges; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; @@ -163,10 +165,19 @@ public class GameScene extends PixelScene { Dungeon.level.width() * DungeonTilemap.SIZE, Dungeon.level.height() * DungeonTilemap.SIZE, Dungeon.level.waterTex() ){ + @Override protected NoosaScript script() { return NoosaScriptNoLighting.get(); } + + @Override + public void draw() { + //water has no alpha component, this improves performance + GLES20.glBlendFunc( GLES20.GL_ONE, GLES20.GL_ZERO ); + super.draw(); + GLES20.glBlendFunc( GLES20.GL_SRC_ALPHA, GLES20.GL_ONE_MINUS_SRC_ALPHA ); + } }; terrain.add( water ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/Archs.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/Archs.java index ea9d600b1..671a63485 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/Archs.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/Archs.java @@ -20,6 +20,8 @@ */ package com.shatteredpixel.shatteredpixeldungeon.ui; +import android.opengl.GLES20; + import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.watabou.noosa.Game; import com.watabou.noosa.NoosaScript; @@ -46,6 +48,14 @@ public class Archs extends Component { protected NoosaScript script() { return NoosaScriptNoLighting.get(); } + + @Override + public void draw() { + //arch bg has no alpha component, this improves performance + GLES20.glBlendFunc(GLES20.GL_ONE, GLES20.GL_ZERO); + super.draw(); + GLES20.glBlendFunc( GLES20.GL_SRC_ALPHA, GLES20.GL_ONE_MINUS_SRC_ALPHA ); + } }; arcsBg.autoAdjust = true; arcsBg.offsetTo( 0, offsB );