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

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);

View File

@@ -98,7 +98,7 @@ public class LightRenderer{
vertices[22] = v;
vertices[23] = 0;
Draw.vert(ledge.getTexture(), vertices, 0, vertices.length);
Draw.vert(ledge.texture, vertices, 0, vertices.length);
Vec2 v3 = Tmp.v2.trnsExact(rot, stroke);
@@ -136,7 +136,7 @@ public class LightRenderer{
vertices[22] = v;
vertices[23] = 0;
Draw.vert(ledge.getTexture(), vertices, 0, vertices.length);
Draw.vert(ledge.texture, vertices, 0, vertices.length);
vertices[0] = lx2;
vertices[1] = ly2;
@@ -166,7 +166,7 @@ public class LightRenderer{
vertices[22] = v;
vertices[23] = 0;
Draw.vert(ledge.getTexture(), vertices, 0, vertices.length);
Draw.vert(ledge.texture, vertices, 0, vertices.length);
});
}

View File

@@ -98,7 +98,6 @@ public class LoadRenderer implements Disposable{
float w = Core.graphics.getWidth(), h = Core.graphics.getHeight(), s = Scl.scl();
//s = 2f;
Lines.precise(true);
Draw.proj().setOrtho(0, 0, Core.graphics.getWidth(), Core.graphics.getHeight());
@@ -467,7 +466,6 @@ public class LoadRenderer implements Disposable{
font.draw(red + "[[[[ " + key + " ]]\n"+orange+"<" + Version.modifier + " " + (Version.build == 0 ? " [init]" : Version.build == -1 ? " custom" : " " + Version.build) + ">", w/2f, h/2f + 110*s, Align.center);
}
Lines.precise(false);
Draw.flush();
fx.end();

View File

@@ -154,7 +154,7 @@ public class Shaders{
setUniformf("u_progress", progress);
setUniformf("u_uv", region.u, region.v);
setUniformf("u_uv2", region.u2, region.v2);
setUniformf("u_texsize", region.getTexture().getWidth(), region.getTexture().height);
setUniformf("u_texsize", region.texture.getWidth(), region.texture.height);
}
}
@@ -174,7 +174,7 @@ public class Shaders{
setUniformf("u_uv", region.u, region.v);
setUniformf("u_uv2", region.u2, region.v2);
setUniformf("u_time", Time.time());
setUniformf("u_texsize", region.getTexture().getWidth(), region.getTexture().height);
setUniformf("u_texsize", region.texture.getWidth(), region.texture.height);
}
}