mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2024-11-22 23:12:59 +08:00
commit
e81b716dd1
2700
CodeWalker.Core/GameFiles/FileTypes/MrfFile.cs
Normal file
2700
CodeWalker.Core/GameFiles/FileTypes/MrfFile.cs
Normal file
File diff suppressed because it is too large
Load Diff
@ -82,6 +82,7 @@ namespace CodeWalker.GameFiles
|
|||||||
Yfd = 26,
|
Yfd = 26,
|
||||||
Heightmap = 27,
|
Heightmap = 27,
|
||||||
Watermap = 28,
|
Watermap = 28,
|
||||||
|
Mrf = 29,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -197,6 +197,7 @@ namespace CodeWalker.GameFiles
|
|||||||
//TestYpts();
|
//TestYpts();
|
||||||
//TestYnvs();
|
//TestYnvs();
|
||||||
//TestYmaps();
|
//TestYmaps();
|
||||||
|
//TestMrfs();
|
||||||
//TestPlacements();
|
//TestPlacements();
|
||||||
//TestDrawables();
|
//TestDrawables();
|
||||||
//TestHeightmaps();
|
//TestHeightmaps();
|
||||||
@ -4179,6 +4180,29 @@ namespace CodeWalker.GameFiles
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public void TestMrfs()
|
||||||
|
{
|
||||||
|
foreach (RpfFile file in AllRpfs)
|
||||||
|
{
|
||||||
|
foreach (RpfEntry entry in file.AllEntries)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (entry.NameLower.EndsWith(".mrf"))
|
||||||
|
{
|
||||||
|
UpdateStatus(string.Format(entry.Path));
|
||||||
|
MrfFile mrffile = RpfMan.GetFile<MrfFile>(entry);
|
||||||
|
if (mrffile != null)
|
||||||
|
{ }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
UpdateStatus("Error! " + ex.ToString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
public void TestPlacements()
|
public void TestPlacements()
|
||||||
{
|
{
|
||||||
//int totplacements = 0;
|
//int totplacements = 0;
|
||||||
|
@ -297,7 +297,7 @@ namespace CodeWalker
|
|||||||
InitFileType(".png", "Portable Network Graphics", 16);
|
InitFileType(".png", "Portable Network Graphics", 16);
|
||||||
InitFileType(".dds", "DirectDraw Surface", 16);
|
InitFileType(".dds", "DirectDraw Surface", 16);
|
||||||
InitFileType(".ytd", "Texture Dictionary", 16, FileTypeAction.ViewYtd, true);
|
InitFileType(".ytd", "Texture Dictionary", 16, FileTypeAction.ViewYtd, true);
|
||||||
InitFileType(".mrf", "MRF File", 18);
|
InitFileType(".mrf", "Move Network File", 18, FileTypeAction.ViewMrf);
|
||||||
InitFileType(".ycd", "Clip Dictionary", 18, FileTypeAction.ViewYcd, true);
|
InitFileType(".ycd", "Clip Dictionary", 18, FileTypeAction.ViewYcd, true);
|
||||||
InitFileType(".ypt", "Particle Effect", 18, FileTypeAction.ViewModel, true);
|
InitFileType(".ypt", "Particle Effect", 18, FileTypeAction.ViewModel, true);
|
||||||
InitFileType(".ybn", "Static Collisions", 19, FileTypeAction.ViewModel, true);
|
InitFileType(".ybn", "Static Collisions", 19, FileTypeAction.ViewModel, true);
|
||||||
@ -1401,6 +1401,7 @@ namespace CodeWalker
|
|||||||
case FileTypeAction.ViewYld:
|
case FileTypeAction.ViewYld:
|
||||||
case FileTypeAction.ViewYfd:
|
case FileTypeAction.ViewYfd:
|
||||||
case FileTypeAction.ViewHeightmap:
|
case FileTypeAction.ViewHeightmap:
|
||||||
|
case FileTypeAction.ViewMrf:
|
||||||
return true;
|
return true;
|
||||||
case FileTypeAction.ViewHex:
|
case FileTypeAction.ViewHex:
|
||||||
default:
|
default:
|
||||||
@ -1530,6 +1531,9 @@ namespace CodeWalker
|
|||||||
case FileTypeAction.ViewHeightmap:
|
case FileTypeAction.ViewHeightmap:
|
||||||
ViewHeightmap(name, path, data, fe);
|
ViewHeightmap(name, path, data, fe);
|
||||||
break;
|
break;
|
||||||
|
case FileTypeAction.ViewMrf:
|
||||||
|
ViewMrf(name, path, data, fe);
|
||||||
|
break;
|
||||||
case FileTypeAction.ViewHex:
|
case FileTypeAction.ViewHex:
|
||||||
default:
|
default:
|
||||||
ViewHex(name, path, data);
|
ViewHex(name, path, data);
|
||||||
@ -1771,7 +1775,13 @@ namespace CodeWalker
|
|||||||
f.Show();
|
f.Show();
|
||||||
f.LoadMeta(heightmap);
|
f.LoadMeta(heightmap);
|
||||||
}
|
}
|
||||||
|
private void ViewMrf(string name, string path, byte[] data, RpfFileEntry e)
|
||||||
|
{
|
||||||
|
var mrf = RpfFile.GetFile<MrfFile>(e, data);
|
||||||
|
GenericForm f = new GenericForm(this);
|
||||||
|
f.Show();
|
||||||
|
f.LoadFile(mrf, mrf.RpfFileEntry);
|
||||||
|
}
|
||||||
private RpfFileEntry CreateFileEntry(string name, string path, ref byte[] data)
|
private RpfFileEntry CreateFileEntry(string name, string path, ref byte[] data)
|
||||||
{
|
{
|
||||||
//this should only really be used when loading a file from the filesystem.
|
//this should only really be used when loading a file from the filesystem.
|
||||||
@ -4693,6 +4703,7 @@ namespace CodeWalker
|
|||||||
ViewYld = 21,
|
ViewYld = 21,
|
||||||
ViewYfd = 22,
|
ViewYfd = 22,
|
||||||
ViewHeightmap = 23,
|
ViewHeightmap = 23,
|
||||||
|
ViewMrf = 24,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user