tastudio: be able to load broken greenzone file.
This commit is contained in:
parent
838e986847
commit
f35938acdb
|
@ -578,21 +578,22 @@ namespace BizHawk.Client.Common
|
||||||
public void Load(BinaryReader br)
|
public void Load(BinaryReader br)
|
||||||
{
|
{
|
||||||
States.Clear();
|
States.Clear();
|
||||||
//if (br.BaseStream.Length > 0)
|
try
|
||||||
//{ BaseStream.Length does not return the expected value.
|
|
||||||
int nstates = br.ReadInt32();
|
|
||||||
for (int i = 0; i < nstates; i++)
|
|
||||||
{
|
{
|
||||||
int frame = br.ReadInt32();
|
int nstates = br.ReadInt32();
|
||||||
int len = br.ReadInt32();
|
for (int i = 0; i < nstates; i++)
|
||||||
byte[] data = br.ReadBytes(len);
|
{
|
||||||
// whether we should allow state removal check here is an interesting question
|
int frame = br.ReadInt32();
|
||||||
// nothing was edited yet, so it might make sense to show the project untouched first
|
int len = br.ReadInt32();
|
||||||
SetState(frame, data);
|
byte[] data = br.ReadBytes(len);
|
||||||
//States.Add(frame, data);
|
// whether we should allow state removal check here is an interesting question
|
||||||
//Used += len;
|
// nothing was edited yet, so it might make sense to show the project untouched first
|
||||||
|
SetState(frame, data);
|
||||||
|
//States.Add(frame, data);
|
||||||
|
//Used += len;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//}
|
catch (EndOfStreamException) { }
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SaveBranchStates(BinaryWriter bw)
|
public void SaveBranchStates(BinaryWriter bw)
|
||||||
|
|
Loading…
Reference in New Issue