pmx export support

This commit is contained in:
CroakFang
2023-07-10 02:04:41 +08:00
parent c595c06b78
commit 103d83b760
15 changed files with 378 additions and 113 deletions
@@ -36,18 +36,12 @@ namespace LibMMD.Util
{
throw new MMDFileParseException("pmx string length is negative");
}
if (str.Length > length)
if(length > 0)
{
str = str.Substring(0, length);
var bytes = encoding.GetBytes(str);
writer.Write(bytes);
}
else if (str.Length < length)
{
str = str.PadRight(length, '\0');
}
var bytes = encoding.GetBytes(str);
writer.Write(bytes);
}