This commit is contained in:
Anuken 2019-07-03 20:24:11 -04:00
parent 79dc116e6a
commit 0837c476a1
3 changed files with 27 additions and 35 deletions

View File

@ -22,7 +22,6 @@ public class MenuRenderer implements Disposable{
private Matrix3 mat = new Matrix3();
private FrameBuffer shadows;
private CacheBatch batch;
private Texture texture = new Texture("sprites/backgrounds/background-1.png");
public MenuRenderer(){
Time.mark();
@ -44,11 +43,11 @@ public class MenuRenderer implements Disposable{
Block ore = Blocks.air;
Block wall = Blocks.air;
if(s1.octaveNoise2D(3, 0.5, 1/10.0, x, y) > 0.5){
if(s1.octaveNoise2D(3, 0.5, 1/20.0, x, y) > 0.5){
wall = Blocks.shaleRocks;
}
if(s3.octaveNoise2D(3, 0.5, 1/10.0, x, y) > 0.5){
if(s3.octaveNoise2D(3, 0.5, 1/20.0, x, y) > 0.5){
floor = Blocks.stone;
if(wall != Blocks.air){
wall = Blocks.rocks;
@ -59,7 +58,7 @@ public class MenuRenderer implements Disposable{
ore = Blocks.oreCopper;
}
if(s2.octaveNoise2D(3, 0.3, 1/15.0, x, y+999999) > 0.7){
if(s2.octaveNoise2D(2, 0.2, 1/15.0, x, y+99999) > 0.7){
ore = Blocks.oreLead;
}
@ -131,36 +130,30 @@ public class MenuRenderer implements Disposable{
}
public void render(){
float scaling = 4f;
camera.position.set(width * tilesize / 2f, height * tilesize / 2f);
camera.resize(Core.graphics.getWidth() / scaling,
Core.graphics.getHeight() / scaling);
mat.set(Draw.proj());
Draw.flush();
Draw.proj(camera.projection());
batch.setProjection(camera.projection());
batch.beginDraw();
batch.drawCache(cacheFloor);
batch.endDraw();
Draw.rect(Draw.wrap(shadows.getTexture()),
width * tilesize / 2f - 4f, height * tilesize / 2f - 4f,
width * tilesize, -height * tilesize);
Draw.flush();
batch.beginDraw();
batch.drawCache(cacheWall);
batch.endDraw();
Draw.proj(mat);
Draw.color(0f, 0f, 0f, darkness);
Fill.crect(0, 0, Core.graphics.getWidth(), Core.graphics.getHeight());
Draw.color();
float scale = 1f;
Draw.rect(Draw.wrap(texture), Core.graphics.getWidth()/2f, Core.graphics.getHeight()/2f, 2048 * scale, 2048 * scale);
if(false){
float scaling = 4f;
camera.position.set(width * tilesize / 2f, height * tilesize / 2f);
camera.resize(Core.graphics.getWidth() / scaling,
Core.graphics.getHeight() / scaling);
mat.set(Draw.proj());
Draw.flush();
Draw.proj(camera.projection());
batch.setProjection(camera.projection());
batch.beginDraw();
batch.drawCache(cacheFloor);
batch.endDraw();
Draw.rect(Draw.wrap(shadows.getTexture()),
width * tilesize / 2f - 4f, height * tilesize / 2f - 4f,
width * tilesize, -height * tilesize);
Draw.flush();
batch.beginDraw();
batch.drawCache(cacheWall);
batch.endDraw();
Draw.proj(mat);
Draw.color(0f, 0f, 0f, darkness);
Fill.crect(0, 0, Core.graphics.getWidth(), Core.graphics.getHeight());
Draw.color();
}
}
@Override

View File

@ -251,7 +251,6 @@ public abstract class SaveVersion extends SaveFileReader{
}
public void readContentHeader(DataInput stream) throws IOException{
byte mapped = stream.readByte();
MappableContent[][] map = new MappableContent[ContentType.values().length][0];

View File

@ -14,7 +14,7 @@ public class DesktopLauncher{
config.setTitle("Mindustry");
config.setMaximized(true);
config.setBackBufferConfig(8, 8, 8, 8, 0, 0, 0);
config.setWindowedMode(960, 540);
config.setWindowedMode(900, 600);
config.setWindowIcon("sprites/icon.png");
Platform.instance = new DesktopPlatform(arg);