Minor optimizations
This commit is contained in:
@@ -130,7 +130,6 @@ public class Control extends Module{
|
||||
|
||||
public void reset(){
|
||||
weapons.clear();
|
||||
renderer.clearTiles();
|
||||
|
||||
weapons.add(Weapon.blaster);
|
||||
player.weapon = weapons.first();
|
||||
@@ -161,7 +160,6 @@ public class Control extends Module{
|
||||
|
||||
public void play(){
|
||||
if(core == null) return;
|
||||
|
||||
renderer.clearTiles();
|
||||
|
||||
player.x = core.worldx();
|
||||
|
||||
@@ -489,7 +489,7 @@ public class Renderer extends RendererModule{
|
||||
cache = null;
|
||||
if(cbatch != null)
|
||||
cbatch.dispose();
|
||||
cbatch = new CacheBatch(256 * 256 * 3);
|
||||
cbatch = new CacheBatch(Vars.world.width() * Vars.world.height() * 3);
|
||||
}
|
||||
|
||||
void drawPaths(){
|
||||
|
||||
@@ -115,7 +115,11 @@ public class SaveIO{
|
||||
|
||||
public static boolean isSaveValid(int slot){
|
||||
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){
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user