Great cleanup

This commit is contained in:
Skat
2020-11-07 11:37:46 +03:00
parent 29b8db0a85
commit ed36390f3c
45 changed files with 134 additions and 189 deletions

View File

@@ -42,7 +42,7 @@ public class MenuRenderer implements Disposable{
private void generate(){
world.beginMapLoad();
Tiles tiles = world.resize(width, height);
Seq<Block> ores = content.blocks().select(b -> b instanceof OreBlock);
Seq<Block> ores = content.blocks().select(OreBlock.class::isInstance);
shadows = new FrameBuffer(width, height);
int offset = Mathf.random(100000);
Simplex s1 = new Simplex(offset);

View File

@@ -188,23 +188,23 @@ public class PlanetGrid{
}
static int pos(Ptile t, Ptile n){
for(int i = 0; i < t.edgeCount; i++)
if(t.tiles[i] == n)
return i;
for(int i = 0; i < t.edgeCount; i++){
if(t.tiles[i] == n) return i;
}
return -1;
}
static int pos(Ptile t, Corner c){
for(int i = 0; i < t.edgeCount; i++)
if(t.corners[i] == c)
return i;
for(int i = 0; i < t.edgeCount; i++){
if(t.corners[i] == c) return i;
}
return -1;
}
static int pos(Corner c, Corner n){
for(int i = 0; i < 3; i++)
if(c.corners[i] == n)
return i;
for(int i = 0; i < 3; i++){
if(c.corners[i] == n) return i;
}
return -1;
}

View File

@@ -18,10 +18,10 @@ import mindustry.type.*;
public class PlanetRenderer implements Disposable{
public static final float outlineRad = 1.17f, camLength = 4f;
public static final Color
outlineColor = Pal.accent.cpy().a(1f),
hoverColor = Pal.accent.cpy().a(0.5f),
borderColor = Pal.accent.cpy().a(0.3f),
shadowColor = new Color(0, 0, 0, 0.7f);
outlineColor = Pal.accent.cpy().a(1f),
hoverColor = Pal.accent.cpy().a(0.5f),
borderColor = Pal.accent.cpy().a(0.3f),
shadowColor = new Color(0, 0, 0, 0.7f);
private static final Seq<Vec3> points = new Seq<>();
@@ -119,7 +119,7 @@ public class PlanetRenderer implements Disposable{
public void renderPlanet(Planet planet){
if(!planet.visible()) return;
//render planet at offsetted position in the world
planet.draw(cam.combined, planet.getTransform(mat));