mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-01-10 23:28:52 +07:00
Fallback shield shader
This commit is contained in:
parent
6d72c08d63
commit
0d4716f3b4
@ -256,7 +256,7 @@ public class Renderer implements ApplicationListener{
|
||||
draw(playerGroup, p -> true, Player::drawBuildRequests);
|
||||
|
||||
if(Entities.countInBounds(shieldGroup) > 0){
|
||||
if(settings.getBool("animatedshields")){
|
||||
if(settings.getBool("animatedshields") && Shaders.shield != null){
|
||||
Draw.flush();
|
||||
shieldBuffer.begin();
|
||||
graphics.clear(Color.CLEAR);
|
||||
|
@ -1,5 +1,6 @@
|
||||
package io.anuke.mindustry.graphics;
|
||||
|
||||
import io.anuke.annotations.Annotations.*;
|
||||
import io.anuke.arc.Core;
|
||||
import io.anuke.arc.graphics.Color;
|
||||
import io.anuke.arc.graphics.g2d.TextureRegion;
|
||||
@ -10,7 +11,7 @@ import io.anuke.arc.util.Time;
|
||||
public class Shaders{
|
||||
public static Shadow shadow;
|
||||
public static BlockBuild blockbuild;
|
||||
public static Shield shield;
|
||||
public static @Nullable Shield shield;
|
||||
public static UnitBuild build;
|
||||
public static FogShader fog;
|
||||
public static MenuShader menu;
|
||||
@ -19,7 +20,13 @@ public class Shaders{
|
||||
public static void init(){
|
||||
shadow = new Shadow();
|
||||
blockbuild = new BlockBuild();
|
||||
shield = new Shield();
|
||||
try{
|
||||
shield = new Shield();
|
||||
}catch(Throwable t){
|
||||
//don't load shield shader
|
||||
shield = null;
|
||||
t.printStackTrace();
|
||||
}
|
||||
build = new UnitBuild();
|
||||
fog = new FogShader();
|
||||
menu = new MenuShader();
|
||||
|
@ -241,7 +241,9 @@ public class SettingsMenuDialog extends SettingsDialog{
|
||||
graphics.checkPref("fps", false);
|
||||
graphics.checkPref("indicators", true);
|
||||
graphics.checkPref("animatedwater", false);
|
||||
graphics.checkPref("animatedshields", !mobile);
|
||||
if(Shaders.shield != null){
|
||||
graphics.checkPref("animatedshields", !mobile);
|
||||
}
|
||||
graphics.checkPref("bloom", false, val -> renderer.toggleBloom(val));
|
||||
graphics.checkPref("lasers", true);
|
||||
graphics.checkPref("pixelate", false);
|
||||
|
Loading…
Reference in New Issue
Block a user