Merged 4x graphics

This commit is contained in:
Anuken
2018-12-28 23:46:09 -05:00
137 changed files with 2985 additions and 3045 deletions
@@ -82,11 +82,12 @@ public class BlockRenderer{
return;
}
int shadowW = rangex * tilesize*2, shadowH = rangey * tilesize*2;
int shadowW = (int)(rangex * tilesize*2/Draw.scl), shadowH = (int)(rangey * tilesize*2/Draw.scl);
teamChecks.clear();
requestidx = 0;
//TODO fix shadows
Draw.flush();
Draw.proj().setOrtho(Mathf.round(camera.position.x, tilesize)-shadowW/2f, Mathf.round(camera.position.y, tilesize)-shadowH/2f,
shadowW, shadowH);
@@ -136,6 +137,7 @@ public class BlockRenderer{
}
}
//TODO proper shadows
Draw.flush();
shadows.end();
@@ -149,10 +151,6 @@ public class BlockRenderer{
lastRangeY = rangey;
}
public int getRequests(){
return requestidx;
}
public void drawBlocks(Layer stopAt){
for(; iterateidx < requestidx; iterateidx++){
@@ -21,8 +21,7 @@ import io.anuke.mindustry.world.blocks.Floor;
import java.util.Arrays;
import static io.anuke.mindustry.Vars.tilesize;
import static io.anuke.mindustry.Vars.world;
import static io.anuke.mindustry.Vars.*;
public class FloorRenderer{
private final static int chunksize = 64;
@@ -194,7 +193,7 @@ public class FloorRenderer{
if(cbatch != null) cbatch.dispose();
int chunksx = Mathf.ceil((float) (world.width()) / chunksize),
chunksy = Mathf.ceil((float) (world.height()) / chunksize) ;
chunksy = Mathf.ceil((float) (world.height()) / chunksize) ;
cache = new Chunk[chunksx][chunksy];
cbatch = new CacheBatch(world.width() * world.height() * 4 * 4);
@@ -11,11 +11,11 @@ import io.anuke.arc.math.Mathf;
public class Shapes{
public static void laser(String line, String edge, float x, float y, float x2, float y2, float scale){
laser(line, edge, x, y, x2, y2, Mathf.atan2(x2 - x, y2 - y), scale);
laser(line, edge, x, y, x2, y2, Mathf.angle(x2 - x, y2 - y), scale);
}
public static void laser(String line, String edge, float x, float y, float x2, float y2){
laser(line, edge, x, y, x2, y2, Mathf.atan2(x2 - x, y2 - y), 1f);
laser(line, edge, x, y, x2, y2, Mathf.angle(x2 - x, y2 - y), 1f);
}
public static void laser(String line, String edge, float x, float y, float x2, float y2, float rotation, float scale){