Support YPDB files

This commit is contained in:
alexguirre
2022-02-23 23:28:47 +01:00
Unverified
parent 8998b8c808
commit 59b4850371
4 changed files with 326 additions and 0 deletions
@@ -215,6 +215,7 @@ namespace CodeWalker.GameFiles
//TestYvrs();
//TestYwrs();
//TestYmaps();
//TestYpdbs();
//TestMrfs();
//TestPlacements();
//TestDrawables();
@@ -4526,6 +4527,48 @@ namespace CodeWalker.GameFiles
}
}
}
public void TestYpdbs()
{
foreach (RpfFile file in AllRpfs)
{
foreach (RpfEntry entry in file.AllEntries)
{
var rfe = entry as RpfFileEntry;
if (rfe == null) continue;
try
{
if (rfe.NameLower.EndsWith(".ypdb"))
{
UpdateStatus(string.Format(entry.Path));
YpdbFile ypdb = RpfMan.GetFile<YpdbFile>(entry);
if (ypdb != null)
{
var odata = entry.File.ExtractFile(entry as RpfFileEntry);
var ndata = ypdb.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 TestMrfs()
{
foreach (RpfFile file in AllRpfs)