Misc improvements / Latum death unit spawning
This commit is contained in:
@@ -3,6 +3,7 @@ package mindustry.graphics;
|
||||
import arc.*;
|
||||
import arc.graphics.*;
|
||||
import arc.graphics.gl.*;
|
||||
import arc.math.*;
|
||||
import arc.util.*;
|
||||
|
||||
import static mindustry.Vars.*;
|
||||
@@ -31,6 +32,19 @@ public class CacheLayer{
|
||||
}
|
||||
}
|
||||
|
||||
/** Adds a cache layer at a certain position. All layers >= this index are shifted upwards.*/
|
||||
public static void add(int index, CacheLayer layer){
|
||||
index = Mathf.clamp(index, 0, all.length - 1);
|
||||
|
||||
var prev = all;
|
||||
all = new CacheLayer[all.length + 1];
|
||||
|
||||
System.arraycopy(prev, 0, all, 0, index);
|
||||
System.arraycopy(prev, index, all, index + 1, prev.length - index);
|
||||
|
||||
all[index] = layer;
|
||||
}
|
||||
|
||||
/** Loads default cache layers. */
|
||||
public static void init(){
|
||||
add(
|
||||
|
||||
Reference in New Issue
Block a user