Light cleanup

This commit is contained in:
Anuken
2020-04-24 11:08:02 -04:00
parent 1b2e10d355
commit 5d4ca753a7
20 changed files with 42 additions and 34 deletions

View File

@@ -9,8 +9,6 @@ import mindustry.entities.*;
import mindustry.gen.*;
import mindustry.graphics.*;
import static mindustry.Vars.renderer;
public class LaserBulletType extends BulletType{
protected Color[] colors = {Pal.lancerLaser.cpy().mul(1f, 1f, 1f, 0.4f), Pal.lancerLaser, Color.white};
protected float length = 160f;
@@ -73,6 +71,6 @@ public class LaserBulletType extends BulletType{
Draw.reset();
Tmp.v1.trns(b.rotation(), baseLen * 1.1f);
renderer.lights.line(b.x(), b.y(), b.x() + Tmp.v1.x, b.y() + Tmp.v1.y, width * 1.4f * b.fout(), colors[0], 0.6f);
Drawf.light(b.x(), b.y(), b.x() + Tmp.v1.x, b.y() + Tmp.v1.y, width * 1.4f * b.fout(), colors[0], 0.6f);
}
}

View File

@@ -114,7 +114,7 @@ abstract class BulletComp implements Timedc, Damagec, Hitboxc, Teamc, Posc, Draw
type.draw(this);
//TODO refactor
renderer.lights.add(x(), y(), 16f, Pal.powerLight, 0.3f);
Drawf.light(x(), y(), 16f, Pal.powerLight, 0.3f);
}
/** Sets the bullet's rotation in degrees. */

View File

@@ -5,7 +5,6 @@ import arc.graphics.g2d.*;
import arc.math.*;
import arc.math.geom.*;
import arc.util.*;
import mindustry.*;
import mindustry.annotations.Annotations.*;
import mindustry.content.*;
import mindustry.entities.*;
@@ -111,7 +110,7 @@ abstract class PuddleComp implements Posc, Puddlec{
if(liquid.lightColor.a > 0.001f && f > 0){
Color color = liquid.lightColor;
float opacity = color.a * f;
Vars.renderer.lights.add(tile.drawx(), tile.drawy(), 30f * f, color, opacity * 0.8f);
Drawf.light(tile.drawx(), tile.drawy(), 30f * f, color, opacity * 0.8f);
}
}

View File

@@ -644,7 +644,7 @@ abstract class TileComp implements Posc, Teamc, Healthc, Tilec, Timerc, QuadTree
float fract = 1f;
float opacity = color.a * fract;
if(opacity > 0.001f){
renderer.lights.add(x, y, block.size * 30f * fract, color, opacity);
Drawf.light(x, y, block.size * 30f * fract, color, opacity);
}
}
}