Fixed lighting not rendering / Fixed engine colors

This commit is contained in:
Anuken
2019-02-05 22:11:02 -05:00
parent 6217ae78e3
commit 6ea90ea828
5 changed files with 25 additions and 33 deletions

View File

@@ -4,6 +4,8 @@ import io.anuke.annotations.Annotations.Loc;
import io.anuke.annotations.Annotations.Remote;
import io.anuke.arc.collection.Array;
import io.anuke.arc.collection.IntSet;
import io.anuke.arc.graphics.g2d.Fill;
import io.anuke.arc.graphics.g2d.Lines;
import io.anuke.mindustry.entities.EntityGroup;
import io.anuke.mindustry.entities.impl.TimedEntity;
import io.anuke.mindustry.entities.traits.DrawTrait;
@@ -129,31 +131,22 @@ public class Lightning extends TimedEntity implements DrawTrait, SyncTrait, Time
@Override
public void draw(){
float lx = x, ly = y;
Lines.stroke(2f * fout());
Draw.color(color, Color.WHITE, fin());
//TODO this is really, really bad rendering
/*
for(int i = 0; i < lines.size; i++){
Position v = lines.get(i);
Lines.beginLine();
float f = (float) i / lines.size;
Lines.linePoint(x, y);
for(Position p : lines){
Lines.linePoint(p.getX(), p.getY());
}
Lines.endLine();
Lines.stroke(fout() * 3f * (1.5f - f));
int i = 0;
Lines.stroke(Lines.getStroke() * 4f);
Draw.alpha(0.3f);
Lines.line(lx, ly, v.getX(), v.getY());
Lines.stroke(Lines.getStroke()/4f);
Draw.alpha(1f);
Lines.line(lx, ly, v.getX(), v.getY());
Lines.stroke(3f * fout() * (1f - f));
lx = v.getX();
ly = v.getY();
}*/
Draw.color();
for(Position p : lines){
Fill.square(p.getX(), p.getY(), (4f - (float)i++/lines.size*2f) * fout(), 45);
}
Draw.reset();
}
@Override

View File

@@ -371,7 +371,7 @@ public class Player extends Unit implements BuilderTrait, ShooterTrait{
public void drawUnder(){
float size = mech.engineSize * (mech.flying ? 1f : boostHeat);
Draw.color(mech.trailColorTo);
Draw.color(mech.engineColor);
Fill.circle(x + Angles.trnsx(rotation + 180, mech.engineOffset), y + Angles.trnsy(rotation + 180, mech.engineOffset),
size + Mathf.absin(Time.time(), 2f, size/4f));