Animated surface setting cleanup

This commit is contained in:
Anuken
2026-09-19 12:18:09 -04:00
parent 2b2c3f8d30
commit 0650d5ae41
10 changed files with 16 additions and 17 deletions

View File

@@ -1378,7 +1378,7 @@ public class Fx{
forceShrink = new Effect(20, e -> {
color(e.color, e.fout());
if(renderer.animateShields){
if(renderer.animateSurfaces){
Fill.poly(e.x, e.y, 6, e.rotation * e.fout());
}else{
stroke(1.5f);

View File

@@ -38,7 +38,7 @@ public class Renderer implements ApplicationListener{
public @Nullable Bloom bloom;
public @Nullable FrameBuffer backgroundBuffer;
public FrameBuffer effectBuffer = new FrameBuffer();
public boolean animateShields, animateWater, drawWeather = true, drawStatus, enableEffects, drawDisplays = true, drawLight = true, pixelate = false, showPings = true, showOtherBuildPlans = true;
public boolean animateSurfaces, drawWeather = true, drawStatus, enableEffects, drawDisplays = true, drawLight = true, pixelate = false, showPings = true, showOtherBuildPlans = true;
public float weatherAlpha;
/** minZoom = zooming out, maxZoom = zooming in, used by cutscenes */
public float minZoom = 1.5f, maxZoom = 6f;
@@ -164,8 +164,7 @@ public class Renderer implements ApplicationListener{
unitLaserOpacity = settings.getInt("unitlaseropacity") / 100f;
laserOpacity = settings.getInt("lasersopacity") / 100f;
bridgeOpacity = settings.getInt("bridgeopacity") / 100f;
animateWater = settings.getBool("animatedwater"); //TODO: rename to animatedSurfaces or something
animateShields = animateWater; //vestigial: TODO, remove
animateSurfaces = settings.getBool("animatedwater");
drawStatus = settings.getBool("blockstatus");
enableEffects = settings.getBool("effects");
drawDisplays = !settings.getBool("hidedisplays");
@@ -313,7 +312,7 @@ public class Renderer implements ApplicationListener{
graphics.clear(clearColor);
Draw.reset();
if(animateWater || animateShields){
if(animateSurfaces || animateSurfaces){
effectBuffer.resize(graphics.getWidth(), graphics.getHeight());
}
@@ -399,7 +398,7 @@ public class Renderer implements ApplicationListener{
Draw.draw(Layer.plans, overlays::drawBottom);
if(animateShields && Shaders.shield != null){
if(animateSurfaces && Shaders.shield != null){
//TODO would be nice if there were a way to detect if any shields or build beams actually *exist* before beginning/ending buffers, otherwise you're just blitting and swapping shaders for nothing
Draw.drawRange(Layer.shields, 1f, () -> effectBuffer.begin(Color.clear), () -> {
effectBuffer.end();

View File

@@ -91,8 +91,8 @@ public class EditorRenderer implements Disposable{
//don't process terrain updates every frame (helps with lag on low end devices)
boolean doUpdate = Core.graphics.getFrameId() % 2 == 0;
boolean prev = renderer.animateWater;
renderer.animateWater = false;
boolean prev = renderer.animateSurfaces;
renderer.animateSurfaces = false;
Tmp.m4.set(Draw.trans());
Draw.trans().idt();
@@ -128,7 +128,7 @@ public class EditorRenderer implements Disposable{
if(editor.showTerrain){
renderer.blocks.floor.drawLayer(CacheLayer.walls, doUpdate);
}
renderer.animateWater = prev;
renderer.animateSurfaces = prev;
if(chunks == null) return;

View File

@@ -132,7 +132,7 @@ public class ForceFieldAbility extends Ability{
if(unit.shield > 0){
Draw.color(unit.type.shieldColor(unit), Color.white, Mathf.clamp(alpha));
if(Vars.renderer.animateShields){
if(Vars.renderer.animateSurfaces){
Draw.z(Layer.shields + 0.001f * alpha);
Fill.poly(unit.x, unit.y, sides, realRad, rotation);
}else{

View File

@@ -220,7 +220,7 @@ public class ShieldArcAbility extends Ability{
Draw.color(color == null ? unit.type.shieldColor(unit) : color, Color.white, Mathf.clamp(alpha));
var pos = paramPos.set(x, y).rotate(unit.rotation - 90f).add(unit);
if(!Vars.renderer.animateShields){
if(!Vars.renderer.animateSurfaces){
Draw.alpha(0.4f);
}

View File

@@ -95,7 +95,7 @@ public class CacheLayer{
@Override
public void begin(){
if(!renderer.animateWater) return;
if(!renderer.animateSurfaces) return;
renderer.effectBuffer.begin(Color.clear);
renderer.blocks.floor.beginDraw();
@@ -103,7 +103,7 @@ public class CacheLayer{
@Override
public void end(){
if(!renderer.animateWater) return;
if(!renderer.animateSurfaces) return;
renderer.effectBuffer.end();
renderer.effectBuffer.blit(shader);

View File

@@ -144,7 +144,7 @@ public class Drawf{
x2 = close.x, y2 = close.y,
x3 = vecs[1].x, y3 = vecs[1].y;
if(renderer.animateShields){
if(renderer.animateSurfaces){
if(close != vecs[0] && close != vecs[1]){
Fill.tri(x, y, x1, y1, x2, y2);
Fill.tri(x, y, x3, y3, x2, y2);

View File

@@ -130,7 +130,7 @@ public class BaseShield extends Block{
Draw.color(shieldColor == null ? team.color : shieldColor, Color.white, Mathf.clamp(hit));
if(renderer.animateShields){
if(renderer.animateSurfaces){
Fill.poly(x, y, sides, radius);
}else{
Lines.stroke(1.5f);

View File

@@ -312,7 +312,7 @@ public class ForceProjector extends Block{
if(radius > 0.001f){
Draw.color(team.color, Color.white, Mathf.clamp(hit));
if(renderer.animateShields){
if(renderer.animateSurfaces){
Draw.z(Layer.shields + 0.001f * hit);
Fill.poly(x, y, sides, radius, shieldRotation);
}else{

View File

@@ -54,7 +54,7 @@ public class ShieldWall extends Wall{
Draw.color(team.color, Color.white, Mathf.clamp(hit));
if(renderer.animateShields){
if(renderer.animateSurfaces){
Fill.square(x, y, radius);
}else{
Lines.stroke(1.5f);