Minor optimizations
3
.gitignore
vendored
@@ -4,10 +4,11 @@
|
|||||||
/desktop/packr-out/
|
/desktop/packr-out/
|
||||||
/desktop/packr-export/
|
/desktop/packr-export/
|
||||||
/desktop/mindustry-saves/
|
/desktop/mindustry-saves/
|
||||||
/destkop/mindustry-maps/
|
/destkop/mindustry-maps/*
|
||||||
/core/lib/
|
/core/lib/
|
||||||
*.gif
|
*.gif
|
||||||
|
|
||||||
|
.attach_*
|
||||||
## Java
|
## Java
|
||||||
|
|
||||||
*.class
|
*.class
|
||||||
|
|||||||
@@ -130,7 +130,6 @@ public class Control extends Module{
|
|||||||
|
|
||||||
public void reset(){
|
public void reset(){
|
||||||
weapons.clear();
|
weapons.clear();
|
||||||
renderer.clearTiles();
|
|
||||||
|
|
||||||
weapons.add(Weapon.blaster);
|
weapons.add(Weapon.blaster);
|
||||||
player.weapon = weapons.first();
|
player.weapon = weapons.first();
|
||||||
@@ -161,7 +160,6 @@ public class Control extends Module{
|
|||||||
|
|
||||||
public void play(){
|
public void play(){
|
||||||
if(core == null) return;
|
if(core == null) return;
|
||||||
|
|
||||||
renderer.clearTiles();
|
renderer.clearTiles();
|
||||||
|
|
||||||
player.x = core.worldx();
|
player.x = core.worldx();
|
||||||
|
|||||||
@@ -489,7 +489,7 @@ public class Renderer extends RendererModule{
|
|||||||
cache = null;
|
cache = null;
|
||||||
if(cbatch != null)
|
if(cbatch != null)
|
||||||
cbatch.dispose();
|
cbatch.dispose();
|
||||||
cbatch = new CacheBatch(256 * 256 * 3);
|
cbatch = new CacheBatch(Vars.world.width() * Vars.world.height() * 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
void drawPaths(){
|
void drawPaths(){
|
||||||
|
|||||||
@@ -115,7 +115,11 @@ public class SaveIO{
|
|||||||
|
|
||||||
public static boolean isSaveValid(int slot){
|
public static boolean isSaveValid(int slot){
|
||||||
try(DataInputStream stream = new DataInputStream(fileFor(slot).read())){
|
try(DataInputStream stream = new DataInputStream(fileFor(slot).read())){
|
||||||
return stream.readInt() == fileVersionID;
|
int version = stream.readInt(); //read version
|
||||||
|
stream.readLong(); //read last saved time
|
||||||
|
stream.readByte(); //read the gamemode
|
||||||
|
byte map = stream.readByte(); //read the map
|
||||||
|
return version == fileVersionID && Vars.world.maps().getMap(map) != null;
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 3.2 KiB |
@@ -1 +0,0 @@
|
|||||||
{"maps":[]}
|
|
||||||
|
Before Width: | Height: | Size: 4.5 KiB |
|
Before Width: | Height: | Size: 7.8 KiB |
|
Before Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 5.2 KiB |
|
Before Width: | Height: | Size: 873 B |
|
Before Width: | Height: | Size: 8.9 KiB |