mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2026-05-15 00:44:49 +08:00
CacheDat/XML conversion
This commit is contained in:
@@ -219,6 +219,7 @@ namespace CodeWalker.GameFiles
|
||||
//TestMrfs();
|
||||
//TestPlacements();
|
||||
//TestDrawables();
|
||||
//TestCacheFiles();
|
||||
//TestHeightmaps();
|
||||
//TestWatermaps();
|
||||
//GetShadersXml();
|
||||
@@ -4954,6 +4955,49 @@ namespace CodeWalker.GameFiles
|
||||
UpdateStatus((DateTime.Now - starttime).ToString() + " elapsed, " + drawablecount.ToString() + " drawables, " + errs.Count.ToString() + " errors.");
|
||||
|
||||
}
|
||||
public void TestCacheFiles()
|
||||
{
|
||||
foreach (RpfFile file in AllRpfs)
|
||||
{
|
||||
foreach (RpfEntry entry in file.AllEntries)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (entry.NameLower.EndsWith("cache_y.dat"))// || entry.NameLower.EndsWith("cache_y_bank.dat"))
|
||||
{
|
||||
UpdateStatus(string.Format(entry.Path));
|
||||
var cdfile = RpfMan.GetFile<CacheDatFile>(entry);
|
||||
if (cdfile != null)
|
||||
{
|
||||
var odata = entry.File.ExtractFile(entry as RpfFileEntry);
|
||||
//var ndata = cdfile.Save();
|
||||
|
||||
var xml = CacheDatXml.GetXml(cdfile);
|
||||
var cdf2 = XmlCacheDat.GetCacheDat(xml);
|
||||
var ndata = cdf2.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 TestHeightmaps()
|
||||
{
|
||||
var errorfiles = new List<RpfEntry>();
|
||||
|
||||
Reference in New Issue
Block a user