diff --git a/.gitignore b/.gitignore index 1ca9f7d39b..d568a38105 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ /deploy/ /desktop/packr-out/ /desktop/packr-export/ +/desktop/mindustry-saves/ /core/lib/ *.gif diff --git a/core/src/io/anuke/mindustry/core/Control.java b/core/src/io/anuke/mindustry/core/Control.java index 22c22dfdce..ac1cf2926e 100644 --- a/core/src/io/anuke/mindustry/core/Control.java +++ b/core/src/io/anuke/mindustry/core/Control.java @@ -105,6 +105,10 @@ public class Control extends Module{ "pause", Keys.SPACE ); + for(int i = 0; i < Vars.saveSlots; i ++){ + Settings.defaults("saveslot" + i, "empty"); + } + Settings.loadAll("io.anuke.moment"); for(Map map : Map.values()){ diff --git a/core/src/io/anuke/mindustry/core/Renderer.java b/core/src/io/anuke/mindustry/core/Renderer.java index a3ac6bf225..5fbccca229 100644 --- a/core/src/io/anuke/mindustry/core/Renderer.java +++ b/core/src/io/anuke/mindustry/core/Renderer.java @@ -290,24 +290,29 @@ public class Renderer extends RendererModule{ if(l == 0){ Graphics.surface("shadow"); } + + boolean expand = l >= 2; + int expandr = (expand ? 4 : 0); if(l == 1){ Graphics.end(); drawCache(1, crangex, crangey); Graphics.begin(); }else{ - for(int x = -rangex; x <= rangex; x++){ - for(int y = -rangey; y <= rangey; y++){ + for(int x = -rangex - expandr; x <= rangex + expandr; x++){ + for(int y = -rangey - expandr; y <= rangey + expandr; y++){ int worldx = Mathf.scl(camera.position.x, tilesize) + x; int worldy = Mathf.scl(camera.position.y, tilesize) + y; - + boolean expanded = (x < -rangex || x > rangex || y < -rangey || y > rangey); + if(world.tile(worldx, worldy) != null){ Tile tile = world.tile(worldx, worldy); - if(l == 0){ + if(l == 0 && !expanded){ if(tile.block() != Blocks.air && world.isAccessible(worldx, worldy)){ tile.block().drawShadow(tile); } - }else if(!(tile.block() instanceof StaticBlock)){ + }else if(!(tile.block() instanceof StaticBlock) && + !expanded || tile.block().expanded){ if(l == 2){ tile.block().draw(tile); }else if(l == 3){ diff --git a/core/src/io/anuke/mindustry/io/SaveIO.java b/core/src/io/anuke/mindustry/io/SaveIO.java index b1e5b2d6c6..2ab2a75709 100644 --- a/core/src/io/anuke/mindustry/io/SaveIO.java +++ b/core/src/io/anuke/mindustry/io/SaveIO.java @@ -283,6 +283,7 @@ public class SaveIO{ } } + //TODO GWT support public static void load(FileHandle file){ try(DataInputStream stream = new DataInputStream(file.read())){ diff --git a/core/src/io/anuke/mindustry/world/Block.java b/core/src/io/anuke/mindustry/world/Block.java index d3b0c8ccbc..01ecec44fb 100644 --- a/core/src/io/anuke/mindustry/world/Block.java +++ b/core/src/io/anuke/mindustry/world/Block.java @@ -67,6 +67,8 @@ public class Block{ public String description; /**Detailed description of the block. Can be as long as necesary.*/ public String fullDescription; + /**Whether to draw this block in the expanded draw range.*/ + public boolean expanded = false; public Block(String name) { blocks.add(this); diff --git a/core/src/io/anuke/mindustry/world/blocks/types/production/Generator.java b/core/src/io/anuke/mindustry/world/blocks/types/production/Generator.java index 94b2cef3d8..ddc31fed50 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/production/Generator.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/production/Generator.java @@ -31,6 +31,7 @@ public class Generator extends PowerBlock{ public Generator(String name){ super(name); + expanded = true; } @Override diff --git a/desktop/mindustry-saves/0.mins b/desktop/mindustry-saves/0.mins deleted file mode 100644 index d6822e9442..0000000000 Binary files a/desktop/mindustry-saves/0.mins and /dev/null differ diff --git a/desktop/mindustry-saves/1.mins b/desktop/mindustry-saves/1.mins deleted file mode 100644 index c9e88d8c67..0000000000 Binary files a/desktop/mindustry-saves/1.mins and /dev/null differ diff --git a/desktop/mindustry-saves/2.mins b/desktop/mindustry-saves/2.mins deleted file mode 100644 index 3ee6521fdc..0000000000 Binary files a/desktop/mindustry-saves/2.mins and /dev/null differ diff --git a/desktop/mindustry-saves/3.mins b/desktop/mindustry-saves/3.mins deleted file mode 100644 index c6304ac3d3..0000000000 Binary files a/desktop/mindustry-saves/3.mins and /dev/null differ diff --git a/desktop/mindustry-saves/4.mins b/desktop/mindustry-saves/4.mins deleted file mode 100644 index f50a640545..0000000000 Binary files a/desktop/mindustry-saves/4.mins and /dev/null differ diff --git a/desktop/mindustry-saves/5.mins b/desktop/mindustry-saves/5.mins deleted file mode 100644 index 96ded9333d..0000000000 Binary files a/desktop/mindustry-saves/5.mins and /dev/null differ diff --git a/desktop/mindustry-saves/6.mins b/desktop/mindustry-saves/6.mins deleted file mode 100644 index e391674832..0000000000 Binary files a/desktop/mindustry-saves/6.mins and /dev/null differ diff --git a/desktop/mindustry-saves/7.mins b/desktop/mindustry-saves/7.mins deleted file mode 100644 index ea53bde8d4..0000000000 Binary files a/desktop/mindustry-saves/7.mins and /dev/null differ