Optimizations

This commit is contained in:
Anuken
2018-07-11 12:19:21 -04:00
parent bce0101278
commit 2b58bd5bd8
11 changed files with 21 additions and 91 deletions

View File

@@ -57,7 +57,7 @@ public class BlockRenderer{
int expandr = 4;
Graphics.surface(renderer.effectSurface);
Graphics.surface(renderer.effectSurface, true, false);
int avgx = Mathf.scl(camera.position.x, tilesize);
int avgy = Mathf.scl(camera.position.y, tilesize);

View File

@@ -40,7 +40,8 @@ public class Trail {
points.clear();
}
public synchronized void draw(Color start, Color end, float stroke){
public synchronized void draw(Color color, float stroke){
Draw.color(color);
for(int i = 0; i < points.size - 2; i += 2){
float x = points.get(i);
@@ -49,8 +50,6 @@ public class Trail {
float y2 = points.get(i + 3);
float s = Mathf.clamp((float)(i) / points.size);
Draw.color(start, end, s);
Lines.stroke(s * stroke);
Lines.line(x, y, x2, y2);
}
@@ -59,8 +58,6 @@ public class Trail {
Fill.circle(points.get(points.size-2), points.get(points.size-1), stroke/2f);
}
Draw.color(start);
Draw.reset();
}
}