mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2024-10-05 23:47:25 +08:00
XML editing for audioconfig.dat4.rel
This commit is contained in:
parent
63a7b1bceb
commit
6d8a785635
File diff suppressed because it is too large
Load Diff
@ -2376,11 +2376,12 @@ namespace CodeWalker.GameFiles
|
|||||||
|
|
||||||
sb.AppendLine();
|
sb.AppendLine();
|
||||||
|
|
||||||
|
byte[] data;
|
||||||
|
|
||||||
if (!savetest) continue;
|
if (savetest)
|
||||||
|
{
|
||||||
|
|
||||||
|
data = rel.Save();
|
||||||
byte[] data = rel.Save();
|
|
||||||
if (data != null)
|
if (data != null)
|
||||||
{
|
{
|
||||||
if (data.Length != rbfe.FileUncompressedSize)
|
if (data.Length != rbfe.FileUncompressedSize)
|
||||||
@ -2393,9 +2394,6 @@ namespace CodeWalker.GameFiles
|
|||||||
if (data[i] != rel.RawFileData[i])
|
if (data[i] != rel.RawFileData[i])
|
||||||
{ break; }
|
{ break; }
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
|
||||||
{ }
|
|
||||||
|
|
||||||
|
|
||||||
RelFile rel2 = new RelFile();
|
RelFile rel2 = new RelFile();
|
||||||
@ -2406,9 +2404,14 @@ namespace CodeWalker.GameFiles
|
|||||||
if (rel2.RelDatas == null)
|
if (rel2.RelDatas == null)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{ }
|
||||||
|
|
||||||
if (!xmltest) continue;
|
}
|
||||||
|
|
||||||
|
if (xmltest)
|
||||||
|
{
|
||||||
var relxml = RelXml.GetXml(rel); //XML test...
|
var relxml = RelXml.GetXml(rel); //XML test...
|
||||||
var rel3 = XmlRel.GetRel(relxml);
|
var rel3 = XmlRel.GetRel(relxml);
|
||||||
if (rel3 != null)
|
if (rel3 != null)
|
||||||
@ -2447,7 +2450,7 @@ namespace CodeWalker.GameFiles
|
|||||||
else
|
else
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//sbi.Clear();
|
//sbi.Clear();
|
||||||
|
@ -303,6 +303,51 @@ namespace CodeWalker
|
|||||||
return GetRawVector3Array(cnode);
|
return GetRawVector3Array(cnode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static Vector4[] GetRawVector4Array(XmlNode node)
|
||||||
|
{
|
||||||
|
if (node == null) return new Vector4[0];
|
||||||
|
float x = 0f;
|
||||||
|
float y = 0f;
|
||||||
|
float z = 0f;
|
||||||
|
float w = 0f;
|
||||||
|
var items = new List<Vector4>();
|
||||||
|
var split = node.InnerText.Split('\n');// Regex.Split(node.InnerText, @"[\s\r\n\t]");
|
||||||
|
for (int i = 0; i < split.Length; i++)
|
||||||
|
{
|
||||||
|
var s = split[i]?.Trim();
|
||||||
|
if (string.IsNullOrEmpty(s)) continue;
|
||||||
|
var split2 = s.Split(',');// Regex.Split(s, @"[\s\t]");
|
||||||
|
int c = 0;
|
||||||
|
x = 0f; y = 0f;
|
||||||
|
for (int n = 0; n < split2.Length; n++)
|
||||||
|
{
|
||||||
|
var ts = split2[n]?.Trim();
|
||||||
|
if (string.IsNullOrEmpty(ts)) continue;
|
||||||
|
var f = FloatUtil.Parse(ts);
|
||||||
|
switch (c)
|
||||||
|
{
|
||||||
|
case 0: x = f; break;
|
||||||
|
case 1: y = f; break;
|
||||||
|
case 2: z = f; break;
|
||||||
|
case 3: w = f; break;
|
||||||
|
}
|
||||||
|
c++;
|
||||||
|
}
|
||||||
|
if (c >= 4)
|
||||||
|
{
|
||||||
|
var val = new Vector4(x, y, z, w);
|
||||||
|
items.Add(val);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return items.ToArray();
|
||||||
|
}
|
||||||
|
public static Vector4[] GetChildRawVector4Array(XmlNode node, string name)
|
||||||
|
{
|
||||||
|
var cnode = node.SelectSingleNode(name);
|
||||||
|
return GetRawVector4Array(cnode);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user