YDR/XML conversion progress

This commit is contained in:
dexy 2020-01-19 02:36:28 +11:00
parent cd4c87cd71
commit 9ed308df7a
4 changed files with 856 additions and 101 deletions

File diff suppressed because it is too large Load Diff

View File

@ -278,7 +278,7 @@ namespace CodeWalker.GameFiles
}
public virtual void WriteXml(StringBuilder sb, int indent, string ddsfolder)
{
YtdXml.StringTag(sb, indent, "Name", Name);
YtdXml.StringTag(sb, indent, "Name", YtdXml.XmlEscape(Name));
YtdXml.ValueTag(sb, indent, "Unk32", Unknown_32h.ToString());
}
public virtual void ReadXml(XmlNode node, string ddsfolder)

View File

@ -1910,16 +1910,20 @@ namespace CodeWalker
}
private void ExportXml()
{
bool isytd = false;//need a folder to output ytd XML to, for the texture .dds files
bool needfolder = false;//need a folder to output ytd XML to, for the texture .dds files
if (MainListView.SelectedIndices.Count == 1)
{
var idx = MainListView.SelectedIndices[0];
if ((idx < 0) || (idx >= CurrentFiles.Count)) return;
var file = CurrentFiles[idx];
isytd = file?.File?.NameLower?.EndsWith(".ytd") == true;
var nl = file?.File?.NameLower;
if (!string.IsNullOrEmpty(nl))
{
needfolder = nl.EndsWith(".ytd") || nl.EndsWith(".ydr") || nl.EndsWith(".ydd") || nl.EndsWith(".yft") || nl.EndsWith(".ypt");
}
}
if ((MainListView.SelectedIndices.Count == 1) && (!isytd))
if ((MainListView.SelectedIndices.Count == 1) && (!needfolder))
{
var idx = MainListView.SelectedIndices[0];
if ((idx < 0) || (idx >= CurrentFiles.Count)) return;

View File

@ -1132,10 +1132,6 @@ namespace CodeWalker.Rendering
{
IndexBuffer = Buffer.Create(device, BindFlags.IndexBuffer, DrawableGeom.IndexBuffer.Indices);
}
else if (DrawableGeom.BoneIds != null)
{
IndexBuffer = Buffer.Create(device, BindFlags.IndexBuffer, DrawableGeom.BoneIds);
}
}