New MetaNames, Fragments glass windows progress, Renaming some things in Skeleton and Bone

This commit is contained in:
dexy 2019-11-05 20:47:10 +11:00
parent 8335fd065c
commit 4cc780a461
12 changed files with 647 additions and 379 deletions

View File

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Text;
@ -7,6 +8,7 @@ using System.Threading.Tasks;
namespace CodeWalker.GameFiles
{
[TypeConverter(typeof(ExpandableObjectConverter))]
public class YftFile : GameFile, PackedFile
{
public FragType Fragment { get; set; }
@ -33,13 +35,18 @@ namespace CodeWalker.GameFiles
Fragment = rd.ReadBlock<FragType>();
if (Fragment.Drawable != null)
if (Fragment != null)
{
Fragment.Drawable.Owner = this;
}
if (Fragment.Drawable2 != null)
{
Fragment.Drawable2.Owner = this;
Fragment.Yft = this;
if (Fragment.Drawable != null)
{
Fragment.Drawable.Owner = this;
}
if (Fragment.Drawable2 != null)
{
Fragment.Drawable2.Owner = this;
}
}
Loaded = true;

View File

@ -3536,9 +3536,9 @@ namespace CodeWalker.GameFiles
}
}
}
if ((yft.Fragment.Unknown_28h_Data != null) && (yft.Fragment.Unknown_28h_Data.data_items != null))
if ((yft.Fragment.DrawableArray != null) && (yft.Fragment.DrawableArray.data_items != null))
{
foreach (var drawable in yft.Fragment.Unknown_28h_Data.data_items)
foreach (var drawable in yft.Fragment.DrawableArray.data_items)
{
drawablecount++;
foreach (var kvp in drawable.VertexDecls)

View File

@ -3464,11 +3464,14 @@ namespace CodeWalker.GameFiles
FloatXYZ = 3805007828,
aPropMetaData = 3902803273,
ePedVarComp = 884254308,
ePropRenderFlags = 4212977111,
CPedPropTexData = 254518642,
CScenarioChainingEdge__eAction = 3609807418,
CScenarioChainingEdge__eNavMode = 3971773454,
CScenarioChainingEdge__eNavSpeed = 941086046,

View File

@ -411,9 +411,9 @@ namespace CodeWalker.GameFiles
return new MetaStructureInfo(MetaName.CScenarioChainingEdge, 2004985940, 256, 8,
new MetaStructureEntryInfo_s(MetaName.NodeIndexFrom, 0, MetaStructureEntryDataType.UnsignedShort, 0, 0, 0),
new MetaStructureEntryInfo_s(MetaName.NodeIndexTo, 2, MetaStructureEntryDataType.UnsignedShort, 0, 0, 0),
new MetaStructureEntryInfo_s(MetaName.Action, 4, MetaStructureEntryDataType.ByteEnum, 0, 0, (MetaName)3609807418),
new MetaStructureEntryInfo_s(MetaName.NavMode, 5, MetaStructureEntryDataType.ByteEnum, 0, 0, (MetaName)3971773454),
new MetaStructureEntryInfo_s(MetaName.NavSpeed, 6, MetaStructureEntryDataType.ByteEnum, 0, 0, (MetaName)941086046)
new MetaStructureEntryInfo_s(MetaName.Action, 4, MetaStructureEntryDataType.ByteEnum, 0, 0, MetaName.CScenarioChainingEdge__eAction),
new MetaStructureEntryInfo_s(MetaName.NavMode, 5, MetaStructureEntryDataType.ByteEnum, 0, 0, MetaName.CScenarioChainingEdge__eNavMode),
new MetaStructureEntryInfo_s(MetaName.NavSpeed, 6, MetaStructureEntryDataType.ByteEnum, 0, 0, MetaName.CScenarioChainingEdge__eNavSpeed)
);
case MetaName.CScenarioChain:
return new MetaStructureInfo(MetaName.CScenarioChain, 2751910366, 768, 40,
@ -1011,7 +1011,7 @@ namespace CodeWalker.GameFiles
return new MetaStructureInfo(MetaName.CPedPropInfo, 1792487819, 768, 40,
new MetaStructureEntryInfo_s((MetaName)2598445407, 0, MetaStructureEntryDataType.UnsignedByte, 0, 0, 0),
new MetaStructureEntryInfo_s((MetaName)MetaTypeName.ARRAYINFO, 0, MetaStructureEntryDataType.Structure, 0, 0, MetaName.CPedPropMetaData),
new MetaStructureEntryInfo_s((MetaName)3902803273, 8, MetaStructureEntryDataType.Array, 0, 1, 0),
new MetaStructureEntryInfo_s(MetaName.aPropMetaData, 8, MetaStructureEntryDataType.Array, 0, 1, 0),
new MetaStructureEntryInfo_s((MetaName)MetaTypeName.ARRAYINFO, 0, MetaStructureEntryDataType.Structure, 0, 0, MetaName.CAnchorProps),
new MetaStructureEntryInfo_s(MetaName.aAnchors, 24, MetaStructureEntryDataType.Array, 0, 3, 0)
);
@ -1064,7 +1064,7 @@ namespace CodeWalker.GameFiles
new MetaStructureEntryInfo_s(MetaName.flags, 28, MetaStructureEntryDataType.UnsignedInt, 0, 0, 0),
new MetaStructureEntryInfo_s(MetaName.inclusions, 32, MetaStructureEntryDataType.IntFlags2, 0, 32, 0),
new MetaStructureEntryInfo_s(MetaName.exclusions, 36, MetaStructureEntryDataType.IntFlags2, 0, 32, 0),
new MetaStructureEntryInfo_s((MetaName)1613922652, 40, MetaStructureEntryDataType.ShortFlags, 0, 16, (MetaName)884254308),
new MetaStructureEntryInfo_s((MetaName)1613922652, 40, MetaStructureEntryDataType.ShortFlags, 0, 16, MetaName.ePedVarComp),
new MetaStructureEntryInfo_s((MetaName)2114993291, 42, MetaStructureEntryDataType.UnsignedShort, 0, 0, 0),
new MetaStructureEntryInfo_s((MetaName)3509540765, 44, MetaStructureEntryDataType.UnsignedByte, 0, 0, 0),
new MetaStructureEntryInfo_s((MetaName)4196345791, 45, MetaStructureEntryDataType.UnsignedByte, 0, 0, 0)
@ -1074,17 +1074,17 @@ namespace CodeWalker.GameFiles
new MetaStructureEntryInfo_s(MetaName.audioId, 0, MetaStructureEntryDataType.Hash, 0, 0, 0),
new MetaStructureEntryInfo_s((MetaName)MetaTypeName.ARRAYINFO, 0, MetaStructureEntryDataType.Float, 0, 0, 0),
new MetaStructureEntryInfo_s(MetaName.expressionMods, 4, MetaStructureEntryDataType.ArrayOfBytes, 0, 1, (MetaName)5),
new MetaStructureEntryInfo_s((MetaName)MetaTypeName.ARRAYINFO, 0, MetaStructureEntryDataType.Structure, 0, 0, (MetaName)254518642),
new MetaStructureEntryInfo_s((MetaName)MetaTypeName.ARRAYINFO, 0, MetaStructureEntryDataType.Structure, 0, 0, MetaName.CPedPropTexData),
new MetaStructureEntryInfo_s(MetaName.texData, 24, MetaStructureEntryDataType.Array, 0, 3, 0),
new MetaStructureEntryInfo_s(MetaName.renderFlags, 40, MetaStructureEntryDataType.IntFlags1, 0, 3, (MetaName)4212977111),
new MetaStructureEntryInfo_s(MetaName.renderFlags, 40, MetaStructureEntryDataType.IntFlags1, 0, 3, MetaName.ePropRenderFlags),
new MetaStructureEntryInfo_s(MetaName.propFlags, 44, MetaStructureEntryDataType.UnsignedInt, 0, 0, 0),
new MetaStructureEntryInfo_s(MetaName.flags, 48, MetaStructureEntryDataType.UnsignedShort, 0, 0, 0),
new MetaStructureEntryInfo_s(MetaName.anchorId, 50, MetaStructureEntryDataType.UnsignedByte, 0, 0, 0),
new MetaStructureEntryInfo_s(MetaName.propId, 51, MetaStructureEntryDataType.UnsignedByte, 0, 0, 0),
new MetaStructureEntryInfo_s((MetaName)2894625425, 52, MetaStructureEntryDataType.UnsignedByte, 0, 0, 0)
);
case (MetaName)254518642:
return new MetaStructureInfo((MetaName)254518642, 2767296137, 512, 12,
case MetaName.CPedPropTexData:
return new MetaStructureInfo(MetaName.CPedPropTexData, 2767296137, 512, 12,
new MetaStructureEntryInfo_s(MetaName.inclusions, 0, MetaStructureEntryDataType.IntFlags2, 0, 32, 0),
new MetaStructureEntryInfo_s(MetaName.exclusions, 4, MetaStructureEntryDataType.IntFlags2, 0, 32, 0),
new MetaStructureEntryInfo_s(MetaName.texId, 8, MetaStructureEntryDataType.UnsignedByte, 0, 0, 0),
@ -1285,20 +1285,20 @@ namespace CodeWalker.GameFiles
new MetaEnumEntryInfo_s(MetaName.kOnlySp, 1),
new MetaEnumEntryInfo_s(MetaName.kOnlyMp, 2)
);
case (MetaName)3609807418:
return new MetaEnumInfo((MetaName)3609807418, 3326075799,
case MetaName.CScenarioChainingEdge__eAction:
return new MetaEnumInfo(MetaName.CScenarioChainingEdge__eAction, 3326075799,
new MetaEnumEntryInfo_s(MetaName.Move, 0),
new MetaEnumEntryInfo_s((MetaName)7865678, 1),
new MetaEnumEntryInfo_s(MetaName.MoveFollowMaster, 2)
);
case (MetaName)3971773454:
return new MetaEnumInfo((MetaName)3971773454, 3016128742,
case MetaName.CScenarioChainingEdge__eNavMode:
return new MetaEnumInfo(MetaName.CScenarioChainingEdge__eNavMode, 3016128742,
new MetaEnumEntryInfo_s(MetaName.Direct, 0),
new MetaEnumEntryInfo_s(MetaName.NavMesh, 1),
new MetaEnumEntryInfo_s(MetaName.Roads, 2)
);
case (MetaName)941086046:
return new MetaEnumInfo((MetaName)941086046, 1112851290,
case MetaName.CScenarioChainingEdge__eNavSpeed:
return new MetaEnumInfo(MetaName.CScenarioChainingEdge__eNavSpeed, 1112851290,
new MetaEnumEntryInfo_s((MetaName)3279574318, 0),
new MetaEnumEntryInfo_s((MetaName)2212923970, 1),
new MetaEnumEntryInfo_s((MetaName)4022799658, 2),
@ -1363,8 +1363,8 @@ namespace CodeWalker.GameFiles
new MetaEnumEntryInfo_s((MetaName)665241531, 0),
new MetaEnumEntryInfo_s((MetaName)462992848, 1)
);
case (MetaName)884254308:
return new MetaEnumInfo((MetaName)884254308, 3472084374,
case MetaName.ePedVarComp:
return new MetaEnumInfo(MetaName.ePedVarComp, 3472084374,
new MetaEnumEntryInfo_s(MetaName.PV_COMP_INVALID, -1),
new MetaEnumEntryInfo_s(MetaName.PV_COMP_HEAD, 0),
new MetaEnumEntryInfo_s(MetaName.PV_COMP_BERD, 1),
@ -1380,8 +1380,8 @@ namespace CodeWalker.GameFiles
new MetaEnumEntryInfo_s(MetaName.PV_COMP_JBIB, 11),
new MetaEnumEntryInfo_s(MetaName.PV_COMP_MAX, 12)
);
case (MetaName)4212977111:
return new MetaEnumInfo((MetaName)4212977111, 1551913633,
case MetaName.ePropRenderFlags:
return new MetaEnumInfo(MetaName.ePropRenderFlags, 1551913633,
new MetaEnumEntryInfo_s((MetaName)3757767268, 0),
new MetaEnumEntryInfo_s((MetaName)3735238938, 1),
new MetaEnumEntryInfo_s((MetaName)3395845123, 2)
@ -2141,7 +2141,7 @@ namespace CodeWalker.GameFiles
kOnlyMp = 2,
}
public enum Unk_3609807418 //SCENARIO (Path) Edge Action
public enum CScenarioChainingEdge__eAction //SCENARIO (Path) Edge Action
: byte //Key:3326075799
{
Move = 0,
@ -2149,7 +2149,7 @@ namespace CodeWalker.GameFiles
MoveFollowMaster = 2,
}
public enum Unk_3971773454 //SCENARIO (Path) Edge nav mode
public enum CScenarioChainingEdge__eNavMode //SCENARIO (Path) Edge nav mode
: byte //Key:3016128742
{
Direct = 0,
@ -2157,7 +2157,7 @@ namespace CodeWalker.GameFiles
Roads = 2,
}
public enum Unk_941086046 //SCENARIO (Path) Edge nav speed
public enum CScenarioChainingEdge__eNavSpeed //SCENARIO (Path) Edge nav speed
: byte //Key:1112851290
{
Unk_00_3279574318 = 0,
@ -2237,7 +2237,7 @@ namespace CodeWalker.GameFiles
Unk_462992848 = 1,
}
public enum Unk_884254308 //component peds CComponentInfo ped accessory / variations slot
public enum ePedVarComp //component peds CComponentInfo ped accessory / variations slot
: short //Key:3472084374
{
PV_COMP_INVALID = -1,
@ -2256,7 +2256,7 @@ namespace CodeWalker.GameFiles
PV_COMP_MAX = 2048,//12,
}
public enum Unk_4212977111 //component peds CPedPropMetaData renderFlags
public enum ePropRenderFlags //component peds CPedPropMetaData renderFlags
: int //Key:1551913633
{
Unk_3757767268 = 0,
@ -4300,9 +4300,9 @@ namespace CodeWalker.GameFiles
if (edges != null)
{
mb.AddStructureInfo(MetaName.CScenarioChainingEdge);
mb.AddEnumInfo((MetaName)3609807418);
mb.AddEnumInfo((MetaName)3971773454);
mb.AddEnumInfo((MetaName)941086046);
mb.AddEnumInfo(MetaName.CScenarioChainingEdge__eAction);
mb.AddEnumInfo(MetaName.CScenarioChainingEdge__eNavMode);
mb.AddEnumInfo(MetaName.CScenarioChainingEdge__eNavSpeed);
pd.Edges = mb.AddItemArrayPtr(MetaName.CScenarioChainingEdge, edges);
}
if (Paths.Chains != null)
@ -5380,9 +5380,9 @@ namespace CodeWalker.GameFiles
{
public ushort NodeIndexFrom { get; set; } //0 0: UnsignedShort: 0: NodeIndexFrom//3236798246
public ushort NodeIndexTo { get; set; } //2 2: UnsignedShort: 0: NodeIndexTo//2851806039
public Unk_3609807418 Action { get; set; } //4 4: ByteEnum: 3609807418: Action
public Unk_3971773454 NavMode { get; set; } //5 5: ByteEnum: 3971773454: NavMode//859022269
public Unk_941086046 NavSpeed { get; set; } //6 6: ByteEnum: 941086046: NavSpeed//1419316113
public CScenarioChainingEdge__eAction Action { get; set; } //4 4: ByteEnum: CScenarioChainingEdge__eAction: Action
public CScenarioChainingEdge__eNavMode NavMode { get; set; } //5 5: ByteEnum: CScenarioChainingEdge__eNavMode: NavMode
public CScenarioChainingEdge__eNavSpeed NavSpeed { get; set; } //6 6: ByteEnum: CScenarioChainingEdge__eNavSpeed: NavSpeed
public byte Unused0 { get; set; }//7
public override string ToString()
@ -5401,9 +5401,9 @@ namespace CodeWalker.GameFiles
public MCScenarioChainingNode NodeTo { get; set; }
public ushort NodeIndexFrom { get { return _Data.NodeIndexFrom; } set { _Data.NodeIndexFrom = value; } }
public ushort NodeIndexTo { get { return _Data.NodeIndexTo; } set { _Data.NodeIndexTo = value; } }
public Unk_3609807418 Action { get { return _Data.Action; } set { _Data.Action = value; } }
public Unk_3971773454 NavMode { get { return _Data.NavMode; } set { _Data.NavMode = value; } }
public Unk_941086046 NavSpeed { get { return _Data.NavSpeed; } set { _Data.NavSpeed = value; } }
public CScenarioChainingEdge__eAction Action { get { return _Data.Action; } set { _Data.Action = value; } }
public CScenarioChainingEdge__eNavMode NavMode { get { return _Data.NavMode; } set { _Data.NavMode = value; } }
public CScenarioChainingEdge__eNavSpeed NavSpeed { get { return _Data.NavSpeed; } set { _Data.NavSpeed = value; } }
public int EdgeIndex { get; set; }
@ -6067,7 +6067,7 @@ namespace CodeWalker.GameFiles
public uint flags { get; set; } //28 28: UnsignedInt: 0: flags
public int inclusions { get; set; } //32 32: IntFlags2: 0: inclusions//2172318933
public int exclusions { get; set; } //36 36: IntFlags2: 0: exclusions
public Unk_884254308 Unk_1613922652 { get; set; } //40 40: ShortFlags: 884254308: 1613922652
public ePedVarComp Unk_1613922652 { get; set; } //40 40: ShortFlags: ePedVarComp: 1613922652
public ushort Unk_2114993291 { get; set; } //42 42: UnsignedShort: 0: 2114993291
public byte Unk_3509540765 { get; set; } //44 44: UnsignedByte: 0: 3509540765
public byte Unk_4196345791 { get; set; } //45 45: UnsignedByte: 0: 4196345791
@ -6080,11 +6080,11 @@ namespace CodeWalker.GameFiles
public byte Unused0 { get; set; }//1
public ushort Unused1 { get; set; }//2
public uint Unused2 { get; set; }//4
public Array_Structure Unk_3902803273 { get; set; } //8 8: Array: 0: 3902803273 {0: Structure: 94549140: 256}
public Array_Structure aAnchors { get; set; } //24 24: Array: 0: aAnchors//162345210 {0: Structure: CAnchorProps//2170383875: 256}
public Array_Structure aPropMetaData { get; set; } //8 8: Array: 0: aPropMetaData {0: Structure: CPedPropMetaData: 256}
public Array_Structure aAnchors { get; set; } //24 24: Array: 0: aAnchors {0: Structure: CAnchorProps: 256}
}
public struct CPedPropMetaData //56 bytes, Key:2029738350 //COMPONENT PEDS unknown
public struct CPedPropMetaData //56 bytes, Key:2029738350 //COMPONENT PEDS prop metadata
{
public MetaHash audioId { get; set; } //0 0: Hash: 0: audioId
public ArrayOfBytes5 expressionMods { get; set; } //4 4: ArrayOfBytes: 5: expressionMods//942761829
@ -6093,25 +6093,25 @@ namespace CodeWalker.GameFiles
public uint Unused2 { get; set; }//12
public uint Unused3 { get; set; }//16
public uint Unused4 { get; set; }//20
public Array_Structure texData { get; set; } //24 24: Array: 0: texData//4088935562 {0: Structure: 254518642: 256}
public Unk_4212977111 renderFlags { get; set; } //40 40: IntFlags1: 4212977111: renderFlags//4239582912
public uint propFlags { get; set; } //44 44: UnsignedInt: 0: propFlags//1066841901
public Array_Structure texData { get; set; } //24 24: Array: 0: texData {0: Structure: CPedPropTexData: 256}
public ePropRenderFlags renderFlags { get; set; } //40 40: IntFlags1: ePropRenderFlags: renderFlags
public uint propFlags { get; set; } //44 44: UnsignedInt: 0: propFlags
public ushort flags { get; set; } //48 48: UnsignedShort: 0: flags
public byte anchorId { get; set; } //50 50: UnsignedByte: 0: anchorId//2731224028
public byte propId { get; set; } //51 51: UnsignedByte: 0: propId//3817142252
public byte anchorId { get; set; } //50 50: UnsignedByte: 0: anchorId
public byte propId { get; set; } //51 51: UnsignedByte: 0: propId
public byte Unk_2894625425 { get; set; } //52 52: UnsignedByte: 0: 2894625425
public byte Unused5 { get; set; }//53
public ushort Unused6 { get; set; }//54
}
public struct Unk_254518642 //12 bytes, Key:2767296137 //COMPONENT PEDS (expression?) texData
public struct CPedPropTexData //12 bytes, Key:2767296137 //COMPONENT PEDS prop texData
{
public int inclusions { get; set; } //0 0: IntFlags2: 0: inclusions//2172318933
public int inclusions { get; set; } //0 0: IntFlags2: 0: inclusions
public int exclusions { get; set; } //4 4: IntFlags2: 0: exclusions
public byte texId { get; set; } //8 8: UnsignedByte: 0: texId
public byte inclusionId { get; set; } //9 9: UnsignedByte: 0: inclusionId//1938349561
public byte exclusionId { get; set; } //10 10: UnsignedByte: 0: exclusionId//3819522186
public byte distribution { get; set; } //11 11: UnsignedByte: 0: distribution//914976023
public byte inclusionId { get; set; } //9 9: UnsignedByte: 0: inclusionId
public byte exclusionId { get; set; } //10 10: UnsignedByte: 0: exclusionId
public byte distribution { get; set; } //11 11: UnsignedByte: 0: distribution
}
public struct CAnchorProps //24 bytes, Key:403574180 //COMPONENT PEDS CAnchorProps

View File

@ -9023,13 +9023,13 @@ namespace CodeWalker.GameFiles
);
case (MetaName)2354064210:
return new PsoStructureInfo((MetaName)2354064210, 0, 0, 24,
new PsoStructureEntryInfo(MetaName.Component, PsoDataType.Enum, 8, 0, (MetaName)884254308),
new PsoStructureEntryInfo(MetaName.Component, PsoDataType.Enum, 8, 0, MetaName.ePedVarComp),
new PsoStructureEntryInfo(MetaName.DrawableId, PsoDataType.UInt, 12, 0, 0),
new PsoStructureEntryInfo(MetaName.DrawableAltId, PsoDataType.UInt, 16, 0, 0)
);
case (MetaName)2469984956:
return new PsoStructureInfo((MetaName)2469984956, 0, 0, 32,
new PsoStructureEntryInfo(MetaName.Component, PsoDataType.Enum, 8, 0, (MetaName)884254308),
new PsoStructureEntryInfo(MetaName.Component, PsoDataType.Enum, 8, 0, MetaName.ePedVarComp),
new PsoStructureEntryInfo((MetaName)MetaTypeName.ARRAYINFO, PsoDataType.UInt, 0, 0, 0),
new PsoStructureEntryInfo(MetaName.DrawableIds, PsoDataType.Array, 16, 0, (MetaName)1)
);
@ -9697,14 +9697,14 @@ namespace CodeWalker.GameFiles
);
case (MetaName)3901274641:
return new PsoStructureInfo((MetaName)3901274641, 0, 0, 24,
new PsoStructureEntryInfo(MetaName.Component, PsoDataType.Enum, 8, 0, (MetaName)884254308),
new PsoStructureEntryInfo(MetaName.Component, PsoDataType.Enum, 8, 0, MetaName.ePedVarComp),
new PsoStructureEntryInfo(MetaName.DrawableId, PsoDataType.UInt, 12, 0, 0),
new PsoStructureEntryInfo(MetaName.DrawableAltId, PsoDataType.UInt, 16, 0, 0),
new PsoStructureEntryInfo(MetaName.TexId, PsoDataType.UInt, 20, 0, 0)
);
case (MetaName)3788247444:
return new PsoStructureInfo((MetaName)3788247444, 0, 0, 32,
new PsoStructureEntryInfo(MetaName.Component, PsoDataType.Enum, 8, 0, (MetaName)884254308),
new PsoStructureEntryInfo(MetaName.Component, PsoDataType.Enum, 8, 0, MetaName.ePedVarComp),
new PsoStructureEntryInfo((MetaName)MetaTypeName.ARRAYINFO, PsoDataType.UInt, 0, 0, 0),
new PsoStructureEntryInfo(MetaName.DrawableIds, PsoDataType.Array, 16, 0, (MetaName)1)
);
@ -13062,7 +13062,7 @@ namespace CodeWalker.GameFiles
);
case (MetaName)3553377863:
return new PsoStructureInfo((MetaName)3553377863, 0, 0, 12,
new PsoStructureEntryInfo(MetaName.Component, PsoDataType.Enum, 0, 0, (MetaName)884254308),
new PsoStructureEntryInfo(MetaName.Component, PsoDataType.Enum, 0, 0, MetaName.ePedVarComp),
new PsoStructureEntryInfo(MetaName.DrawableIndex, PsoDataType.SInt, 4, 0, 0),
new PsoStructureEntryInfo(MetaName.Restriction, PsoDataType.Enum, 8, 0, (MetaName)2065671281)
);
@ -13207,8 +13207,8 @@ namespace CodeWalker.GameFiles
return new PsoStructureInfo(MetaName.CScenarioChainingEdge, 0, 0, 16,
new PsoStructureEntryInfo(MetaName.NodeIndexFrom, PsoDataType.UShort, 8, 0, 0),
new PsoStructureEntryInfo(MetaName.NodeIndexTo, PsoDataType.UShort, 10, 0, 0),
new PsoStructureEntryInfo(MetaName.NavMode, PsoDataType.Enum, 12, 2, (MetaName)3971773454),
new PsoStructureEntryInfo(MetaName.NavSpeed, PsoDataType.Enum, 13, 2, (MetaName)941086046)
new PsoStructureEntryInfo(MetaName.NavMode, PsoDataType.Enum, 12, 2, MetaName.CScenarioChainingEdge__eNavMode),
new PsoStructureEntryInfo(MetaName.NavSpeed, PsoDataType.Enum, 13, 2, MetaName.CScenarioChainingEdge__eNavSpeed)
);
case MetaName.CPedVariationInfo:
return new PsoStructureInfo(MetaName.CPedVariationInfo, 0, 0, 112,
@ -13231,7 +13231,7 @@ namespace CodeWalker.GameFiles
return new PsoStructureInfo(MetaName.CPedPropInfo, 0, 0, 40,
new PsoStructureEntryInfo((MetaName)2598445407, PsoDataType.UByte, 0, 0, 0),
new PsoStructureEntryInfo((MetaName)MetaTypeName.ARRAYINFO, PsoDataType.Structure, 0, 0, MetaName.CPedPropMetaData),
new PsoStructureEntryInfo((MetaName)3902803273, PsoDataType.Array, 8, 0, (MetaName)1),
new PsoStructureEntryInfo(MetaName.aPropMetaData, PsoDataType.Array, 8, 0, (MetaName)1),
new PsoStructureEntryInfo((MetaName)MetaTypeName.ARRAYINFO, PsoDataType.Structure, 0, 0, MetaName.CAnchorProps),
new PsoStructureEntryInfo(MetaName.aAnchors, PsoDataType.Array, 24, 0, (MetaName)3)
);
@ -13267,7 +13267,7 @@ namespace CodeWalker.GameFiles
new PsoStructureEntryInfo(MetaName.flags, PsoDataType.UInt, 28, 0, 0),
new PsoStructureEntryInfo(MetaName.inclusions, PsoDataType.Flags, 32, 0, (MetaName)2101247),
new PsoStructureEntryInfo(MetaName.exclusions, PsoDataType.Flags, 36, 0, (MetaName)2101247),
new PsoStructureEntryInfo((MetaName)MetaTypeName.ARRAYINFO, PsoDataType.Enum, 0, 0, (MetaName)884254308),
new PsoStructureEntryInfo((MetaName)MetaTypeName.ARRAYINFO, PsoDataType.Enum, 0, 0, MetaName.ePedVarComp),
new PsoStructureEntryInfo((MetaName)1613922652, PsoDataType.Flags, 40, 1, (MetaName)1048583),
new PsoStructureEntryInfo((MetaName)2114993291, PsoDataType.UShort, 42, 0, 0),
new PsoStructureEntryInfo((MetaName)3509540765, PsoDataType.UByte, 44, 0, 0),
@ -15540,8 +15540,8 @@ namespace CodeWalker.GameFiles
new PsoEnumEntryInfo((MetaName)3999177563, 1),
new PsoEnumEntryInfo((MetaName)3250863043, 2)
);
case (MetaName)884254308:
return new PsoEnumInfo((MetaName)884254308, 1,
case MetaName.ePedVarComp:
return new PsoEnumInfo(MetaName.ePedVarComp, 1,
new PsoEnumEntryInfo(MetaName.PV_COMP_INVALID, -1),
new PsoEnumEntryInfo(MetaName.PV_COMP_HEAD, 0),
new PsoEnumEntryInfo(MetaName.PV_COMP_BERD, 1),
@ -15741,14 +15741,14 @@ namespace CodeWalker.GameFiles
new PsoEnumEntryInfo(MetaName.NoSpawn, 1),
new PsoEnumEntryInfo(MetaName.StationaryReactions, 2)
);
case (MetaName)3971773454:
return new PsoEnumInfo((MetaName)3971773454, 1,
case MetaName.CScenarioChainingEdge__eNavMode:
return new PsoEnumInfo(MetaName.CScenarioChainingEdge__eNavMode, 1,
new PsoEnumEntryInfo(MetaName.Direct, 0),
new PsoEnumEntryInfo(MetaName.NavMesh, 1),
new PsoEnumEntryInfo(MetaName.Roads, 2)
);
case (MetaName)941086046:
return new PsoEnumInfo((MetaName)941086046, 1,
case MetaName.CScenarioChainingEdge__eNavSpeed:
return new PsoEnumInfo(MetaName.CScenarioChainingEdge__eNavSpeed, 1,
new PsoEnumEntryInfo((MetaName)3279574318, 0),
new PsoEnumEntryInfo((MetaName)2212923970, 1),
new PsoEnumEntryInfo((MetaName)4022799658, 2),

View File

@ -513,15 +513,15 @@ namespace CodeWalker.GameFiles
public uint Unknown_4h { get; set; } // 0x00000001
public uint Unknown_8h { get; set; } // 0x00000000
public uint Unknown_Ch { get; set; } // 0x00000000
public ulong Unknown_10h_Pointer { get; set; }
public ulong BoneTagsPointer { get; set; }
public ushort Count1 { get; set; }
public ushort Count2 { get; set; }
public uint Unknown_1Ch { get; set; }
public FlagsUint Unknown_1Ch { get; set; }
public ulong BonesPointer { get; set; }
public ulong TransformationsInvertedPointer { get; set; }
public ulong TransformationsPointer { get; set; }
public ulong ParentIndicesPointer { get; set; }
public ulong Unknown_40h_Pointer { get; set; }
public ulong ChildIndicesPointer { get; set; }
public uint Unknown_48h { get; set; } // 0x00000000
public uint Unknown_4Ch { get; set; } // 0x00000000
public MetaHash Unknown_50h { get; set; }
@ -529,25 +529,25 @@ namespace CodeWalker.GameFiles
public MetaHash Unknown_58h { get; set; }
public ushort Unknown_5Ch { get; set; } // 0x0001
public ushort BonesCount { get; set; }
public ushort Count4 { get; set; }
public ushort ChildIndicesCount { get; set; }
public ushort Unknown_62h { get; set; } // 0x0000
public uint Unknown_64h { get; set; } // 0x00000000
public uint Unknown_68h { get; set; } // 0x00000000
public uint Unknown_6Ch { get; set; } // 0x00000000
// reference data
public ResourcePointerArray64<Skeleton_Unknown_D_001> Unknown_10h_Data { get; set; }
public ResourcePointerArray64<SkeletonBoneTag> BoneTags { get; set; }
public ResourceSimpleArray<Bone> Bones { get; set; }
public Matrix[] TransformationsInverted { get; set; }
public Matrix[] Transformations { get; set; }
public ushort[] ParentIndices { get; set; }
public ushort[] Unknown_40h_Data { get; set; }
public ushort[] ChildIndices { get; set; }//mapping child->parent indices, first child index, then parent
private ResourceSystemStructBlock<Matrix> TransformationsInvertedBlock = null;//for saving only
private ResourceSystemStructBlock<Matrix> TransformationsBlock = null;
private ResourceSystemStructBlock<ushort> ParentIndicesBlock = null;
private ResourceSystemStructBlock<ushort> Unknown_40h_DataBlock = null;
private ResourceSystemStructBlock<ushort> ChildIndicesBlock = null;
public Dictionary<ushort, Bone> BonesMap { get; set; }//for convienience finding bones by tag
@ -564,7 +564,7 @@ namespace CodeWalker.GameFiles
this.Unknown_4h = reader.ReadUInt32();
this.Unknown_8h = reader.ReadUInt32();
this.Unknown_Ch = reader.ReadUInt32();
this.Unknown_10h_Pointer = reader.ReadUInt64();
this.BoneTagsPointer = reader.ReadUInt64();
this.Count1 = reader.ReadUInt16();
this.Count2 = reader.ReadUInt16();
this.Unknown_1Ch = reader.ReadUInt32();
@ -572,7 +572,7 @@ namespace CodeWalker.GameFiles
this.TransformationsInvertedPointer = reader.ReadUInt64();
this.TransformationsPointer = reader.ReadUInt64();
this.ParentIndicesPointer = reader.ReadUInt64();
this.Unknown_40h_Pointer = reader.ReadUInt64();
this.ChildIndicesPointer = reader.ReadUInt64();
this.Unknown_48h = reader.ReadUInt32();
this.Unknown_4Ch = reader.ReadUInt32();
this.Unknown_50h = new MetaHash(reader.ReadUInt32());
@ -580,15 +580,15 @@ namespace CodeWalker.GameFiles
this.Unknown_58h = new MetaHash(reader.ReadUInt32());
this.Unknown_5Ch = reader.ReadUInt16();
this.BonesCount = reader.ReadUInt16();
this.Count4 = reader.ReadUInt16();
this.ChildIndicesCount = reader.ReadUInt16();
this.Unknown_62h = reader.ReadUInt16();
this.Unknown_64h = reader.ReadUInt32();
this.Unknown_68h = reader.ReadUInt32();
this.Unknown_6Ch = reader.ReadUInt32();
// read reference data
this.Unknown_10h_Data = reader.ReadBlockAt<ResourcePointerArray64<Skeleton_Unknown_D_001>>(
this.Unknown_10h_Pointer, // offset
this.BoneTags = reader.ReadBlockAt<ResourcePointerArray64<SkeletonBoneTag>>(
this.BoneTagsPointer, // offset
this.Count1
);
this.Bones = reader.ReadBlockAt<ResourceSimpleArray<Bone>>(
@ -598,7 +598,7 @@ namespace CodeWalker.GameFiles
this.TransformationsInverted = reader.ReadStructsAt<Matrix>(this.TransformationsInvertedPointer, this.BonesCount);
this.Transformations = reader.ReadStructsAt<Matrix>(this.TransformationsPointer, this.BonesCount);
this.ParentIndices = reader.ReadUshortsAt(this.ParentIndicesPointer, this.BonesCount);
this.Unknown_40h_Data = reader.ReadUshortsAt(this.Unknown_40h_Pointer, this.Count4);
this.ChildIndices = reader.ReadUshortsAt(this.ChildIndicesPointer, this.ChildIndicesCount);
if ((Bones != null) && (ParentIndices != null))
@ -621,7 +621,7 @@ namespace CodeWalker.GameFiles
for (int i = 0; i < Bones.Count; i++)
{
var bone = Bones[i];
BonesMap[bone.Id] = bone;
BonesMap[bone.Tag] = bone;
bone.UpdateAnimTransform();
bone.BindTransformInv = (i < TransformationsInverted?.Length) ? TransformationsInverted[i] : Matrix.Invert(bone.AnimTransform);
@ -638,15 +638,15 @@ namespace CodeWalker.GameFiles
public override void Write(ResourceDataWriter writer, params object[] parameters)
{
// update structure data
this.Unknown_10h_Pointer = (ulong)(this.Unknown_10h_Data != null ? this.Unknown_10h_Data.FilePosition : 0);
this.Count1 = (ushort)(this.Unknown_10h_Data != null ? this.Unknown_10h_Data.Count : 0);
this.BoneTagsPointer = (ulong)(this.BoneTags != null ? this.BoneTags.FilePosition : 0);
this.Count1 = (ushort)(this.BoneTags != null ? this.BoneTags.Count : 0);
this.BonesPointer = (ulong)(this.Bones != null ? this.Bones.FilePosition : 0);
this.TransformationsInvertedPointer = (ulong)(this.TransformationsInvertedBlock != null ? this.TransformationsInvertedBlock.FilePosition : 0);
this.TransformationsPointer = (ulong)(this.TransformationsBlock != null ? this.TransformationsBlock.FilePosition : 0);
this.ParentIndicesPointer = (ulong)(this.ParentIndicesBlock != null ? this.ParentIndicesBlock.FilePosition : 0);
this.Unknown_40h_Pointer = (ulong)(this.Unknown_40h_DataBlock != null ? this.Unknown_40h_DataBlock.FilePosition : 0);
this.ChildIndicesPointer = (ulong)(this.ChildIndicesBlock != null ? this.ChildIndicesBlock.FilePosition : 0);
this.BonesCount = (ushort)(this.Bones != null ? this.Bones.Count : 0);
this.Count4 = (ushort)(this.Unknown_40h_DataBlock != null ? this.Unknown_40h_DataBlock.ItemCount : 0);
this.ChildIndicesCount = (ushort)(this.ChildIndicesBlock != null ? this.ChildIndicesBlock.ItemCount : 0);
//this.Count2 = BonesCount;//?
@ -655,7 +655,7 @@ namespace CodeWalker.GameFiles
writer.Write(this.Unknown_4h);
writer.Write(this.Unknown_8h);
writer.Write(this.Unknown_Ch);
writer.Write(this.Unknown_10h_Pointer);
writer.Write(this.BoneTagsPointer);
writer.Write(this.Count1);
writer.Write(this.Count2);
writer.Write(this.Unknown_1Ch);
@ -663,7 +663,7 @@ namespace CodeWalker.GameFiles
writer.Write(this.TransformationsInvertedPointer);
writer.Write(this.TransformationsPointer);
writer.Write(this.ParentIndicesPointer);
writer.Write(this.Unknown_40h_Pointer);
writer.Write(this.ChildIndicesPointer);
writer.Write(this.Unknown_48h);
writer.Write(this.Unknown_4Ch);
writer.Write(this.Unknown_50h);
@ -671,7 +671,7 @@ namespace CodeWalker.GameFiles
writer.Write(this.Unknown_58h);
writer.Write(this.Unknown_5Ch);
writer.Write(this.BonesCount);
writer.Write(this.Count4);
writer.Write(this.ChildIndicesCount);
writer.Write(this.Unknown_62h);
writer.Write(this.Unknown_64h);
writer.Write(this.Unknown_68h);
@ -684,7 +684,7 @@ namespace CodeWalker.GameFiles
public override IResourceBlock[] GetReferences()
{
var list = new List<IResourceBlock>();
if (Unknown_10h_Data != null) list.Add(Unknown_10h_Data);
if (BoneTags != null) list.Add(BoneTags);
if (Bones != null) list.Add(Bones);
if (TransformationsInverted != null)
{
@ -701,16 +701,16 @@ namespace CodeWalker.GameFiles
ParentIndicesBlock = new ResourceSystemStructBlock<ushort>(ParentIndices);
list.Add(ParentIndicesBlock);
}
if (Unknown_40h_Data != null)
if (ChildIndices != null)
{
Unknown_40h_DataBlock = new ResourceSystemStructBlock<ushort>(Unknown_40h_Data);
list.Add(Unknown_40h_DataBlock);
ChildIndicesBlock = new ResourceSystemStructBlock<ushort>(ChildIndices);
list.Add(ChildIndicesBlock);
}
return list.ToArray();
}
}
[TypeConverter(typeof(ExpandableObjectConverter))] public class Skeleton_Unknown_D_001 : ResourceSystemBlock
[TypeConverter(typeof(ExpandableObjectConverter))] public class SkeletonBoneTag : ResourceSystemBlock
{
public override long BlockLength
{
@ -718,12 +718,12 @@ namespace CodeWalker.GameFiles
}
// structure data
public uint Unknown_0h { get; set; }
public uint Unknown_4h { get; set; }
public ulong Unknown_8h_Pointer { get; set; }
public uint BoneTag { get; set; }
public uint BoneIndex { get; set; }
public ulong LinkedTagPointer { get; set; }
// reference data
public Skeleton_Unknown_D_001 p1data { get; set; }
public SkeletonBoneTag LinkedTag { get; set; } //don't know why it's linked here
/// <summary>
/// Reads the data-block from a stream.
@ -731,13 +731,13 @@ namespace CodeWalker.GameFiles
public override void Read(ResourceDataReader reader, params object[] parameters)
{
// read structure data
this.Unknown_0h = reader.ReadUInt32();
this.Unknown_4h = reader.ReadUInt32();
this.Unknown_8h_Pointer = reader.ReadUInt64();
this.BoneTag = reader.ReadUInt32();
this.BoneIndex = reader.ReadUInt32();
this.LinkedTagPointer = reader.ReadUInt64();
// read reference data
this.p1data = reader.ReadBlockAt<Skeleton_Unknown_D_001>(
this.Unknown_8h_Pointer // offset
this.LinkedTag = reader.ReadBlockAt<SkeletonBoneTag>(
this.LinkedTagPointer // offset
);
}
@ -747,12 +747,12 @@ namespace CodeWalker.GameFiles
public override void Write(ResourceDataWriter writer, params object[] parameters)
{
// update structure data
this.Unknown_8h_Pointer = (ulong)(this.p1data != null ? this.p1data.FilePosition : 0);
this.LinkedTagPointer = (ulong)(this.LinkedTag != null ? this.LinkedTag.FilePosition : 0);
// write structure data
writer.Write(this.Unknown_0h);
writer.Write(this.Unknown_4h);
writer.Write(this.Unknown_8h_Pointer);
writer.Write(this.BoneTag);
writer.Write(this.BoneIndex);
writer.Write(this.LinkedTagPointer);
}
/// <summary>
@ -761,9 +761,14 @@ namespace CodeWalker.GameFiles
public override IResourceBlock[] GetReferences()
{
var list = new List<IResourceBlock>();
if (p1data != null) list.Add(p1data);
if (LinkedTag != null) list.Add(LinkedTag);
return list.ToArray();
}
public override string ToString()
{
return BoneTag.ToString() + ": " + BoneIndex.ToString();
}
}
[TypeConverter(typeof(ExpandableObjectConverter))] public class Bone : ResourceSystemBlock
@ -788,9 +793,9 @@ namespace CodeWalker.GameFiles
public uint Unknown_34h { get; set; } // 0x00000000
public ulong NamePointer { get; set; }
public ushort Flags { get; set; }
public ushort Unknown_42h { get; set; }
public ushort Id { get; set; }
public ushort Unknown_46h { get; set; }
public ushort Index { get; set; }
public ushort Tag { get; set; }
public ushort Index2 { get; set; }//same as Index?
public uint Unknown_48h { get; set; } // 0x00000000
public uint Unknown_4Ch { get; set; } // 0x00000000
@ -826,9 +831,9 @@ namespace CodeWalker.GameFiles
this.Unknown_34h = reader.ReadUInt32();
this.NamePointer = reader.ReadUInt64();
this.Flags = reader.ReadUInt16();
this.Unknown_42h = reader.ReadUInt16();
this.Id = reader.ReadUInt16();
this.Unknown_46h = reader.ReadUInt16();
this.Index = reader.ReadUInt16();
this.Tag = reader.ReadUInt16();
this.Index2 = reader.ReadUInt16();
this.Unknown_48h = reader.ReadUInt32();
this.Unknown_4Ch = reader.ReadUInt32();
@ -862,9 +867,9 @@ namespace CodeWalker.GameFiles
writer.Write(this.Unknown_34h);
writer.Write(this.NamePointer);
writer.Write(this.Flags);
writer.Write(this.Unknown_42h);
writer.Write(this.Id);
writer.Write(this.Unknown_46h);
writer.Write(this.Index);
writer.Write(this.Tag);
writer.Write(this.Index2);
writer.Write(this.Unknown_48h);
writer.Write(this.Unknown_4Ch);
}
@ -885,7 +890,7 @@ namespace CodeWalker.GameFiles
public override string ToString()
{
return Id.ToString() + ": " + Name;
return Tag.ToString() + ": " + Name;
}

View File

@ -55,9 +55,9 @@ namespace CodeWalker.GameFiles
public float Unknown_28h { get; set; }
public float Unknown_2Ch { get; set; }
public ulong DrawablePointer { get; set; }
public ulong Unknown_28h_Pointer { get; set; }
public ulong Unknown_30h_Pointer { get; set; }
public uint Count0 { get; set; }
public ulong DrawableArrayPointer { get; set; }
public ulong DrawableArrayNamesPointer { get; set; }
public uint DrawableArrayCount { get; set; }
public uint Unknown_4Ch { get; set; } //pointer?
public uint Unknown_50h { get; set; } // 0x00000000
public uint Unknown_54h { get; set; } // 0x00000000
@ -77,7 +77,7 @@ namespace CodeWalker.GameFiles
public uint Unknown_9Ch { get; set; } // 0x00000000
public uint Unknown_A0h { get; set; } // 0x00000000
public uint Unknown_A4h { get; set; } // 0x00000000
public ulong Unknown_A8h_Pointer { get; set; }
public ulong BoneTransformsPointer { get; set; }
public uint Unknown_B0h { get; set; } // 0x00000000
public uint Unknown_B4h { get; set; } // 0x00000000
public uint Unknown_B8h { get; set; }
@ -89,10 +89,10 @@ namespace CodeWalker.GameFiles
public float Unknown_D0h { get; set; }
public float Unknown_D4h { get; set; }
public byte Unknown_D8h { get; set; }
public byte Count3 { get; set; }
public byte GlassWindowsCount { get; set; }
public ushort Unknown_DAh { get; set; }
public uint Unknown_DCh { get; set; } // 0x00000000
public ulong Unknown_E0h_Pointer { get; set; }
public ulong GlassWindowsPointer { get; set; }
public uint Unknown_E8h { get; set; } // 0x00000000
public uint Unknown_ECh { get; set; } // 0x00000000
public ulong PhysicsLODGroupPointer { get; set; }
@ -102,24 +102,27 @@ namespace CodeWalker.GameFiles
public uint Unknown_108h { get; set; } // 0x00000000
public uint Unknown_10Ch { get; set; } // 0x00000000
public ResourceSimpleList64_s<LightAttributes_s> LightAttributes { get; set; }
public ulong Unknown_120h_Pointer { get; set; }
public ulong VehicleGlassWindowsPointer { get; set; }
public uint Unknown_128h { get; set; } // 0x00000000
public uint Unknown_12Ch { get; set; } // 0x00000000
// reference data
public FragDrawable Drawable { get; set; }
public ResourcePointerArray64<FragDrawable> Unknown_28h_Data { get; set; }
public ResourcePointerArray64<string_r> Unknown_30h_Data { get; set; }
public ResourcePointerArray64<FragDrawable> DrawableArray { get; set; }
public ResourcePointerArray64<string_r> DrawableArrayNames { get; set; }
public string Name { get; set; }
public FragUnknown_F_004 Unknown_A8h_Data { get; set; }
public ResourcePointerArray64<FragUnknown_F_006> Unknown_E0h_Data { get; set; }
public FragBoneTransforms BoneTransforms { get; set; }
public ResourcePointerArray64<FragGlassWindow> GlassWindows { get; set; }
public FragPhysicsLODGroup PhysicsLODGroup { get; set; }
public FragDrawable Drawable2 { get; set; }
public FragUnknown_F_003 Unknown_120h_Data { get; set; }
public FragVehicleGlassWindows VehicleGlassWindows { get; set; }
private string_r NameBlock = null; //only used for saving
public YftFile Yft { get; set; }
/// <summary>
/// Reads the data-block from a stream.
/// </summary>
@ -137,9 +140,9 @@ namespace CodeWalker.GameFiles
this.Unknown_28h = reader.ReadSingle();
this.Unknown_2Ch = reader.ReadSingle();
this.DrawablePointer = reader.ReadUInt64();
this.Unknown_28h_Pointer = reader.ReadUInt64();
this.Unknown_30h_Pointer = reader.ReadUInt64();
this.Count0 = reader.ReadUInt32();
this.DrawableArrayPointer = reader.ReadUInt64();
this.DrawableArrayNamesPointer = reader.ReadUInt64();
this.DrawableArrayCount = reader.ReadUInt32();
this.Unknown_4Ch = reader.ReadUInt32();
this.Unknown_50h = reader.ReadUInt32();
this.Unknown_54h = reader.ReadUInt32();
@ -159,7 +162,7 @@ namespace CodeWalker.GameFiles
this.Unknown_9Ch = reader.ReadUInt32();
this.Unknown_A0h = reader.ReadUInt32();
this.Unknown_A4h = reader.ReadUInt32();
this.Unknown_A8h_Pointer = reader.ReadUInt64();
this.BoneTransformsPointer = reader.ReadUInt64();
this.Unknown_B0h = reader.ReadUInt32();
this.Unknown_B4h = reader.ReadUInt32();
this.Unknown_B8h = reader.ReadUInt32();
@ -171,10 +174,10 @@ namespace CodeWalker.GameFiles
this.Unknown_D0h = reader.ReadSingle();
this.Unknown_D4h = reader.ReadSingle();
this.Unknown_D8h = reader.ReadByte();
this.Count3 = reader.ReadByte();
this.GlassWindowsCount = reader.ReadByte();
this.Unknown_DAh = reader.ReadUInt16();
this.Unknown_DCh = reader.ReadUInt32();
this.Unknown_E0h_Pointer = reader.ReadUInt64();
this.GlassWindowsPointer = reader.ReadUInt64();
this.Unknown_E8h = reader.ReadUInt32();
this.Unknown_ECh = reader.ReadUInt32();
this.PhysicsLODGroupPointer = reader.ReadUInt64();
@ -184,65 +187,49 @@ namespace CodeWalker.GameFiles
this.Unknown_108h = reader.ReadUInt32();
this.Unknown_10Ch = reader.ReadUInt32();
this.LightAttributes = reader.ReadBlock<ResourceSimpleList64_s<LightAttributes_s>>();
this.Unknown_120h_Pointer = reader.ReadUInt64();
this.VehicleGlassWindowsPointer = reader.ReadUInt64();
this.Unknown_128h = reader.ReadUInt32();
this.Unknown_12Ch = reader.ReadUInt32();
// read reference data
this.Drawable = reader.ReadBlockAt<FragDrawable>(
this.DrawablePointer // offset
);
if (this.Drawable != null)
Drawable = reader.ReadBlockAt<FragDrawable>(this.DrawablePointer);
if (Drawable != null)
{
this.Drawable.OwnerFragment = this;
Drawable.OwnerFragment = this;
}
this.Unknown_28h_Data = reader.ReadBlockAt<ResourcePointerArray64<FragDrawable>>(
this.Unknown_28h_Pointer, // offset
this.Count0
);
if ((this.Unknown_28h_Data != null) && (this.Unknown_28h_Data.data_items != null))
DrawableArray = reader.ReadBlockAt<ResourcePointerArray64<FragDrawable>>(DrawableArrayPointer, DrawableArrayCount);
if ((DrawableArray != null) && (DrawableArray.data_items != null))
{
for (int i = 0; i < this.Unknown_28h_Data.data_items.Length; i++)
for (int i = 0; i < DrawableArray.data_items.Length; i++)
{
var drwbl = Unknown_28h_Data.data_items[i];
var drwbl = DrawableArray.data_items[i];
if (drwbl != null)
{
drwbl.OwnerFragment = this;
}
}
}
this.Unknown_30h_Data = reader.ReadBlockAt<ResourcePointerArray64<string_r>>(
this.Unknown_30h_Pointer, // offset
this.Count0
);
this.Name = reader.ReadStringAt(//BlockAt<string_r>(
this.NamePointer // offset
);
this.Unknown_A8h_Data = reader.ReadBlockAt<FragUnknown_F_004>(
this.Unknown_A8h_Pointer // offset
);
this.Unknown_E0h_Data = reader.ReadBlockAt<ResourcePointerArray64<FragUnknown_F_006>>(
this.Unknown_E0h_Pointer, // offset
this.Count3
);
this.PhysicsLODGroup = reader.ReadBlockAt<FragPhysicsLODGroup>(
this.PhysicsLODGroupPointer // offset
);
this.Drawable2 = reader.ReadBlockAt<FragDrawable>(
this.Drawable2Pointer // offset
);
if (this.Drawable2 != null)
DrawableArrayNames = reader.ReadBlockAt<ResourcePointerArray64<string_r>>(DrawableArrayNamesPointer, DrawableArrayCount);
Name = reader.ReadStringAt(NamePointer);
BoneTransforms = reader.ReadBlockAt<FragBoneTransforms>(BoneTransformsPointer);
GlassWindows = reader.ReadBlockAt<ResourcePointerArray64<FragGlassWindow>>(GlassWindowsPointer, GlassWindowsCount);
PhysicsLODGroup = reader.ReadBlockAt<FragPhysicsLODGroup>(PhysicsLODGroupPointer);
Drawable2 = reader.ReadBlockAt<FragDrawable>(Drawable2Pointer);
if (Drawable2 != null)
{
this.Drawable2.OwnerFragment = this;
Drawable2.OwnerFragment = this;
}
this.Unknown_120h_Data = reader.ReadBlockAt<FragUnknown_F_003>(
this.Unknown_120h_Pointer // offset
);
VehicleGlassWindows = reader.ReadBlockAt<FragVehicleGlassWindows>(VehicleGlassWindowsPointer);
if (GlassWindows != null)
{ }
if (VehicleGlassWindows != null)
{ }
//for vehicle wheels, the shaderGroup in the model seems to be missing, but have to use the main drawable's shaders.
if ((Drawable != null) && (PhysicsLODGroup != null) && (PhysicsLODGroup.PhysicsLOD1 != null))
@ -273,16 +260,16 @@ namespace CodeWalker.GameFiles
// update structure data
this.DrawablePointer = (ulong)(this.Drawable != null ? this.Drawable.FilePosition : 0);
this.Unknown_28h_Pointer = (ulong)(this.Unknown_28h_Data != null ? this.Unknown_28h_Data.FilePosition : 0);
this.Unknown_30h_Pointer = (ulong)(this.Unknown_30h_Data != null ? this.Unknown_30h_Data.FilePosition : 0);
this.Count0 = (uint)(this.Unknown_28h_Data != null ? this.Unknown_28h_Data.Count : 0);
this.DrawableArrayPointer = (ulong)(this.DrawableArray != null ? this.DrawableArray.FilePosition : 0);
this.DrawableArrayNamesPointer = (ulong)(this.DrawableArrayNames != null ? this.DrawableArrayNames.FilePosition : 0);
this.DrawableArrayCount = (uint)(this.DrawableArray != null ? this.DrawableArray.Count : 0);
this.NamePointer = (ulong)(this.NameBlock != null ? this.NameBlock.FilePosition : 0);
this.Unknown_A8h_Pointer = (ulong)(this.Unknown_A8h_Data != null ? this.Unknown_A8h_Data.FilePosition : 0);
this.Count3 = (byte)(this.Unknown_E0h_Data != null ? this.Unknown_E0h_Data.Count : 0);
this.Unknown_E0h_Pointer = (ulong)(this.Unknown_E0h_Data != null ? this.Unknown_E0h_Data.FilePosition : 0);
this.BoneTransformsPointer = (ulong)(this.BoneTransforms != null ? this.BoneTransforms.FilePosition : 0);
this.GlassWindowsCount = (byte)(this.GlassWindows != null ? this.GlassWindows.Count : 0);
this.GlassWindowsPointer = (ulong)(this.GlassWindows != null ? this.GlassWindows.FilePosition : 0);
this.PhysicsLODGroupPointer = (ulong)(this.PhysicsLODGroup != null ? this.PhysicsLODGroup.FilePosition : 0);
this.Drawable2Pointer = (ulong)(this.Drawable2 != null ? this.Drawable2.FilePosition : 0);
this.Unknown_120h_Pointer = (ulong)(this.Unknown_120h_Data != null ? this.Unknown_120h_Data.FilePosition : 0);
this.VehicleGlassWindowsPointer = (ulong)(this.VehicleGlassWindows != null ? this.VehicleGlassWindows.FilePosition : 0);
// write structure data
writer.Write(this.Unknown_10h);
@ -294,9 +281,9 @@ namespace CodeWalker.GameFiles
writer.Write(this.Unknown_28h);
writer.Write(this.Unknown_2Ch);
writer.Write(this.DrawablePointer);
writer.Write(this.Unknown_28h_Pointer);
writer.Write(this.Unknown_30h_Pointer);
writer.Write(this.Count0);
writer.Write(this.DrawableArrayPointer);
writer.Write(this.DrawableArrayNamesPointer);
writer.Write(this.DrawableArrayCount);
writer.Write(this.Unknown_4Ch);
writer.Write(this.Unknown_50h);
writer.Write(this.Unknown_54h);
@ -316,7 +303,7 @@ namespace CodeWalker.GameFiles
writer.Write(this.Unknown_9Ch);
writer.Write(this.Unknown_A0h);
writer.Write(this.Unknown_A4h);
writer.Write(this.Unknown_A8h_Pointer);
writer.Write(this.BoneTransformsPointer);
writer.Write(this.Unknown_B0h);
writer.Write(this.Unknown_B4h);
writer.Write(this.Unknown_B8h);
@ -328,10 +315,10 @@ namespace CodeWalker.GameFiles
writer.Write(this.Unknown_D0h);
writer.Write(this.Unknown_D4h);
writer.Write(this.Unknown_D8h);
writer.Write(this.Count3);
writer.Write(this.GlassWindowsCount);
writer.Write(this.Unknown_DAh);
writer.Write(this.Unknown_DCh);
writer.Write(this.Unknown_E0h_Pointer);
writer.Write(this.GlassWindowsPointer);
writer.Write(this.Unknown_E8h);
writer.Write(this.Unknown_ECh);
writer.Write(this.PhysicsLODGroupPointer);
@ -341,7 +328,7 @@ namespace CodeWalker.GameFiles
writer.Write(this.Unknown_108h);
writer.Write(this.Unknown_10Ch);
writer.WriteBlock(this.LightAttributes);
writer.Write(this.Unknown_120h_Pointer);
writer.Write(this.VehicleGlassWindowsPointer);
writer.Write(this.Unknown_128h);
writer.Write(this.Unknown_12Ch);
}
@ -353,18 +340,18 @@ namespace CodeWalker.GameFiles
{
var list = new List<IResourceBlock>(base.GetReferences());
if (Drawable != null) list.Add(Drawable);
if (Unknown_28h_Data != null) list.Add(Unknown_28h_Data);
if (Unknown_30h_Data != null) list.Add(Unknown_30h_Data);
if (DrawableArray != null) list.Add(DrawableArray);
if (DrawableArrayNames != null) list.Add(DrawableArrayNames);
if (Name != null)
{
NameBlock = (string_r)Name;
list.Add(NameBlock);
}
if (Unknown_A8h_Data != null) list.Add(Unknown_A8h_Data);
if (Unknown_E0h_Data != null) list.Add(Unknown_E0h_Data);
if (BoneTransforms != null) list.Add(BoneTransforms);
if (GlassWindows != null) list.Add(GlassWindows);
if (PhysicsLODGroup != null) list.Add(PhysicsLODGroup);
if (Drawable2 != null) list.Add(Drawable2);
if (Unknown_120h_Data != null) list.Add(Unknown_120h_Data);
if (VehicleGlassWindows != null) list.Add(VehicleGlassWindows);
return list.ToArray();
}
@ -1699,13 +1686,13 @@ namespace CodeWalker.GameFiles
// structure data
public uint Unknown_0A8h { get; set; }
public uint Unknown_0ACh { get; set; }
public Matrix Unknown_0B0h { get; set; }
public Matrix FragMatrix { get; set; } //unknown?
public ulong BoundPointer { get; set; }
public ulong Unknown_0F8h_Pointer { get; set; }
public ushort Count1 { get; set; }
public ushort Count2 { get; set; }
public ulong FragMatricesIndsPointer { get; set; }
public ushort FragMatricesIndsCount { get; set; }
public ushort FragMatricesCount { get; set; }
public uint Unknown_104h { get; set; } // 0x00000000
public ulong Unknown_108h_Pointer { get; set; }
public ulong FragMatricesPointer { get; set; }
public ushort Count3 { get; set; }
public ushort Count4 { get; set; }
public uint Unknown_114h { get; set; } // 0x00000000
@ -1725,8 +1712,8 @@ namespace CodeWalker.GameFiles
// reference data
public Bounds Bound { get; set; }
public ulong[] Unknown_F8h_Data { get; set; }
public Matrix[] Unknown_108h_Data { get; set; }
public ulong[] FragMatricesInds { get; set; }
public Matrix[] FragMatrices { get; set; }
public string Name { get; set; }
public FragType OwnerFragment { get; set; } //for handy use
@ -1748,13 +1735,13 @@ namespace CodeWalker.GameFiles
// read structure data
this.Unknown_0A8h = reader.ReadUInt32();
this.Unknown_0ACh = reader.ReadUInt32();
this.Unknown_0B0h = reader.ReadStruct<Matrix>();
this.FragMatrix = reader.ReadStruct<Matrix>();
this.BoundPointer = reader.ReadUInt64();
this.Unknown_0F8h_Pointer = reader.ReadUInt64();
this.Count1 = reader.ReadUInt16();
this.Count2 = reader.ReadUInt16();
this.FragMatricesIndsPointer = reader.ReadUInt64();
this.FragMatricesIndsCount = reader.ReadUInt16();
this.FragMatricesCount = reader.ReadUInt16();
this.Unknown_104h = reader.ReadUInt32();
this.Unknown_108h_Pointer = reader.ReadUInt64();
this.FragMatricesPointer = reader.ReadUInt64();
this.Count3 = reader.ReadUInt16();
this.Count4 = reader.ReadUInt16();
this.Unknown_114h = reader.ReadUInt32();
@ -1773,14 +1760,17 @@ namespace CodeWalker.GameFiles
this.Unknown_14Ch = reader.ReadUInt32();
// read reference data
this.Bound = reader.ReadBlockAt<Bounds>(
this.BoundPointer // offset
);
this.Unknown_F8h_Data = reader.ReadUlongsAt(this.Unknown_0F8h_Pointer, this.Count1);
this.Unknown_108h_Data = reader.ReadStructsAt<Matrix>(this.Unknown_108h_Pointer, this.Count2);
this.Name = reader.ReadStringAt(//BlockAt<string_r>(
this.NamePointer // offset
);
Bound = reader.ReadBlockAt<Bounds>(BoundPointer);
FragMatricesInds = reader.ReadUlongsAt(FragMatricesIndsPointer, FragMatricesIndsCount);
FragMatrices = reader.ReadStructsAt<Matrix>(FragMatricesPointer, FragMatricesCount);
Name = reader.ReadStringAt(NamePointer);
if ((Count3 != Count4)&&(Count4!=1)&&(Count3!=0))
{ }
if (FragMatricesInds != null)
{ }
if (FragMatrices != null)
{ }
}
/// <summary>
@ -1792,22 +1782,22 @@ namespace CodeWalker.GameFiles
// update structure data
this.BoundPointer = (ulong)(this.Bound != null ? this.Bound.FilePosition : 0);
this.Unknown_0F8h_Pointer = (ulong)(this.Unknown_F8h_DataBlock != null ? this.Unknown_F8h_DataBlock.FilePosition : 0);
this.Count1 = (ushort)(this.Unknown_F8h_DataBlock != null ? this.Unknown_F8h_DataBlock.ItemCount : 0);
this.Count2 = (ushort)(this.Unknown_108h_DataBlock != null ? this.Unknown_108h_DataBlock.ItemCount : 0);
this.Unknown_108h_Pointer = (ulong)(this.Unknown_108h_DataBlock != null ? this.Unknown_108h_DataBlock.FilePosition : 0);
this.FragMatricesIndsPointer = (ulong)(this.Unknown_F8h_DataBlock != null ? this.Unknown_F8h_DataBlock.FilePosition : 0);
this.FragMatricesIndsCount = (ushort)(this.Unknown_F8h_DataBlock != null ? this.Unknown_F8h_DataBlock.ItemCount : 0);
this.FragMatricesCount = (ushort)(this.Unknown_108h_DataBlock != null ? this.Unknown_108h_DataBlock.ItemCount : 0);
this.FragMatricesPointer = (ulong)(this.Unknown_108h_DataBlock != null ? this.Unknown_108h_DataBlock.FilePosition : 0);
this.NamePointer = (ulong)(this.NameBlock != null ? this.NameBlock.FilePosition : 0);
// write structure data
writer.Write(this.Unknown_0A8h);
writer.Write(this.Unknown_0ACh);
writer.Write(this.Unknown_0B0h);
writer.Write(this.FragMatrix);
writer.Write(this.BoundPointer);
writer.Write(this.Unknown_0F8h_Pointer);
writer.Write(this.Count1);
writer.Write(this.Count2);
writer.Write(this.FragMatricesIndsPointer);
writer.Write(this.FragMatricesIndsCount);
writer.Write(this.FragMatricesCount);
writer.Write(this.Unknown_104h);
writer.Write(this.Unknown_108h_Pointer);
writer.Write(this.FragMatricesPointer);
writer.Write(this.Count3);
writer.Write(this.Count4);
writer.Write(this.Unknown_114h);
@ -1833,14 +1823,14 @@ namespace CodeWalker.GameFiles
{
var list = new List<IResourceBlock>(base.GetReferences());
if (Bound != null) list.Add(Bound);
if (Unknown_F8h_Data != null)
if (FragMatricesInds != null)
{
Unknown_F8h_DataBlock = new ResourceSystemStructBlock<ulong>(Unknown_F8h_Data);
Unknown_F8h_DataBlock = new ResourceSystemStructBlock<ulong>(FragMatricesInds);
list.Add(Unknown_F8h_DataBlock);
}
if (Unknown_108h_Data != null)
if (FragMatrices != null)
{
Unknown_108h_DataBlock = new ResourceSystemStructBlock<Matrix>(Unknown_108h_Data);
Unknown_108h_DataBlock = new ResourceSystemStructBlock<Matrix>(FragMatrices);
list.Add(Unknown_108h_DataBlock);
}
if (Name != null)
@ -1852,11 +1842,11 @@ namespace CodeWalker.GameFiles
}
}
[TypeConverter(typeof(ExpandableObjectConverter))] public class FragUnknown_F_004 : ResourceSystemBlock
[TypeConverter(typeof(ExpandableObjectConverter))] public class FragBoneTransforms : ResourceSystemBlock
{
public override long BlockLength
{
get { return 32 + ((Data?.Length ?? 0) * 48); }
get { return 32 + ((Items?.Length ?? 0) * 48); }
}
// structure data
@ -1864,13 +1854,13 @@ namespace CodeWalker.GameFiles
public uint Unknown_04h { get; set; } // 0x00000000
public uint Unknown_08h { get; set; } // 0x00000000
public uint Unknown_0Ch { get; set; } // 0x00000000
public byte DataCount1 { get; set; }
public byte DataCount2 { get; set; }
public byte ItemCount1 { get; set; }
public byte ItemCount2 { get; set; }
public ushort Unknown_12h { get; set; }
public uint Unknown_14h { get; set; } // 0x00000000
public uint Unknown_18h { get; set; } // 0x00000000
public uint Unknown_1Ch { get; set; } // 0x00000000
public Matrix3_s[] Data { get; set; }
public Matrix3_s[] Items { get; set; }
/// <summary>
/// Reads the data-block from a stream.
@ -1882,14 +1872,16 @@ namespace CodeWalker.GameFiles
this.Unknown_04h = reader.ReadUInt32();
this.Unknown_08h = reader.ReadUInt32();
this.Unknown_0Ch = reader.ReadUInt32();
this.DataCount1 = reader.ReadByte();
this.DataCount2 = reader.ReadByte();
this.ItemCount1 = reader.ReadByte();
this.ItemCount2 = reader.ReadByte();
this.Unknown_12h = reader.ReadUInt16();
this.Unknown_14h = reader.ReadUInt32();
this.Unknown_18h = reader.ReadUInt32();
this.Unknown_1Ch = reader.ReadUInt32();
this.Data = reader.ReadStructs<Matrix3_s>(DataCount1);
this.Items = reader.ReadStructs<Matrix3_s>(ItemCount1);
if ((Unknown_12h != 0) && (Unknown_12h != 1))
{ }
}
/// <summary>
@ -1902,17 +1894,18 @@ namespace CodeWalker.GameFiles
writer.Write(this.Unknown_04h);
writer.Write(this.Unknown_08h);
writer.Write(this.Unknown_0Ch);
writer.Write(this.DataCount1);
writer.Write(this.DataCount2);
writer.Write(this.ItemCount1);
writer.Write(this.ItemCount2);
writer.Write(this.Unknown_12h);
writer.Write(this.Unknown_14h);
writer.Write(this.Unknown_18h);
writer.Write(this.Unknown_1Ch);
writer.WriteStructs(Data);
writer.WriteStructs(Items);
}
}
[TypeConverter(typeof(ExpandableObjectConverter))] public class FragUnknown_F_006 : ResourceSystemBlock
[TypeConverter(typeof(ExpandableObjectConverter))] public class FragGlassWindow : ResourceSystemBlock
{
public override long BlockLength
{
@ -1920,34 +1913,35 @@ namespace CodeWalker.GameFiles
}
// structure data
public uint Unknown_00h { get; set; }
public uint Unknown_04h { get; set; }
public uint Unknown_08h { get; set; }
public uint Unknown_0Ch { get; set; } // 0x7F800001
public uint Unknown_10h { get; set; }
public uint Unknown_14h { get; set; }
public uint Unknown_18h { get; set; }
public uint Unknown_1Ch { get; set; } // 0x7F800001
public uint Unknown_20h { get; set; }
public uint Unknown_24h { get; set; }
public uint Unknown_28h { get; set; }
public uint Unknown_2Ch { get; set; } // 0x7F800001
public uint Unknown_30h { get; set; }
public uint Unknown_34h { get; set; }
public uint Unknown_38h { get; set; }
public uint Unknown_3Ch { get; set; }
public uint Unknown_40h { get; set; } // 0x000000D9
public uint Unknown_44h { get; set; } // 0x0500002C
public uint Unknown_48h { get; set; } // 0x55996996 looks like vertex types
public uint Unknown_4Ch { get; set; } // 0x76555555
public uint Unknown_50h { get; set; }
public uint Unknown_54h { get; set; }
public uint Unknown_58h { get; set; }
public uint Unknown_5Ch { get; set; }
public uint Unknown_60h { get; set; }
public uint Unknown_64h { get; set; }
public uint Unknown_68h { get; set; }
public uint Unknown_6Ch { get; set; } // 0x7F800001
public Matrix Matrix { get; set; } //column 4 is NaN,NaN,NaN,1
public uint VertexDeclFlags { get; set; } // 0x000000D9
public ushort VertexDeclStride { get; set; } // 0x002C
public byte VertexDeclUnk { get; set; } //0x00
public byte VertexDeclCount { get; set; } //0x05
public ulong VertexDeclTypes { get; set; } // 0x7655555555996996
public MetaHash Unknown_50h { get; set; } //looks floaty? flagsy? 0xXXXX0000
public ushort Unknown_54h { get; set; }//2
public ushort Flags { get; set; }//512, 768, 1280 etc ... flags
public Vector3 Vector1 { get; set; }
public Vector3 Vector2 { get; set; } // z = 0x7F800001 (NaN)
public ulong VertexDeclId //this all equates to VertexTypePNCTT
{
get
{
ulong res = 0;
for (int i = 0; i < 16; i++)
{
if (((VertexDeclFlags >> i) & 1) == 1)
{
res += (VertexDeclTypes & (0xFu << (i * 4)));
}
}
return res;
}
}
public VertexType VertexType { get { return (VertexType)VertexDeclFlags; } }
/// <summary>
/// Reads the data-block from a stream.
@ -1955,34 +1949,22 @@ namespace CodeWalker.GameFiles
public override void Read(ResourceDataReader reader, params object[] parameters)
{
// read structure data
this.Unknown_00h = reader.ReadUInt32();
this.Unknown_04h = reader.ReadUInt32();
this.Unknown_08h = reader.ReadUInt32();
this.Unknown_0Ch = reader.ReadUInt32();
this.Unknown_10h = reader.ReadUInt32();
this.Unknown_14h = reader.ReadUInt32();
this.Unknown_18h = reader.ReadUInt32();
this.Unknown_1Ch = reader.ReadUInt32();
this.Unknown_20h = reader.ReadUInt32();
this.Unknown_24h = reader.ReadUInt32();
this.Unknown_28h = reader.ReadUInt32();
this.Unknown_2Ch = reader.ReadUInt32();
this.Unknown_30h = reader.ReadUInt32();
this.Unknown_34h = reader.ReadUInt32();
this.Unknown_38h = reader.ReadUInt32();
this.Unknown_3Ch = reader.ReadUInt32();
this.Unknown_40h = reader.ReadUInt32();
this.Unknown_44h = reader.ReadUInt32();
this.Unknown_48h = reader.ReadUInt32();
this.Unknown_4Ch = reader.ReadUInt32();
this.Matrix = reader.ReadStruct<Matrix>();
this.VertexDeclFlags = reader.ReadUInt32();
this.VertexDeclStride = reader.ReadUInt16();
this.VertexDeclUnk = reader.ReadByte();
this.VertexDeclCount = reader.ReadByte();
this.VertexDeclTypes = reader.ReadUInt64();
this.Unknown_50h = reader.ReadUInt32();
this.Unknown_54h = reader.ReadUInt32();
this.Unknown_58h = reader.ReadUInt32();
this.Unknown_5Ch = reader.ReadUInt32();
this.Unknown_60h = reader.ReadUInt32();
this.Unknown_64h = reader.ReadUInt32();
this.Unknown_68h = reader.ReadUInt32();
this.Unknown_6Ch = reader.ReadUInt32();
this.Unknown_54h = reader.ReadUInt16();
this.Flags = reader.ReadUInt16();
this.Vector1 = reader.ReadStruct<Vector3>();
this.Vector2 = reader.ReadStruct<Vector3>();
if (Unknown_50h != 0)
{ }
if (Unknown_54h != 2)
{ }
}
/// <summary>
@ -1991,49 +1973,248 @@ namespace CodeWalker.GameFiles
public override void Write(ResourceDataWriter writer, params object[] parameters)
{
// write structure data
writer.Write(this.Unknown_00h);
writer.Write(this.Unknown_04h);
writer.Write(this.Unknown_08h);
writer.Write(this.Unknown_0Ch);
writer.Write(this.Unknown_10h);
writer.Write(this.Unknown_14h);
writer.Write(this.Unknown_18h);
writer.Write(this.Unknown_1Ch);
writer.Write(this.Unknown_20h);
writer.Write(this.Unknown_24h);
writer.Write(this.Unknown_28h);
writer.Write(this.Unknown_2Ch);
writer.Write(this.Unknown_30h);
writer.Write(this.Unknown_34h);
writer.Write(this.Unknown_38h);
writer.Write(this.Unknown_3Ch);
writer.Write(this.Unknown_40h);
writer.Write(this.Unknown_44h);
writer.Write(this.Unknown_48h);
writer.Write(this.Unknown_4Ch);
writer.Write(this.Matrix);
writer.Write(this.VertexDeclFlags);
writer.Write(this.VertexDeclStride);
writer.Write(this.VertexDeclUnk);
writer.Write(this.VertexDeclCount);
writer.Write(this.VertexDeclTypes);
writer.Write(this.Unknown_50h);
writer.Write(this.Unknown_54h);
writer.Write(this.Unknown_58h);
writer.Write(this.Unknown_5Ch);
writer.Write(this.Unknown_60h);
writer.Write(this.Unknown_64h);
writer.Write(this.Unknown_68h);
writer.Write(this.Unknown_6Ch);
writer.Write(this.Flags);
writer.Write(this.Vector1);
writer.Write(this.Vector2);
}
}
[TypeConverter(typeof(ExpandableObjectConverter))] public class FragUnknown_F_003 : ResourceSystemBlock
[TypeConverter(typeof(ExpandableObjectConverter))] public class FragVehicleGlassWindows : ResourceSystemBlock
{
public override long BlockLength
{
get { return 16 + (Data?.Length ?? 0); }
get { return TotalLength; }
}
[TypeConverter(typeof(ExpandableObjectConverter))] public struct ItemOffsetStruct
{
public uint Item { get; set; }
public uint Offset { get; set; }
public override string ToString()
{
return Item.ToString() + ": " + Offset.ToString();
}
}
[TypeConverter(typeof(ExpandableObjectConverter))] public class ItemStruct
{
public Matrix UnkMatrix { get; set; }
public uint UnkUint1 { get; set; } = 0x56475743; // "VGWC" vehicle glass window C..?
public ushort ItemID { get; set; } //matches UnkStruct1.Item
public ushort UnkUshort1 { get; set; }
public ushort UnkUshort2 { get; set; }
public ushort ItemDataCount { get; set; }//count of item data arrays
public ushort ItemDataByteLength { get; set; }//total byte length of ItemDatas plus byte length of ItemDataOffsets
public ushort UnkUshort3 { get; set; }
public uint UnkUint2 { get; set; } = 0; //0
public uint UnkUint3 { get; set; } = 0; //0
public float UnkFloat0 { get; set; }
public float UnkFloat1 { get; set; }
public ushort UnkUshort4 { get; set; } //0, 1
public ushort UnkUshort5 { get; set; } //2, 2050
public float UnkFloat2 { get; set; }
public uint UnkUint4 { get; set; } = 0; //0
public uint UnkUint5 { get; set; } = 0; //0
public ushort[] ItemDataOffsets { get; set; }//byte offsets for following array
public ItemDataStruct[] ItemDatas { get; set; }
public byte[] Leftovers { get; set; }//should just be leftover padding, TODO: getrid of this
public uint TotalLength
{
get
{
uint bc = 112;
bc += ItemDataCount*2u;
bc += (uint)(Leftovers?.Length??0);
if (ItemDatas != null)
{
foreach (var u in ItemDatas)
{
bc += u.TotalLength;
}
}
return bc;
}
}
public void Read(ResourceDataReader reader)
{
UnkMatrix = reader.ReadStruct<Matrix>();
UnkUint1 = reader.ReadUInt32(); //0x56475743 "VGWC"
ItemID = reader.ReadUInt16();
UnkUshort1 = reader.ReadUInt16();
UnkUshort2 = reader.ReadUInt16();
ItemDataCount = reader.ReadUInt16();//count of item data arrays
ItemDataByteLength = reader.ReadUInt16();//total byte length of ItemDatas plus byte length of ItemDataOffsets
UnkUshort3 = reader.ReadUInt16();
UnkUint2 = reader.ReadUInt32();//0
UnkUint3 = reader.ReadUInt32();//0
UnkFloat0 = reader.ReadSingle();
UnkFloat1 = reader.ReadSingle();
UnkUshort4 = reader.ReadUInt16();//0, 1
UnkUshort5 = reader.ReadUInt16();//2, 2050
UnkFloat2 = reader.ReadSingle();
UnkUint4 = reader.ReadUInt32();//0
UnkUint5 = reader.ReadUInt32();//0
if (ItemDataByteLength != 0)//sometimes this is 0 and UnkUshort3>0, which is weird
{
ItemDataOffsets = reader.ReadStructs<ushort>(ItemDataCount);//byte offsets for following array
long coffset = 0;
ItemDatas = new ItemDataStruct[ItemDataCount];
for (int i = 0; i < ItemDataCount; i++)
{
var toffset = ItemDataOffsets[i];
var cbrem = toffset - coffset;
if (cbrem > 0)
{
var leftovers = reader.ReadBytes((int)cbrem);
if (i > 0)
{
ItemDatas[i - 1].Leftovers = leftovers;
}
else
{ }
coffset += cbrem;
}
else if (cbrem < 0)
{ }
var rpos = reader.Position;
var u = new ItemDataStruct();
u.Read(reader);
ItemDatas[i] = u;
coffset += reader.Position - rpos;
}
}
else
{ }
if ((UnkUint2 != 0) || (UnkUint3 != 0) || (UnkUint4 != 0) || (UnkUint5 != 0))
{ }
if ((UnkUshort4 != 0) && (UnkUshort4 != 1)) //1 in carbonrs.yft, policeb.yft, vader.yft
{ }
if ((UnkUshort5 != 2) && (UnkUshort5 != 2050)) //2050 in cablecar.yft, submersible2.yft
{ }
}
public void Write(ResourceDataWriter writer)
{
writer.Write(UnkMatrix);
writer.Write(UnkUint1);
writer.Write(ItemID);
writer.Write(UnkUshort1);
writer.Write(UnkUshort2);
writer.Write(ItemDataCount);
writer.Write(ItemDataByteLength);
writer.Write(UnkUshort3);
writer.Write(UnkUint2);
writer.Write(UnkUint3);
writer.Write(UnkFloat0);
writer.Write(UnkFloat1);
writer.Write(UnkUshort4);
writer.Write(UnkUshort5);
writer.Write(UnkFloat2);
writer.Write(UnkUint4);
writer.Write(UnkUint5);
writer.WriteStructs(ItemDataOffsets);
if (ItemDatas != null)
{
foreach (var ud in ItemDatas)
{
ud.Write(writer);
}
}
if (Leftovers != null)
{
writer.Write(Leftovers);
}
}
public override string ToString()
{
return ItemID.ToString() + ": " + UnkUshort1.ToString() + ": " + UnkUshort2.ToString() + ": " + ItemDataCount.ToString() + ": " + ItemDataByteLength.ToString() + ": " + UnkUshort3.ToString();
}
}
[TypeConverter(typeof(ExpandableObjectConverter))] public class ItemDataStruct
{
public byte UnkByte0 { get; set; }
public byte UnkByte1 { get; set; }
public byte[] UnkBytes { get; set; }
public byte[] Leftovers { get; set; }//still contains some data. how to read it properly? TODO: getrid of this
public uint TotalLength
{
get
{
uint bc = 2;
bc += (uint)(UnkBytes?.Length ?? 0);
bc += (uint)(Leftovers?.Length ?? 0);
return bc;
}
}
public void Read(ResourceDataReader reader)
{
UnkByte0 = reader.ReadByte();//start?
UnkByte1 = reader.ReadByte();//end?
int n = (UnkByte1 - UnkByte0) + 2;
if (n > 0)
{
UnkBytes = reader.ReadBytes(n);
}
else if (n < 0)
{ }
}
public void Write(ResourceDataWriter writer)
{
writer.Write(UnkByte0);
writer.Write(UnkByte1);
if (UnkBytes != null)
{
writer.Write(UnkBytes);
}
if (Leftovers != null)
{
writer.Write(Leftovers);
}
}
public override string ToString()
{
return UnkByte0.ToString() + ": " + UnkByte1.ToString();
}
}
// structure data
public uint Unknown_0h { get; set; } // 0x56475748
public uint Unknown_4h { get; set; }
public uint Unknown_0h { get; set; } = 0x56475748; // "VGWH" ...vehicle glass window H..?
public ushort Unknown_4h { get; set; } = 112;// = length of item headers
public ushort ItemCount { get; set; }
public uint TotalLength { get; set; }
public uint Unknown_Ch { get; set; }
public byte[] Data { get; set; }
public ItemOffsetStruct[] ItemOffsets { get; set; }
public uint UnkUint0 { get; set; } = 0;
public ItemStruct[] Items { get; set; }
public byte[] Leftovers { get; set; } //leftover (unparsed) data, should just be padding. TODO: getrid of this!
/// <summary>
/// Reads the data-block from a stream.
@ -2041,11 +2222,62 @@ namespace CodeWalker.GameFiles
public override void Read(ResourceDataReader reader, params object[] parameters)
{
// read structure data
this.Unknown_0h = reader.ReadUInt32();
this.Unknown_4h = reader.ReadUInt32();
this.TotalLength = reader.ReadUInt32();
this.Unknown_Ch = reader.ReadUInt32();
this.Data = reader.ReadBytes((int)TotalLength - 16);
Unknown_0h = reader.ReadUInt32(); // "VGWH" ...vehicle glass window H..?
Unknown_4h = reader.ReadUInt16(); //112 = length of item headers
ItemCount = reader.ReadUInt16();
TotalLength = reader.ReadUInt32();
ItemOffsets = reader.ReadStructs<ItemOffsetStruct>(ItemCount + (ItemCount & 1u)); //offsets in here start at just after UnkUint0
UnkUint0 = reader.ReadUInt32();//0
long coffset = 16 + ItemOffsets.Length*8;
Items = new ItemStruct[ItemCount];
for (int i = 0; i < ItemCount; i++)
{
var us1 = ItemOffsets[i];
var cbrem = us1.Offset - coffset;
if (cbrem > 0)
{
var leftovers = reader.ReadBytes((int)cbrem);
if (i > 0)
{
Items[i - 1].Leftovers = leftovers;
}
else
{ }
coffset += cbrem;
}
else if (cbrem < 0)
{ }
var rpos = reader.Position;
var u = new ItemStruct();
u.Read(reader);
Items[i] = u;
coffset += reader.Position - rpos;
}
var leftover = (int)(TotalLength - coffset);
if (leftover > 0)
{
Leftovers = reader.ReadBytes(leftover);
if (ItemCount > 0)
{
Items[ItemCount - 1].Leftovers = Leftovers;
Leftovers = null;//hackity hack
}
else
{ }
}
else if (leftover < 0)
{ }
if (Unknown_4h != 112)
{ }
if (UnkUint0 != 0)
{ }
}
/// <summary>
@ -2053,14 +2285,35 @@ namespace CodeWalker.GameFiles
/// </summary>
public override void Write(ResourceDataWriter writer, params object[] parameters)
{
TotalLength = (uint)(Data?.Length ?? 0) + 16;
long bc = 16;
bc += ItemOffsets.Length*8;
foreach (var ud2 in Items)
{
bc += ud2.TotalLength;
}
bc += (uint)(Leftovers?.Length ?? 0);
TotalLength = (uint)bc;
// write structure data
writer.Write(this.Unknown_0h);
writer.Write(this.Unknown_4h);
writer.Write(this.ItemCount);
writer.Write(this.TotalLength);
writer.Write(this.Unknown_Ch);
writer.Write(Data);
writer.WriteStructs(ItemOffsets);
writer.Write(UnkUint0);
foreach (var ud2 in Items)
{
ud2.Write(writer);
}
if (Leftovers != null)
{
writer.Write(Leftovers);
}
}
}

View File

@ -492,7 +492,7 @@ namespace CodeWalker.World
byte cr2 = (v2.NotFirst) ? (byte)255 : (byte)0;
byte cg = 0;// (chain._Data.Unk_1156691834 > 1) ? (byte)255 : (byte)0;
//cg = ((v1.Unk1 != 0) || (v2.Unk1 != 0)) ? (byte)255 : (byte)0;
//cg = (edge.Action == Unk_3609807418.Unk_7865678) ? (byte)255 : (byte)0;
//cg = (edge.Action == CScenarioChainingEdge__eAction.Unk_7865678) ? (byte)255 : (byte)0;
//cg = ((v1.UnkValTest != 0) || (v2.UnkValTest != 0)) ? (byte)255 : (byte)0;
byte cb1 = (byte)(255 - cr1);

View File

@ -186,32 +186,32 @@ namespace CodeWalker.Project.Panels
ScenarioChainEdgeActionComboBox.Items.Clear();
ScenarioChainEdgeActionComboBox.Items.Add(Unk_3609807418.Move);
ScenarioChainEdgeActionComboBox.Items.Add(Unk_3609807418.Unk_7865678);
ScenarioChainEdgeActionComboBox.Items.Add(Unk_3609807418.MoveFollowMaster);
ScenarioChainEdgeActionComboBox.Items.Add(CScenarioChainingEdge__eAction.Move);
ScenarioChainEdgeActionComboBox.Items.Add(CScenarioChainingEdge__eAction.Unk_7865678);
ScenarioChainEdgeActionComboBox.Items.Add(CScenarioChainingEdge__eAction.MoveFollowMaster);
ScenarioChainEdgeNavModeComboBox.Items.Clear();
ScenarioChainEdgeNavModeComboBox.Items.Add(Unk_3971773454.Direct);
ScenarioChainEdgeNavModeComboBox.Items.Add(Unk_3971773454.NavMesh);
ScenarioChainEdgeNavModeComboBox.Items.Add(Unk_3971773454.Roads);
ScenarioChainEdgeNavModeComboBox.Items.Add(CScenarioChainingEdge__eNavMode.Direct);
ScenarioChainEdgeNavModeComboBox.Items.Add(CScenarioChainingEdge__eNavMode.NavMesh);
ScenarioChainEdgeNavModeComboBox.Items.Add(CScenarioChainingEdge__eNavMode.Roads);
ScenarioChainEdgeNavSpeedComboBox.Items.Clear();
ScenarioChainEdgeNavSpeedComboBox.Items.Add(Unk_941086046.Unk_00_3279574318);
ScenarioChainEdgeNavSpeedComboBox.Items.Add(Unk_941086046.Unk_01_2212923970);
ScenarioChainEdgeNavSpeedComboBox.Items.Add(Unk_941086046.Unk_02_4022799658);
ScenarioChainEdgeNavSpeedComboBox.Items.Add(Unk_941086046.Unk_03_1425672334);
ScenarioChainEdgeNavSpeedComboBox.Items.Add(Unk_941086046.Unk_04_957720931);
ScenarioChainEdgeNavSpeedComboBox.Items.Add(Unk_941086046.Unk_05_3795195414);
ScenarioChainEdgeNavSpeedComboBox.Items.Add(Unk_941086046.Unk_06_2834622009);
ScenarioChainEdgeNavSpeedComboBox.Items.Add(Unk_941086046.Unk_07_1876554076);
ScenarioChainEdgeNavSpeedComboBox.Items.Add(Unk_941086046.Unk_08_698543797);
ScenarioChainEdgeNavSpeedComboBox.Items.Add(Unk_941086046.Unk_09_1544199634);
ScenarioChainEdgeNavSpeedComboBox.Items.Add(Unk_941086046.Unk_10_2725613303);
ScenarioChainEdgeNavSpeedComboBox.Items.Add(Unk_941086046.Unk_11_4033265820);
ScenarioChainEdgeNavSpeedComboBox.Items.Add(Unk_941086046.Unk_12_3054809929);
ScenarioChainEdgeNavSpeedComboBox.Items.Add(Unk_941086046.Unk_13_3911005380);
ScenarioChainEdgeNavSpeedComboBox.Items.Add(Unk_941086046.Unk_14_3717649022);
ScenarioChainEdgeNavSpeedComboBox.Items.Add(Unk_941086046.Unk_15_3356026130);
ScenarioChainEdgeNavSpeedComboBox.Items.Add(CScenarioChainingEdge__eNavSpeed.Unk_00_3279574318);
ScenarioChainEdgeNavSpeedComboBox.Items.Add(CScenarioChainingEdge__eNavSpeed.Unk_01_2212923970);
ScenarioChainEdgeNavSpeedComboBox.Items.Add(CScenarioChainingEdge__eNavSpeed.Unk_02_4022799658);
ScenarioChainEdgeNavSpeedComboBox.Items.Add(CScenarioChainingEdge__eNavSpeed.Unk_03_1425672334);
ScenarioChainEdgeNavSpeedComboBox.Items.Add(CScenarioChainingEdge__eNavSpeed.Unk_04_957720931);
ScenarioChainEdgeNavSpeedComboBox.Items.Add(CScenarioChainingEdge__eNavSpeed.Unk_05_3795195414);
ScenarioChainEdgeNavSpeedComboBox.Items.Add(CScenarioChainingEdge__eNavSpeed.Unk_06_2834622009);
ScenarioChainEdgeNavSpeedComboBox.Items.Add(CScenarioChainingEdge__eNavSpeed.Unk_07_1876554076);
ScenarioChainEdgeNavSpeedComboBox.Items.Add(CScenarioChainingEdge__eNavSpeed.Unk_08_698543797);
ScenarioChainEdgeNavSpeedComboBox.Items.Add(CScenarioChainingEdge__eNavSpeed.Unk_09_1544199634);
ScenarioChainEdgeNavSpeedComboBox.Items.Add(CScenarioChainingEdge__eNavSpeed.Unk_10_2725613303);
ScenarioChainEdgeNavSpeedComboBox.Items.Add(CScenarioChainingEdge__eNavSpeed.Unk_11_4033265820);
ScenarioChainEdgeNavSpeedComboBox.Items.Add(CScenarioChainingEdge__eNavSpeed.Unk_12_3054809929);
ScenarioChainEdgeNavSpeedComboBox.Items.Add(CScenarioChainingEdge__eNavSpeed.Unk_13_3911005380);
ScenarioChainEdgeNavSpeedComboBox.Items.Add(CScenarioChainingEdge__eNavSpeed.Unk_14_3717649022);
ScenarioChainEdgeNavSpeedComboBox.Items.Add(CScenarioChainingEdge__eNavSpeed.Unk_15_3356026130);
}
@ -1896,7 +1896,7 @@ namespace CodeWalker.Project.Panels
{
if (populatingui) return;
if (CurrentScenarioChainEdge == null) return;
Unk_3609807418 v = (Unk_3609807418)ScenarioChainEdgeActionComboBox.SelectedItem;
CScenarioChainingEdge__eAction v = (CScenarioChainingEdge__eAction)ScenarioChainEdgeActionComboBox.SelectedItem;
lock (ProjectForm.ProjectSyncRoot)
{
if (CurrentScenarioChainEdge.Action != v)
@ -1911,7 +1911,7 @@ namespace CodeWalker.Project.Panels
{
if (populatingui) return;
if (CurrentScenarioChainEdge == null) return;
Unk_3971773454 v = (Unk_3971773454)ScenarioChainEdgeNavModeComboBox.SelectedItem;
CScenarioChainingEdge__eNavMode v = (CScenarioChainingEdge__eNavMode)ScenarioChainEdgeNavModeComboBox.SelectedItem;
lock (ProjectForm.ProjectSyncRoot)
{
if (CurrentScenarioChainEdge.NavMode != v)
@ -1926,7 +1926,7 @@ namespace CodeWalker.Project.Panels
{
if (populatingui) return;
if (CurrentScenarioChainEdge == null) return;
Unk_941086046 v = (Unk_941086046)ScenarioChainEdgeNavSpeedComboBox.SelectedItem;
CScenarioChainingEdge__eNavSpeed v = (CScenarioChainingEdge__eNavSpeed)ScenarioChainEdgeNavSpeedComboBox.SelectedItem;
lock (ProjectForm.ProjectSyncRoot)
{
if (CurrentScenarioChainEdge.NavSpeed != v)

View File

@ -154,7 +154,7 @@ namespace CodeWalker.Project.Panels
for (int j = 0; j < skeleton.Bones.Data.Count; j++)
{
var tbone = skeleton.Bones.Data[j];
if (tbone.Id == la.BoneId)
if (tbone.Tag == la.BoneId)
{
boneidx = j;
bone = tbone;

View File

@ -4263,9 +4263,9 @@ namespace CodeWalker.Project
if (vals[0].StartsWith("X")) continue;
Vector3 pos = Vector3.Zero;
float dir = 0;
var action = Unk_3609807418.Move;
var navMode = Unk_3971773454.Direct;
var navSpeed = Unk_941086046.Unk_00_3279574318;
var action = CScenarioChainingEdge__eAction.Move;
var navMode = CScenarioChainingEdge__eNavMode.Direct;
var navSpeed = CScenarioChainingEdge__eNavSpeed.Unk_00_3279574318;
var stype = new ScenarioTypeRef(defaulttype);
var modelset = defaultmodelset;
var flags = defaultflags;
@ -4284,15 +4284,15 @@ namespace CodeWalker.Project
byte nsb = 0;
byte.TryParse(vals[4].Trim(), out nsb);
if (nsb > 15) nsb = 15;
navSpeed = (Unk_941086046)nsb;
navSpeed = (CScenarioChainingEdge__eNavSpeed)nsb;
}
if (vals.Length > 5)
{
switch (vals[5].Trim())
{
case "Direct": navMode = Unk_3971773454.Direct; break;
case "NavMesh": navMode = Unk_3971773454.NavMesh; break;
case "Roads": navMode = Unk_3971773454.Roads; break;
case "Direct": navMode = CScenarioChainingEdge__eNavMode.Direct; break;
case "NavMesh": navMode = CScenarioChainingEdge__eNavMode.NavMesh; break;
case "Roads": navMode = CScenarioChainingEdge__eNavMode.Roads; break;
}
}
if (vals.Length > 6)

View File

@ -165,10 +165,10 @@ namespace CodeWalker.Rendering
if (fd != null)
{
var frag = fd.OwnerFragment;
var pose = frag?.Unknown_A8h_Data;
if ((pose != null) && (pose.Data != null)) //seems to be the default pose
var pose = frag?.BoneTransforms;
if ((pose != null) && (pose.Items != null)) //seems to be the default pose
{
var posebonecount = pose.Data.Length;
var posebonecount = pose.Items.Length;
if ((modeltransforms == null))// || (modeltransforms.Length != posebonecount))
{
modeltransforms = new Matrix[posebonecount];
@ -177,7 +177,7 @@ namespace CodeWalker.Rendering
var maxbonecount = Math.Min(posebonecount, modelbonecount);
for (int i = 0; i < maxbonecount; i++)
{
var p = pose.Data[i];
var p = pose.Items[i];
Vector4 r1 = p.Row1;
Vector4 r2 = p.Row2;
Vector4 r3 = p.Row3;
@ -260,7 +260,7 @@ namespace CodeWalker.Rendering
if (bone != null)
{
if (ModelBoneLinks == null) ModelBoneLinks = new Dictionary<ushort, RenderableModel>();
ModelBoneLinks[bone.Id] = model;
ModelBoneLinks[bone.Tag] = model;
}
}
@ -481,7 +481,7 @@ namespace CodeWalker.Rendering
//update model's transform from animated bone
RenderableModel bmodel = null;
ModelBoneLinks?.TryGetValue(bone.Id, out bmodel);
ModelBoneLinks?.TryGetValue(bone.Tag, out bmodel);
if (bmodel == null)