mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2024-11-26 08:52:52 +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);
|
w.Write(Unk6);
|
||||||
|
|
||||||
// FIXME: might be broken if changed without flags, see "iterations"
|
// FIXME: might be broken if changed without flags, see "iterations"
|
||||||
foreach (var item in Items)
|
for (int i = Items.Length - 1; i >= 0; i--)
|
||||||
item.Write(w);
|
Items[i].Write(w);
|
||||||
|
|
||||||
// FIXME: might be broken if changed without flags
|
// FIXME: might be broken if changed without flags
|
||||||
uint flags = Unk1 & 0xFFFBFFFF;
|
uint flags = Unk1 & 0xFFFBFFFF;
|
||||||
@ -699,20 +699,14 @@ namespace CodeWalker.GameFiles
|
|||||||
{
|
{
|
||||||
Sections = new MrfStructStateMainSection[(int)count];
|
Sections = new MrfStructStateMainSection[(int)count];
|
||||||
|
|
||||||
// FIXME: for-loop?
|
for (int i = (int)count - 1; i >= 0; i--)
|
||||||
while (true)
|
Sections[i] = new MrfStructStateMainSection(r);
|
||||||
{
|
|
||||||
Sections[(int)count - 1] = new MrfStructStateMainSection(r);
|
|
||||||
|
|
||||||
if (--count == 0)
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Write(DataWriter w)
|
public override void Write(DataWriter w)
|
||||||
{
|
{
|
||||||
foreach (var section in Sections)
|
for (int i = Sections.Length - 1; i >= 0; i--)
|
||||||
section.Write(w);
|
Sections[i].Write(w);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -816,8 +810,6 @@ namespace CodeWalker.GameFiles
|
|||||||
public MetaHash StateName { get; }
|
public MetaHash StateName { get; }
|
||||||
public uint UnkValue { get; }
|
public uint UnkValue { get; }
|
||||||
|
|
||||||
public MrfNodeStateInfo __StateInfoNode { get; set; }
|
|
||||||
|
|
||||||
public MrfStructStateMachineState(DataReader r)
|
public MrfStructStateMachineState(DataReader r)
|
||||||
{
|
{
|
||||||
StateName = new MetaHash(r.ReadUInt32());
|
StateName = new MetaHash(r.ReadUInt32());
|
||||||
@ -1113,8 +1105,8 @@ namespace CodeWalker.GameFiles
|
|||||||
{
|
{
|
||||||
Header.Write(w);
|
Header.Write(w);
|
||||||
|
|
||||||
foreach (var item in States)
|
foreach (var state in States)
|
||||||
item.Write(w);
|
state.Write(w);
|
||||||
|
|
||||||
if (Header.Unk7 != 0)
|
if (Header.Unk7 != 0)
|
||||||
Header_Unk7_Data.Write(w);
|
Header_Unk7_Data.Write(w);
|
||||||
|
Loading…
Reference in New Issue
Block a user