Implemented fog saving
This commit is contained in:
@@ -75,8 +75,7 @@ public class Saves{
|
||||
|
||||
Timers.run(2f, () -> {
|
||||
try{
|
||||
SaveIO.saveToSlot(current.index);
|
||||
current.meta = SaveIO.getData(current.index);
|
||||
current.save();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -108,10 +107,7 @@ public class Saves{
|
||||
slot.setName(name);
|
||||
saves.add(slot);
|
||||
saveMap.put(slot.index, slot);
|
||||
SaveIO.saveToSlot(slot.index);
|
||||
slot.meta = SaveIO.getData(slot.index);
|
||||
current = slot;
|
||||
|
||||
slot.save();
|
||||
saveSlots();
|
||||
return slot;
|
||||
}
|
||||
@@ -162,9 +158,18 @@ public class Saves{
|
||||
}
|
||||
|
||||
public void save(){
|
||||
SaveIO.saveToSlot(index);
|
||||
meta = SaveIO.getData(index);
|
||||
current = this;
|
||||
threads.runGraphics(() -> {
|
||||
//Renderer fog needs to be written on graphics thread, but save() can run on logic thread
|
||||
//thus, runGraphics is required here
|
||||
renderer.fog().writeFog();
|
||||
|
||||
//save on the logic thread
|
||||
threads.run(() -> {
|
||||
SaveIO.saveToSlot(index);
|
||||
meta = SaveIO.getData(index);
|
||||
current = this;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
public boolean isHidden(){
|
||||
|
||||
Reference in New Issue
Block a user