New basic water sprite
This commit is contained in:
@@ -3,6 +3,13 @@ package io.anuke.mindustry.graphics;
|
||||
//TODO implement effects again
|
||||
public enum CacheLayer{
|
||||
water{
|
||||
public void begin(){
|
||||
//Draw.shader(Shaders.water);
|
||||
}
|
||||
|
||||
public void end(){
|
||||
//Draw.shader();
|
||||
}
|
||||
},
|
||||
lava{
|
||||
},
|
||||
@@ -11,8 +18,7 @@ public enum CacheLayer{
|
||||
space{
|
||||
},
|
||||
normal,
|
||||
walls{ //TODO implement walls
|
||||
};
|
||||
walls;
|
||||
|
||||
public void begin(){
|
||||
|
||||
|
||||
@@ -124,6 +124,8 @@ public class FloorRenderer{
|
||||
int crangex = (int) (camera.width / (chunksize * tilesize)) + 1;
|
||||
int crangey = (int) (camera.height / (chunksize * tilesize)) + 1;
|
||||
|
||||
SpriteBatch batch = Core.batch;
|
||||
Core.batch = cbatch;
|
||||
layer.begin();
|
||||
|
||||
for(int x = -crangex; x <= crangex; x++){
|
||||
@@ -142,6 +144,7 @@ public class FloorRenderer{
|
||||
}
|
||||
|
||||
layer.end();
|
||||
Core.batch = batch;
|
||||
}
|
||||
|
||||
private void cacheChunk(int cx, int cy){
|
||||
|
||||
@@ -207,7 +207,7 @@ public class Shaders{
|
||||
public static class SurfaceShader extends LoadShader{
|
||||
|
||||
public SurfaceShader(String frag){
|
||||
super(frag, "default");
|
||||
super(frag, "cache");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -217,7 +217,7 @@ public class Shaders{
|
||||
Core.camera.position.y - Core.camera.height / 2 );
|
||||
setUniformf("screensize", Core.camera.width,
|
||||
Core.camera.height );
|
||||
setUniformf("time", Time.time());
|
||||
setUniformf("u_time", Time.time());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user