diff --git a/010Editor/BinaryDataTree.bt b/010Editor/BinaryDataTree.bt index f727fbb..441e130 100644 --- a/010Editor/BinaryDataTree.bt +++ b/010Editor/BinaryDataTree.bt @@ -13,6 +13,7 @@ #include "HaloWarsUtils.bt" +local uint64 kBinaryDataTreeBaseOffset = UINT64_MAX; local uint64 kBinaryDataTreeNameDataOffset = UINT64_MAX; local uint64 kBinaryDataTreeValueDataOffset = UINT64_MAX; @@ -146,11 +147,23 @@ string BBinaryDataTreeNameValueToString(BBinaryDataTreeNameValue& v) if (TypeClass == cTypeNull) return name; + local string StringValue = ""; + if (TypeClass == cTypeString && !DirectEncoding) + { + if (SizeInBytes == 0) + StringValue = ReadString(kBinaryDataTreeValueDataOffset + v.Value); + } + local string s; SPrintf(s, - "%s %s %s" + "%s%s %u %u %s %s %s %s" + , IsUnsigned ? "U" : " " + , DirectEncoding ? "D" : " " + , 1< 0) @@ -183,7 +198,7 @@ struct BBinaryDataTree kBinaryDataTreeValueDataOffset = UINT64_MAX; if (ValueDataSize > 0) { - ValueDataOffset = AlignUpValue(FTell(), 16); + ValueDataOffset = kBinaryDataTreeBaseOffset + AlignUpValue(FTell() - kBinaryDataTreeBaseOffset, 16); kBinaryDataTreeValueDataOffset = ValueDataOffset; } diff --git a/010Editor/HaloWarsUtils.bt b/010Editor/HaloWarsUtils.bt index 75ec852..be19172 100644 --- a/010Editor/HaloWarsUtils.bt +++ b/010Editor/HaloWarsUtils.bt @@ -98,7 +98,7 @@ typedef struct } Vector3F ; string Vector3FRead(Vector3F& v) { - string s; + local string s; SPrintf(s, "(%g, %g, %g)", v.x, v.y, v.z); return s; } @@ -113,7 +113,7 @@ typedef struct } XMVECTOR ; string XMVECTORRead(XMVECTOR& v) { - string s; + local string s; SPrintf(s, "(%g, %g, %g, %g)", v.x, v.y, v.z, v.w); return s; }