FxcFile Save method and loading improvements

This commit is contained in:
dexy 2022-05-20 12:11:25 +10:00
parent 9904e92082
commit a2f34ddf05
3 changed files with 652 additions and 447 deletions

File diff suppressed because it is too large Load Diff

View File

@ -217,6 +217,7 @@ namespace CodeWalker.GameFiles
//TestYmaps();
//TestYpdbs();
//TestMrfs();
//TestFxcs();
//TestPlacements();
//TestDrawables();
//TestCacheFiles();
@ -4550,6 +4551,44 @@ namespace CodeWalker.GameFiles
}
}
}
public void TestFxcs()
{
foreach (RpfFile file in AllRpfs)
{
foreach (RpfEntry entry in file.AllEntries)
{
try
{
if (entry.NameLower.EndsWith(".fxc"))
{
UpdateStatus(string.Format(entry.Path));
var fxcfile = RpfMan.GetFile<FxcFile>(entry);
if (fxcfile != null)
{
var odata = entry.File.ExtractFile(entry as RpfFileEntry);
var ndata = fxcfile.Save();
if (ndata.Length == odata.Length)
{
for (int i = 0; i < ndata.Length; i++)
{
if (ndata[i] != odata[i])
{ break; }
}
}
else
{ }
}
else
{ }
}
}
catch (Exception ex)
{
UpdateStatus("Error! " + ex.ToString());
}
}
}
}
public void TestPlacements()
{
//int totplacements = 0;

View File

@ -79,14 +79,7 @@ namespace CodeWalker.Forms
}
if (!string.IsNullOrEmpty(fxc.LastError))
{
StatusLabel.Text = fxc.LastError;
}
else
{
StatusLabel.Text = (fxc.Shaders?.Length??0).ToString() + " shaders, " + (fxc.Techniques?.Length??0).ToString() + " techniques";
}
StatusLabel.Text = (fxc.Shaders?.Length??0).ToString() + " shaders, " + (fxc.Techniques?.Length??0).ToString() + " techniques";
}