1
0
mirror of https://github.com/Anuken/Mindustry.git synced 2024-09-22 05:47:44 +03:00
This commit is contained in:
Anuken 2020-04-22 17:23:30 -04:00
parent fc4f8619f8
commit 6cf422eebf
5 changed files with 67 additions and 19 deletions

View File

@ -188,6 +188,8 @@ public class Renderer implements ApplicationListener{
Draw.proj(camera);
Draw.sort(true);
//beginFx();
drawBackground();
@ -206,7 +208,7 @@ public class Renderer implements ApplicationListener{
blocks.floor.drawLayer(CacheLayer.walls);
blocks.floor.endDraw();
Draw.sort(true);
blocks.drawBlocks();

View File

@ -14,6 +14,7 @@ import mindustry.game.Teams.*;
import mindustry.gen.*;
import mindustry.ui.*;
import mindustry.world.*;
import mindustry.world.blocks.power.*;
import static arc.Core.camera;
import static mindustry.Vars.*;
@ -202,7 +203,7 @@ public class BlockRenderer implements Disposable{
if(tile.entity != null && tile.entity.power() != null && tile.entity.power().links.size > 0){
for(Tilec other : tile.entity.getPowerConnections(outArray2)){
if(other.block().layer == Layer.power){
if(other.block() instanceof PowerNode){ //TODO need a generic way to render connections!
requests.add(other.tile());
}
}

View File

@ -1,16 +1,63 @@
package mindustry.graphics;
public enum Layer{
/** Base block layer. */
block,
/** for placement */
placement,
/** First overlay. Stuff like conveyor items. */
overlay,
/** "High" blocks, like turrets. */
turret,
/** Power lasers. */
power,
/** Extra layer that's always on top.*/
lights
/** Stores constants for sorting layers. Values should be stored in increments of 10. */
public class Layer{
public static final float
//background, which may be planets or an image or nothing at all
background = -10,
//floor tiles
floor = 0,
//scorch marks on the floor
scorch = 10,
//things such as spent casings or rubble
debris = 20,
//base block layer - most blocks go here
block = 30,
//blocks currently in progress *shaders used* TODO perhaps put shaders into their own category
blockBuilding = 40,
//ground units
groundUnit = 50,
//turrets
turret = 60,
//power lines
power = 70,
//building plans
plans = 80,
//flying units
flyingUnit = 90,
//bullets *bloom begin*
bullet = 100,
//effects *bloom end*
effect = 110,
//overlaied UI, like block config guides
overlayUI = 120,
//weather effects, e.g. rain and snow TODO draw before overlay UI?
weather = 130,
//light rendering *shaders used*
light = 140,
//names of players in the game
playerName = 150,
//space effects, currently only the land and launch effects
space = 160
;
}

View File

@ -2,9 +2,8 @@ package mindustry.world.blocks.legacy;
import arc.util.io.*;
import mindustry.gen.*;
import mindustry.world.*;
public class LegacyCommandCenter extends Block{
public class LegacyCommandCenter extends LegacyBlock{
public LegacyCommandCenter(String name){
super(name);

View File

@ -2,9 +2,8 @@ package mindustry.world.blocks.legacy;
import arc.util.io.*;
import mindustry.gen.*;
import mindustry.world.*;
public class LegacyUnitFactory extends Block{
public class LegacyUnitFactory extends LegacyBlock{
public LegacyUnitFactory(String name){
super(name);