Search in sources :

Example 1 with Layer

use of io.anuke.mindustry.world.Layer in project Mindustry by Anuken.

the class BlockRenderer method drawBlocks.

public void drawBlocks(boolean top) {
    Layer stopAt = top ? Layer.laser : Layer.overlay;
    for (; iterateidx < requestidx; iterateidx++) {
        if (iterateidx < requests.size - 1 && requests.get(iterateidx).layer.ordinal() > stopAt.ordinal()) {
            break;
        }
        BlockRequest req = requests.get(iterateidx);
        Block block = req.tile.block();
        if (req.layer == Layer.block) {
            block.draw(req.tile);
        } else if (req.layer == block.layer) {
            block.drawLayer(req.tile);
        } else if (req.layer == block.layer2) {
            block.drawLayer2(req.tile);
        }
    }
}
Also used : Block(io.anuke.mindustry.world.Block) StaticBlock(io.anuke.mindustry.world.blocks.types.StaticBlock) Layer(io.anuke.mindustry.world.Layer)

Aggregations

Block (io.anuke.mindustry.world.Block)1 Layer (io.anuke.mindustry.world.Layer)1 StaticBlock (io.anuke.mindustry.world.blocks.types.StaticBlock)1