mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2024-11-26 00:43:00 +08:00
Resolve MRF saving issues
Should now be able to save any MRF with no difference comparing to original files Remove debug dield from MrfFile
This commit is contained in:
parent
11eb44dbd6
commit
ca8eb31ae2
@ -579,8 +579,8 @@ namespace CodeWalker.GameFiles
|
||||
w.Write(Unk6);
|
||||
|
||||
// FIXME: might be broken if changed without flags, see "iterations"
|
||||
foreach (var item in Items)
|
||||
item.Write(w);
|
||||
for (int i = Items.Length - 1; i >= 0; i--)
|
||||
Items[i].Write(w);
|
||||
|
||||
// FIXME: might be broken if changed without flags
|
||||
uint flags = Unk1 & 0xFFFBFFFF;
|
||||
@ -699,20 +699,14 @@ namespace CodeWalker.GameFiles
|
||||
{
|
||||
Sections = new MrfStructStateMainSection[(int)count];
|
||||
|
||||
// FIXME: for-loop?
|
||||
while (true)
|
||||
{
|
||||
Sections[(int)count - 1] = new MrfStructStateMainSection(r);
|
||||
|
||||
if (--count == 0)
|
||||
return;
|
||||
}
|
||||
for (int i = (int)count - 1; i >= 0; i--)
|
||||
Sections[i] = new MrfStructStateMainSection(r);
|
||||
}
|
||||
|
||||
public override void Write(DataWriter w)
|
||||
{
|
||||
foreach (var section in Sections)
|
||||
section.Write(w);
|
||||
for (int i = Sections.Length - 1; i >= 0; i--)
|
||||
Sections[i].Write(w);
|
||||
}
|
||||
}
|
||||
|
||||
@ -816,8 +810,6 @@ namespace CodeWalker.GameFiles
|
||||
public MetaHash StateName { get; }
|
||||
public uint UnkValue { get; }
|
||||
|
||||
public MrfNodeStateInfo __StateInfoNode { get; set; }
|
||||
|
||||
public MrfStructStateMachineState(DataReader r)
|
||||
{
|
||||
StateName = new MetaHash(r.ReadUInt32());
|
||||
@ -1113,8 +1105,8 @@ namespace CodeWalker.GameFiles
|
||||
{
|
||||
Header.Write(w);
|
||||
|
||||
foreach (var item in States)
|
||||
item.Write(w);
|
||||
foreach (var state in States)
|
||||
state.Write(w);
|
||||
|
||||
if (Header.Unk7 != 0)
|
||||
Header_Unk7_Data.Write(w);
|
||||
|
Loading…
Reference in New Issue
Block a user