Minor optimization
This commit is contained in:
@@ -152,8 +152,8 @@ 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);
|
||||
|
||||
Draw.rect(edge, x, y, edge.getWidth() * scale * Draw.scl, edge.getHeight() * scale * Draw.scl, rotation + 180);
|
||||
Draw.rect(edge, x2, y2, edge.getWidth() * scale * Draw.scl, edge.getHeight() * scale * Draw.scl, rotation);
|
||||
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);
|
||||
|
||||
@@ -68,10 +68,10 @@ public class IndexedRenderer implements Disposable{
|
||||
public void draw(int index, TextureRegion region, float x, float y, float w, float h){
|
||||
float fx2 = x + w;
|
||||
float fy2 = y + h;
|
||||
float u = region.getU();
|
||||
float v = region.getV2();
|
||||
float u2 = region.getU2();
|
||||
float v2 = region.getV();
|
||||
float u = region.u;
|
||||
float v = region.v2;
|
||||
float u2 = region.u2;
|
||||
float v2 = region.v;
|
||||
|
||||
float[] vertices = tmpVerts;
|
||||
float color = this.color;
|
||||
@@ -118,10 +118,10 @@ public class IndexedRenderer implements Disposable{
|
||||
}
|
||||
|
||||
public void draw(int index, TextureRegion region, float x, float y, float w, float h, float rotation){
|
||||
float u = region.getU();
|
||||
float v = region.getV2();
|
||||
float u2 = region.getU2();
|
||||
float v2 = region.getV();
|
||||
float u = region.u;
|
||||
float v = region.v2;
|
||||
float u2 = region.u2;
|
||||
float v2 = region.v;
|
||||
|
||||
float originX = w / 2, originY = h / 2;
|
||||
|
||||
|
||||
@@ -58,10 +58,10 @@ public class LightRenderer{
|
||||
TextureRegion ledge = Core.atlas.find("circle-end"), lmid = Core.atlas.find("circle-mid");
|
||||
|
||||
float color = Draw.getColor().toFloatBits();
|
||||
float u = lmid.getU();
|
||||
float v = lmid.getV2();
|
||||
float u2 = lmid.getU2();
|
||||
float v2 = lmid.getV();
|
||||
float u = lmid.u;
|
||||
float v = lmid.v2;
|
||||
float u2 = lmid.u2;
|
||||
float v2 = lmid.v;
|
||||
|
||||
|
||||
Vec2 v1 = Tmp.v1.trnsExact(rot + 90f, stroke);
|
||||
@@ -103,10 +103,10 @@ public class LightRenderer{
|
||||
|
||||
Vec2 v3 = Tmp.v2.trnsExact(rot, stroke);
|
||||
|
||||
u = ledge.getU();
|
||||
v = ledge.getV2();
|
||||
u2 = ledge.getU2();
|
||||
v2 = ledge.getV();
|
||||
u = ledge.u;
|
||||
v = ledge.v2;
|
||||
u2 = ledge.u2;
|
||||
v2 = ledge.v;
|
||||
|
||||
vertices[0] = lx4;
|
||||
vertices[1] = ly4;
|
||||
|
||||
@@ -243,7 +243,7 @@ public class MenuRenderer implements Disposable{
|
||||
|
||||
TextureRegion icon = flyerType.icon(Cicon.full);
|
||||
|
||||
float size = Math.max(icon.getWidth(), icon.getHeight()) * Draw.scl * 1.6f;
|
||||
float size = Math.max(icon.width, icon.height) * Draw.scl * 1.6f;
|
||||
|
||||
flyers((x, y) -> {
|
||||
Draw.rect(flyerType.region, x - 12f, y - 13f, flyerRot - 90);
|
||||
|
||||
@@ -122,8 +122,8 @@ public class MinimapRenderer implements Disposable{
|
||||
float dy = (Core.camera.position.y / tilesize);
|
||||
dx = Mathf.clamp(dx, sz, world.width() - sz);
|
||||
dy = Mathf.clamp(dy, sz, world.height() - sz);
|
||||
float invTexWidth = 1f / texture.getWidth();
|
||||
float invTexHeight = 1f / texture.getHeight();
|
||||
float invTexWidth = 1f / texture.width;
|
||||
float invTexHeight = 1f / texture.height;
|
||||
float x = dx - sz, y = world.height() - dy - sz, width = sz * 2, height = sz * 2;
|
||||
region.set(x * invTexWidth, y * invTexHeight, (x + width) * invTexWidth, (y + height) * invTexHeight);
|
||||
return region;
|
||||
|
||||
@@ -152,9 +152,9 @@ public class Shaders{
|
||||
setUniformf("u_time", time);
|
||||
setUniformf("u_color", color);
|
||||
setUniformf("u_progress", progress);
|
||||
setUniformf("u_uv", region.getU(), region.getV());
|
||||
setUniformf("u_uv2", region.getU2(), region.getV2());
|
||||
setUniformf("u_texsize", region.getTexture().getWidth(), region.getTexture().getHeight());
|
||||
setUniformf("u_uv", region.u, region.v);
|
||||
setUniformf("u_uv2", region.u2, region.v2);
|
||||
setUniformf("u_texsize", region.getTexture().width, region.getTexture().height);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -171,10 +171,10 @@ public class Shaders{
|
||||
public void apply(){
|
||||
setUniformf("u_progress", progress);
|
||||
setUniformf("u_color", color);
|
||||
setUniformf("u_uv", region.getU(), region.getV());
|
||||
setUniformf("u_uv2", region.getU2(), region.getV2());
|
||||
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().getHeight());
|
||||
setUniformf("u_texsize", region.getTexture().width, region.getTexture().height);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user