mirror of
https://github.com/aelurum/AssetStudio.git
synced 2025-07-18 03:24:15 -04:00
- fixed bug when attempting to preview unsupported fonts
- added failsafe for ReadStringToNull - added status messages for loading and previewing assets
This commit is contained in:
@ -163,21 +163,24 @@ namespace Unity_Studio
|
||||
|
||||
public string ReadAlignedString(int length)
|
||||
{
|
||||
|
||||
byte[] stringData = new byte[length];
|
||||
base.Read(stringData, 0, length);
|
||||
var result = System.Text.Encoding.UTF8.GetString(stringData); //must verify strange characters in PS3
|
||||
|
||||
/*string result = "";
|
||||
char c;
|
||||
for (int i = 0; i < length; i++)
|
||||
if (length > 0 && length < (base.BaseStream.Length - base.BaseStream.Position))//crude failsafe
|
||||
{
|
||||
c = (char)base.ReadByte();
|
||||
result += c.ToString();
|
||||
}*/
|
||||
byte[] stringData = new byte[length];
|
||||
base.Read(stringData, 0, length);
|
||||
var result = System.Text.Encoding.UTF8.GetString(stringData); //must verify strange characters in PS3
|
||||
|
||||
AlignStream(4);
|
||||
return result;
|
||||
/*string result = "";
|
||||
char c;
|
||||
for (int i = 0; i < length; i++)
|
||||
{
|
||||
c = (char)base.ReadByte();
|
||||
result += c.ToString();
|
||||
}*/
|
||||
|
||||
AlignStream(4);
|
||||
return result;
|
||||
}
|
||||
else { return ""; }
|
||||
}
|
||||
|
||||
public string ReadStringToNull()
|
||||
|
Reference in New Issue
Block a user