Memory optimizations, multithreading fixes, uCore updated
This commit is contained in:
@@ -4,7 +4,6 @@ import com.badlogic.gdx.graphics.Color;
|
||||
import com.badlogic.gdx.math.MathUtils;
|
||||
import com.badlogic.gdx.math.Vector2;
|
||||
import com.badlogic.gdx.utils.Array;
|
||||
import com.badlogic.gdx.utils.ObjectSet.ObjectSetIterator;
|
||||
import io.anuke.mindustry.content.blocks.Blocks;
|
||||
import io.anuke.mindustry.entities.Player;
|
||||
import io.anuke.mindustry.entities.Unit;
|
||||
@@ -163,9 +162,8 @@ public class OverlayRenderer {
|
||||
}
|
||||
|
||||
if((!debug || showUI) && Settings.getBool("healthbars")){
|
||||
ObjectSetIterator<TeamData> iterator = new ObjectSetIterator<>((debug ? state.teams.getTeams() : state.teams.getTeams(true)));
|
||||
|
||||
for(TeamData ally : iterator){
|
||||
for(TeamData ally : (debug ? state.teams.getTeams() : state.teams.getTeams(true))){
|
||||
for(Unit e : unitGroups[ally.team.ordinal()].all()){
|
||||
drawStats(e);
|
||||
}
|
||||
@@ -189,8 +187,8 @@ public class OverlayRenderer {
|
||||
}
|
||||
|
||||
drawEncloser(x, y - 8f, 2f);
|
||||
drawBar(Color.SCARLET, x, y - 8f, unit.healthf());
|
||||
drawBar(Color.valueOf("32cf6d"), x, y - 9f, unit.inventory.totalAmmo() / (float) unit.inventory.ammoCapacity());
|
||||
drawBar(Palette.healthstats, x, y - 8f, unit.healthf());
|
||||
drawBar(Palette.ammo, x, y - 9f, unit.inventory.totalAmmo() / (float) unit.inventory.ammoCapacity());
|
||||
}
|
||||
|
||||
void drawBar(Color color, float x, float y, float finion){
|
||||
@@ -220,7 +218,7 @@ public class OverlayRenderer {
|
||||
float len = 3;
|
||||
|
||||
Lines.stroke(2f + height);
|
||||
Draw.color(Color.SLATE);
|
||||
Draw.color(Palette.bar);
|
||||
Lines.line(x - len - 0.5f, y, x + len + 1.5f, y, CapStyle.none);
|
||||
|
||||
Draw.reset();
|
||||
|
||||
@@ -16,6 +16,7 @@ public class Palette {
|
||||
public static final Color lighterOrange = Color.valueOf("f6e096");
|
||||
|
||||
public static final Color lightishGray = Color.valueOf("a2a2a2");
|
||||
public static final Color darkishGray = new Color(0.3f, 0.3f, 0.3f, 1f);
|
||||
|
||||
public static final Color lancerLaser = Color.valueOf("a9d8ff");
|
||||
|
||||
@@ -37,7 +38,9 @@ public class Palette {
|
||||
|
||||
public static final Color missingitems = Color.SCARLET;
|
||||
public static final Color health = Color.YELLOW;
|
||||
public static final Color ammo = Color.valueOf("32cf6d");
|
||||
public static final Color healthstats = Color.SCARLET;
|
||||
public static final Color bar = Color.SLATE;
|
||||
public static final Color interact = Color.ORANGE;
|
||||
public static final Color accent = Color.valueOf("f4ba6e");
|
||||
public static final Color place = Color.valueOf("6335f8");
|
||||
@@ -46,4 +49,13 @@ public class Palette {
|
||||
public static final Color breakInvalid = Color.valueOf("d44b3d");
|
||||
public static final Color range = Color.valueOf("f4ba6e");
|
||||
public static final Color power = Color.valueOf("fbd367");
|
||||
|
||||
public static final Color redSpark = Color.valueOf("fbb97f");
|
||||
public static final Color orangeSpark = Color.valueOf("d2b29c");
|
||||
|
||||
public static final Color redDust = Color.valueOf("ffa480");
|
||||
public static final Color redderDust = Color.valueOf("ff7b69");
|
||||
|
||||
public static final Color plasticSmoke = Color.valueOf("f1e479");
|
||||
public static final Color plasticBurn = Color.valueOf("e9ead3");
|
||||
}
|
||||
|
||||
@@ -10,14 +10,13 @@ import io.anuke.ucore.util.Mathf;
|
||||
/**Class that renders a trail.*/
|
||||
public class Trail {
|
||||
private final int length;
|
||||
|
||||
private FloatArray points = new FloatArray();
|
||||
private final FloatArray points = new FloatArray();
|
||||
|
||||
public Trail(int length){
|
||||
this.length = length;
|
||||
}
|
||||
|
||||
public void update(float curx, float cury){
|
||||
public synchronized void update(float curx, float cury){
|
||||
points.add(curx, cury);
|
||||
|
||||
if(points.size > length*2) {
|
||||
@@ -27,7 +26,11 @@ public class Trail {
|
||||
}
|
||||
}
|
||||
|
||||
public void draw(Color start, Color end, float stroke){
|
||||
public synchronized void clear(){
|
||||
points.clear();
|
||||
}
|
||||
|
||||
public synchronized void draw(Color start, Color end, float stroke){
|
||||
|
||||
for(int i = 0; i < points.size - 2; i += 2){
|
||||
float x = points.get(i);
|
||||
|
||||
Reference in New Issue
Block a user