Line optimization & cleanup

This commit is contained in:
Anuken
2020-09-15 13:19:02 -04:00
parent 1327a2bef4
commit b3d7515dcd
21 changed files with 63 additions and 66 deletions
+3 -4
View File
@@ -150,15 +150,14 @@ public class Drawf{
}
public static void laser(Team team, TextureRegion line, TextureRegion edge, float x, float y, float x2, float y2, float rotation, float scale){
Tmp.v1.trns(rotation, 8f * scale * Draw.scl);
float scl = 8f * scale * Draw.scl;
float vx = Mathf.cosDeg(rotation) * scl, vy = Mathf.sinDeg(rotation) * scl;
Draw.rect(edge, x, y, edge.width * scale * Draw.scl, edge.height * scale * Draw.scl, rotation + 180);
Draw.rect(edge, x2, y2, edge.width * scale * Draw.scl, edge.height * scale * Draw.scl, rotation);
Lines.stroke(12f * scale);
Lines.precise(true);
Lines.line(line, x + Tmp.v1.x, y + Tmp.v1.y, x2 - Tmp.v1.x, y2 - Tmp.v1.y, false, 0f);
Lines.precise(false);
Lines.line(line, x + vx, y + vy, x2 - vx, y2 - vy, false);
Lines.stroke(1f);
light(team, x, y, x2, y2);