Animated water
This commit is contained in:
@@ -25,7 +25,7 @@ allprojects {
|
|||||||
appName = 'Mindustry'
|
appName = 'Mindustry'
|
||||||
gdxVersion = '1.9.8'
|
gdxVersion = '1.9.8'
|
||||||
aiVersion = '1.8.1'
|
aiVersion = '1.8.1'
|
||||||
uCoreVersion = '156dff2'
|
uCoreVersion = '36de2b4'
|
||||||
|
|
||||||
getVersionString = {
|
getVersionString = {
|
||||||
String buildVersion = getBuildVersion()
|
String buildVersion = getBuildVersion()
|
||||||
|
|||||||
90
core/assets/shaders/water.fragment
Normal file
90
core/assets/shaders/water.fragment
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
#ifdef GL_ES
|
||||||
|
precision mediump float;
|
||||||
|
precision mediump int;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
uniform sampler2D u_texture;
|
||||||
|
|
||||||
|
uniform vec2 camerapos;
|
||||||
|
uniform vec2 screensize;
|
||||||
|
uniform float time;
|
||||||
|
|
||||||
|
varying vec4 v_color;
|
||||||
|
varying vec2 v_texCoord;
|
||||||
|
|
||||||
|
float round(float num, float f){
|
||||||
|
return float(int(num / f)) * f;
|
||||||
|
}
|
||||||
|
|
||||||
|
vec3 permute(vec3 x) { return mod(((x*34.0)+1.0)*x, 289.0); }
|
||||||
|
|
||||||
|
float snoise(vec2 v){
|
||||||
|
const vec4 C = vec4(0.211324865405187, 0.366025403784439,
|
||||||
|
-0.577350269189626, 0.024390243902439);
|
||||||
|
vec2 i = floor(v + dot(v, C.yy) );
|
||||||
|
vec2 x0 = v - i + dot(i, C.xx);
|
||||||
|
vec2 i1;
|
||||||
|
i1 = (x0.x > x0.y) ? vec2(1.0, 0.0) : vec2(0.0, 1.0);
|
||||||
|
vec4 x12 = x0.xyxy + C.xxzz;
|
||||||
|
x12.xy -= i1;
|
||||||
|
i = mod(i, 289.0);
|
||||||
|
vec3 p = permute( permute( i.y + vec3(0.0, i1.y, 1.0 ))
|
||||||
|
+ i.x + vec3(0.0, i1.x, 1.0 ));
|
||||||
|
vec3 m = max(0.5 - vec3(dot(x0,x0), dot(x12.xy,x12.xy),
|
||||||
|
dot(x12.zw,x12.zw)), 0.0);
|
||||||
|
m = m*m ;
|
||||||
|
m = m*m ;
|
||||||
|
vec3 x = 2.0 * fract(p * C.www) - 1.0;
|
||||||
|
vec3 h = abs(x) - 0.5;
|
||||||
|
vec3 ox = floor(x + 0.5);
|
||||||
|
vec3 a0 = x - ox;
|
||||||
|
m *= 1.79284291400159 - 0.85373472095314 * ( a0*a0 + h*h );
|
||||||
|
vec3 g;
|
||||||
|
g.x = a0.x * x0.x + h.x * x0.y;
|
||||||
|
g.yz = a0.yz * x12.xz + h.yz * x12.yw;
|
||||||
|
return 130.0 * dot(m, g);
|
||||||
|
}
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
|
||||||
|
vec2 c = v_texCoord.xy;
|
||||||
|
vec4 color = texture2D(u_texture, c);
|
||||||
|
|
||||||
|
vec2 v = vec2(1.0/screensize.x, 1.0/screensize.y);
|
||||||
|
ivec2 icoords = ivec2(int(c.x / v.x + camerapos.x), int(c.y / v.y + camerapos.y));
|
||||||
|
vec2 coords = vec2(float(icoords.x), float(icoords.y));
|
||||||
|
|
||||||
|
float stime = time / 5.0;
|
||||||
|
|
||||||
|
float mscl = 30.0;
|
||||||
|
float mth = 5.0;
|
||||||
|
|
||||||
|
//if there's something actually there
|
||||||
|
if(color.r > 0.01){
|
||||||
|
vec4 old = color;
|
||||||
|
color = texture2D(u_texture, c + vec2(sin(stime/3.0 + coords.y/0.75) * v.x, 0.0)) * vec4(0.9, 0.9, 1, 1.0);
|
||||||
|
color.a = 1.0;
|
||||||
|
|
||||||
|
if(color.r < 0.01){
|
||||||
|
color = old;
|
||||||
|
}
|
||||||
|
|
||||||
|
float n1 = snoise(coords / 40.0 + vec2(time) / 200.0);
|
||||||
|
float n2 = snoise((coords + vec2(632.0)) / 25.0 + vec2(0.0, -time) / 190.0);
|
||||||
|
|
||||||
|
float r = (n1 + n2) * 3.0;
|
||||||
|
|
||||||
|
if(mod(float(int(coords.x + coords.y*1.1 + sin(stime / 8.0 + coords.x/5.0 - coords.y/100.0)*2.0)) +
|
||||||
|
sin(stime / 20.0 + coords.y/3.0) * 1.0 +
|
||||||
|
sin(stime / 10.0 + coords.y/2.0) * 2.0 +
|
||||||
|
sin(stime / 7.0 + coords.y/1.0) * 0.5 +
|
||||||
|
sin(coords.x + coords.y) +
|
||||||
|
sin(stime / 20.0 + coords.x/4.0) * 1.0, mscl) + r < mth){
|
||||||
|
|
||||||
|
color *= 1.2;
|
||||||
|
color.a = 1.0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gl_FragColor = color;
|
||||||
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
#Autogenerated file. Do not modify.
|
#Autogenerated file. Do not modify.
|
||||||
#Tue Mar 13 18:52:30 EDT 2018
|
#Tue Mar 13 22:34:33 EDT 2018
|
||||||
version=release
|
version=release
|
||||||
androidBuildCode=489
|
androidBuildCode=491
|
||||||
name=Mindustry
|
name=Mindustry
|
||||||
code=3.4
|
code=3.4
|
||||||
build=custom build
|
build=custom build
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ import static io.anuke.ucore.core.Core.camera;
|
|||||||
public class Renderer extends RendererModule{
|
public class Renderer extends RendererModule{
|
||||||
private final static float shieldHitDuration = 18f;
|
private final static float shieldHitDuration = 18f;
|
||||||
|
|
||||||
public Surface shadowSurface, shieldSurface, indicatorSurface;
|
public Surface shadowSurface, shieldSurface, indicatorSurface, waterSurface;
|
||||||
|
|
||||||
private int targetscale = baseCameraScale;
|
private int targetscale = baseCameraScale;
|
||||||
private Texture background = new Texture("sprites/background.png");
|
private Texture background = new Texture("sprites/background.png");
|
||||||
@@ -83,6 +83,7 @@ public class Renderer extends RendererModule{
|
|||||||
shieldSurface = Graphics.createSurface(scale);
|
shieldSurface = Graphics.createSurface(scale);
|
||||||
indicatorSurface = Graphics.createSurface(scale);
|
indicatorSurface = Graphics.createSurface(scale);
|
||||||
pixelSurface = Graphics.createSurface(scale);
|
pixelSurface = Graphics.createSurface(scale);
|
||||||
|
waterSurface = Graphics.createSurface(scale);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPixelate(boolean pixelate){
|
public void setPixelate(boolean pixelate){
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ public class BlockRenderer{
|
|||||||
Draw.color();
|
Draw.color();
|
||||||
|
|
||||||
Graphics.end();
|
Graphics.end();
|
||||||
drawCache(1, crangex, crangey);
|
drawCache(DrawLayer.walls, crangex, crangey);
|
||||||
Graphics.begin();
|
Graphics.begin();
|
||||||
|
|
||||||
Arrays.sort(requests.items, 0, requestidx);
|
Arrays.sort(requests.items, 0, requestidx);
|
||||||
@@ -165,12 +165,13 @@ public class BlockRenderer{
|
|||||||
|
|
||||||
//render the entire map
|
//render the entire map
|
||||||
if(cache == null || cache.length != chunksx || cache[0].length != chunksy){
|
if(cache == null || cache.length != chunksx || cache[0].length != chunksy){
|
||||||
cache = new int[chunksx][chunksy][2];
|
cache = new int[chunksx][chunksy][DrawLayer.values().length];
|
||||||
|
|
||||||
for(int x = 0; x < chunksx; x++){
|
for(DrawLayer layer : DrawLayer.values()){
|
||||||
for(int y = 0; y < chunksy; y++){
|
for(int x = 0; x < chunksx; x++){
|
||||||
cacheChunk(x, y, true);
|
for(int y = 0; y < chunksy; y++){
|
||||||
cacheChunk(x, y, false);
|
cacheChunk(x, y, layer);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -182,7 +183,11 @@ public class BlockRenderer{
|
|||||||
int crangex = (int)(camera.viewportWidth * camera.zoom / (chunksize * tilesize))+1;
|
int crangex = (int)(camera.viewportWidth * camera.zoom / (chunksize * tilesize))+1;
|
||||||
int crangey = (int)(camera.viewportHeight * camera.zoom / (chunksize * tilesize))+1;
|
int crangey = (int)(camera.viewportHeight * camera.zoom / (chunksize * tilesize))+1;
|
||||||
|
|
||||||
drawCache(0, crangex, crangey);
|
DrawLayer[] layers = DrawLayer.values();
|
||||||
|
|
||||||
|
for(int i = 0; i < layers.length - 1; i ++) {
|
||||||
|
drawCache(layers[i], crangex, crangey);
|
||||||
|
}
|
||||||
|
|
||||||
Graphics.begin();
|
Graphics.begin();
|
||||||
|
|
||||||
@@ -224,11 +229,11 @@ public class BlockRenderer{
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void drawCache(int layer, int crangex, int crangey){
|
void drawCache(DrawLayer layer, int crangex, int crangey){
|
||||||
Gdx.gl.glEnable(GL20.GL_BLEND);
|
Gdx.gl.glEnable(GL20.GL_BLEND);
|
||||||
|
|
||||||
cbatch.setProjectionMatrix(Core.camera.combined);
|
layer.begin(cbatch);
|
||||||
cbatch.beginDraw();
|
|
||||||
for(int x = -crangex; x <= crangex; x++){
|
for(int x = -crangex; x <= crangex; x++){
|
||||||
for(int y = -crangey; y <= crangey; y++){
|
for(int y = -crangey; y <= crangey; y++){
|
||||||
int worldx = Mathf.scl(camera.position.x, chunksize * tilesize) + x;
|
int worldx = Mathf.scl(camera.position.x, chunksize * tilesize) + x;
|
||||||
@@ -237,14 +242,14 @@ public class BlockRenderer{
|
|||||||
if(!Mathf.inBounds(worldx, worldy, cache))
|
if(!Mathf.inBounds(worldx, worldy, cache))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
cbatch.drawCache(cache[worldx][worldy][layer]);
|
cbatch.drawCache(cache[worldx][worldy][layer.ordinal()]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cbatch.endDraw();
|
layer.end(cbatch);
|
||||||
}
|
}
|
||||||
|
|
||||||
void cacheChunk(int cx, int cy, boolean floor){
|
void cacheChunk(int cx, int cy, DrawLayer layer){
|
||||||
if(cbatch == null){
|
if(cbatch == null){
|
||||||
createBatch();
|
createBatch();
|
||||||
}
|
}
|
||||||
@@ -256,18 +261,21 @@ public class BlockRenderer{
|
|||||||
for(int tiley = cy * chunksize; tiley < (cy + 1) * chunksize; tiley++){
|
for(int tiley = cy * chunksize; tiley < (cy + 1) * chunksize; tiley++){
|
||||||
Tile tile = world.tile(tilex, tiley);
|
Tile tile = world.tile(tilex, tiley);
|
||||||
if(tile == null) continue;
|
if(tile == null) continue;
|
||||||
if(floor){
|
|
||||||
if(!(tile.block() instanceof StaticBlock)){
|
if(tile.floor().drawLayer == layer && tile.block().drawLayer != DrawLayer.walls){
|
||||||
tile.floor().draw(tile);
|
tile.floor().draw(tile);
|
||||||
}
|
}else if(tile.floor().drawLayer.ordinal() < layer.ordinal() && tile.block().drawLayer != DrawLayer.walls){
|
||||||
}else if(tile.block() instanceof StaticBlock){
|
tile.floor().drawNonLayer(tile);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(tile.block().drawLayer == layer && layer == DrawLayer.walls){
|
||||||
tile.block().draw(tile);
|
tile.block().draw(tile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Graphics.popBatch();
|
Graphics.popBatch();
|
||||||
cbatch.end();
|
cbatch.end();
|
||||||
cache[cx][cy][floor ? 0 : 1] = cbatch.getLastCache();
|
cache[cx][cy][layer.ordinal()] = cbatch.getLastCache();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void clearTiles(){
|
public void clearTiles(){
|
||||||
|
|||||||
51
core/src/io/anuke/mindustry/graphics/DrawLayer.java
Normal file
51
core/src/io/anuke/mindustry/graphics/DrawLayer.java
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
package io.anuke.mindustry.graphics;
|
||||||
|
|
||||||
|
import io.anuke.ucore.core.Core;
|
||||||
|
import io.anuke.ucore.core.Graphics;
|
||||||
|
import io.anuke.ucore.graphics.CacheBatch;
|
||||||
|
import io.anuke.ucore.graphics.Draw;
|
||||||
|
|
||||||
|
import static io.anuke.mindustry.Vars.renderer;
|
||||||
|
|
||||||
|
public enum DrawLayer {
|
||||||
|
water{
|
||||||
|
@Override
|
||||||
|
public void begin(CacheBatch batch){
|
||||||
|
batch.setProjectionMatrix(Core.camera.combined);
|
||||||
|
Graphics.useBatch(batch.drawBatch());
|
||||||
|
|
||||||
|
Graphics.begin();
|
||||||
|
Graphics.surface(renderer.waterSurface);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void end(CacheBatch batch){
|
||||||
|
Graphics.surface();
|
||||||
|
Graphics.end();
|
||||||
|
|
||||||
|
Graphics.popBatch();
|
||||||
|
|
||||||
|
Graphics.shader(Shaders.water);
|
||||||
|
Graphics.begin();
|
||||||
|
Draw.rect(renderer.waterSurface.texture(), Core.camera.position.x, Core.camera.position.y,
|
||||||
|
Core.camera.viewportWidth * Core.camera.zoom, -Core.camera.viewportHeight * Core.camera.zoom);
|
||||||
|
Graphics.end();
|
||||||
|
Graphics.shader();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
normal,
|
||||||
|
walls;
|
||||||
|
|
||||||
|
public void begin(CacheBatch batch){
|
||||||
|
batch.setProjectionMatrix(Core.camera.combined);
|
||||||
|
Graphics.useBatch(batch.drawBatch());
|
||||||
|
|
||||||
|
Graphics.begin();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void end(CacheBatch batch){
|
||||||
|
Graphics.end();
|
||||||
|
|
||||||
|
Graphics.popBatch();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
package io.anuke.mindustry.graphics;
|
package io.anuke.mindustry.graphics;
|
||||||
|
|
||||||
|
import com.badlogic.gdx.Gdx;
|
||||||
import com.badlogic.gdx.graphics.Color;
|
import com.badlogic.gdx.graphics.Color;
|
||||||
import com.badlogic.gdx.math.Vector2;
|
import com.badlogic.gdx.math.Vector2;
|
||||||
import com.badlogic.gdx.utils.FloatArray;
|
import com.badlogic.gdx.utils.FloatArray;
|
||||||
@@ -12,9 +13,25 @@ import io.anuke.ucore.scene.ui.layout.Unit;
|
|||||||
public class Shaders{
|
public class Shaders{
|
||||||
public static final Outline outline = new Outline();
|
public static final Outline outline = new Outline();
|
||||||
public static final Shield shield = new Shield();
|
public static final Shield shield = new Shield();
|
||||||
|
public static final Water water = new Water();
|
||||||
|
|
||||||
private static final Vector2 vec = new Vector2();
|
private static final Vector2 vec = new Vector2();
|
||||||
|
|
||||||
|
public static class Water extends Shader{
|
||||||
|
|
||||||
|
public Water(){
|
||||||
|
super("water", "default");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void apply(){
|
||||||
|
shader.setUniformf("camerapos", Core.camera.position.x + Core.camera.zoom, Core.camera.position.y);
|
||||||
|
shader.setUniformf("screensize", Gdx.graphics.getWidth() / Core.cameraScale * Core.camera.zoom,
|
||||||
|
Gdx.graphics.getHeight() / Core.cameraScale * Core.camera.zoom);
|
||||||
|
shader.setUniformf("time", Timers.time());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static class Outline extends Shader{
|
public static class Outline extends Shader{
|
||||||
public Color color = new Color();
|
public Color color = new Color();
|
||||||
public float lighten = 0f;
|
public float lighten = 0f;
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import com.badlogic.gdx.utils.ObjectMap;
|
|||||||
import com.badlogic.gdx.utils.reflect.ClassReflection;
|
import com.badlogic.gdx.utils.reflect.ClassReflection;
|
||||||
import io.anuke.mindustry.core.GameState.State;
|
import io.anuke.mindustry.core.GameState.State;
|
||||||
import io.anuke.mindustry.entities.TileEntity;
|
import io.anuke.mindustry.entities.TileEntity;
|
||||||
|
import io.anuke.mindustry.graphics.DrawLayer;
|
||||||
import io.anuke.mindustry.graphics.Fx;
|
import io.anuke.mindustry.graphics.Fx;
|
||||||
import io.anuke.mindustry.net.Net;
|
import io.anuke.mindustry.net.Net;
|
||||||
import io.anuke.mindustry.net.NetEvents;
|
import io.anuke.mindustry.net.NetEvents;
|
||||||
@@ -79,6 +80,8 @@ public class Block extends BaseBlock {
|
|||||||
public boolean expanded = false;
|
public boolean expanded = false;
|
||||||
/**Max of timers used.*/
|
/**Max of timers used.*/
|
||||||
public int timers = 0;
|
public int timers = 0;
|
||||||
|
/**Draw layer. Only used for 'cached' rendering.*/
|
||||||
|
public DrawLayer drawLayer = DrawLayer.normal;
|
||||||
/**Layer to draw extra stuff on.*/
|
/**Layer to draw extra stuff on.*/
|
||||||
public Layer layer = null;
|
public Layer layer = null;
|
||||||
/**Extra layer to draw extra extra stuff on.*/
|
/**Extra layer to draw extra extra stuff on.*/
|
||||||
@@ -220,6 +223,8 @@ public class Block extends BaseBlock {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void drawNonLayer(Tile tile){}
|
||||||
|
|
||||||
public void drawShadow(Tile tile){
|
public void drawShadow(Tile tile){
|
||||||
|
|
||||||
if(varyShadow && variants > 0){
|
if(varyShadow && variants > 0){
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package io.anuke.mindustry.world.blocks;
|
package io.anuke.mindustry.world.blocks;
|
||||||
|
|
||||||
|
import io.anuke.mindustry.graphics.DrawLayer;
|
||||||
import io.anuke.mindustry.graphics.Fx;
|
import io.anuke.mindustry.graphics.Fx;
|
||||||
import io.anuke.mindustry.resource.Item;
|
import io.anuke.mindustry.resource.Item;
|
||||||
import io.anuke.mindustry.resource.ItemStack;
|
import io.anuke.mindustry.resource.ItemStack;
|
||||||
@@ -31,6 +32,7 @@ public class Blocks{
|
|||||||
solid = true;
|
solid = true;
|
||||||
liquidDrop = Liquid.water;
|
liquidDrop = Liquid.water;
|
||||||
liquid = true;
|
liquid = true;
|
||||||
|
drawLayer = DrawLayer.water;
|
||||||
}},
|
}},
|
||||||
|
|
||||||
water = new Floor("water"){{
|
water = new Floor("water"){{
|
||||||
@@ -38,6 +40,7 @@ public class Blocks{
|
|||||||
solid = true;
|
solid = true;
|
||||||
liquidDrop = Liquid.water;
|
liquidDrop = Liquid.water;
|
||||||
liquid = true;
|
liquid = true;
|
||||||
|
drawLayer = DrawLayer.water;
|
||||||
}},
|
}},
|
||||||
|
|
||||||
lava = new Floor("lava"){
|
lava = new Floor("lava"){
|
||||||
|
|||||||
@@ -67,8 +67,8 @@ public class ProductionBlocks{
|
|||||||
health = 200;
|
health = 200;
|
||||||
inputLiquid = Liquid.water;
|
inputLiquid = Liquid.water;
|
||||||
outputLiquid = Liquid.cryofluid;
|
outputLiquid = Liquid.cryofluid;
|
||||||
inputItem = Item.titanium;
|
inputItem = Item.quartz;
|
||||||
liquidPerItem = 70f;
|
liquidPerItem = 50f;
|
||||||
itemCapacity = 50;
|
itemCapacity = 50;
|
||||||
powerUse = 0.1f;
|
powerUse = 0.1f;
|
||||||
size = 2;
|
size = 2;
|
||||||
|
|||||||
@@ -20,13 +20,24 @@ public class Floor extends Block{
|
|||||||
variants = 3;
|
variants = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void drawNonLayer(Tile tile){
|
||||||
|
MathUtils.random.setSeed(tile.id());
|
||||||
|
|
||||||
|
drawEdges(tile, true);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void draw(Tile tile){
|
public void draw(Tile tile){
|
||||||
MathUtils.random.setSeed(tile.id());
|
MathUtils.random.setSeed(tile.id());
|
||||||
|
|
||||||
Draw.rect(variants > 0 ? (name() + MathUtils.random(1, variants)) : name(), tile.worldx(), tile.worldy());
|
Draw.rect(variants > 0 ? (name() + MathUtils.random(1, variants)) : name(), tile.worldx(), tile.worldy());
|
||||||
|
|
||||||
if(blend)
|
drawEdges(tile, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void drawEdges(Tile tile, boolean sameLayer){
|
||||||
|
if(!blend) return;
|
||||||
for(int dx = -1; dx <= 1; dx ++){
|
for(int dx = -1; dx <= 1; dx ++){
|
||||||
for(int dy = -1; dy <= 1; dy ++){
|
for(int dy = -1; dy <= 1; dy ++){
|
||||||
|
|
||||||
@@ -38,10 +49,11 @@ public class Floor extends Block{
|
|||||||
|
|
||||||
Block floor = other.floor();
|
Block floor = other.floor();
|
||||||
|
|
||||||
if(floor.id <= this.id || !blends.test(floor)) continue;
|
if(floor.id <= this.id || !blends.test(floor) || (floor.drawLayer.ordinal() > this.drawLayer.ordinal() && !sameLayer) ||
|
||||||
|
(sameLayer && floor.drawLayer == this.drawLayer)) continue;
|
||||||
|
|
||||||
TextureRegion region = Draw.hasRegion(floor.name() + "edge") ? Draw.region(floor.name() + "edge") :
|
TextureRegion region = Draw.hasRegion(floor.name() + "edge") ? Draw.region(floor.name() + "edge") :
|
||||||
Draw.region(floor.edge + "edge");
|
Draw.region(floor.edge + "edge");
|
||||||
|
|
||||||
int sx = -dx*8+2, sy = -dy*8+2;
|
int sx = -dx*8+2, sy = -dy*8+2;
|
||||||
int x = Mathf.clamp(sx, 0, 12);
|
int x = Mathf.clamp(sx, 0, 12);
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
package io.anuke.mindustry.world.blocks.types;
|
package io.anuke.mindustry.world.blocks.types;
|
||||||
|
|
||||||
|
import io.anuke.mindustry.graphics.DrawLayer;
|
||||||
import io.anuke.mindustry.world.Block;
|
import io.anuke.mindustry.world.Block;
|
||||||
|
|
||||||
public class StaticBlock extends Block{
|
public class StaticBlock extends Block{
|
||||||
|
|
||||||
public StaticBlock(String name) {
|
public StaticBlock(String name) {
|
||||||
super(name);
|
super(name);
|
||||||
|
drawLayer = DrawLayer.walls;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user