Commit a955b34a authored by You're Perfect 's avatar You're Perfect

Record start state in binary format

Should fix starting point save on Android
parent ba31114a
......@@ -40,7 +40,7 @@ public static class Serializer
public static int MaxUndoLevels = 99;
private static List<UndoState> _undoStates = new List<UndoState>();
private static List<UndoState> _redoStates = new List<UndoState>();
private static string _startState;
private static byte[] _startState = null;
private static string _lastCheckpointState;
private static bool _undoEnabled = true;
......@@ -106,7 +106,7 @@ public static class Serializer
public static bool HasStartState()
{
return !string.IsNullOrWhiteSpace(_startState);
return _startState != null;
}
public static void ClearStartState()
......@@ -116,15 +116,15 @@ public static class Serializer
public static void RecordStartState()
{
_startState = BlocksToCondensedJson();
_startState = BlocksToBinaryStream();
}
public static void ReloadStartState()
{
if (!string.IsNullOrWhiteSpace(_startState))
if (_startState != null)
{
BlockManager.Clear();
BlocksFromJson(_startState);
BlocksFromBinaryStream(_startState);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment