Skip to content

Commit

Permalink
Changes for 14144058
Browse files Browse the repository at this point in the history
  • Loading branch information
monkeyman192 committed Apr 23, 2024
1 parent 09701cd commit 400a06b
Show file tree
Hide file tree
Showing 11 changed files with 89 additions and 91 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,27 @@ namespace libMBIN.NMS.Toolkit
[NMS(GUID = 0x3705D946A3B218D4, NameHash = 0xA74EA06001E7577E)]
public class TkGeometryData : NMSTemplate
{
/* 0x000 */ public int VertexCount;
/* 0x004 */ public int IndexCount;
/* 0x008 */ public int Indices16Bit;
/* 0x00C */ public int CollisionIndexCount;
/* 0x010 */ public List<TkJointBindingData> JointBindings;
/* 0x020 */ public List<TkJointExtentData> JointExtents;
/* 0x030 */ public List<int> JointMirrorPairs;
/* 0x040 */ public List<TkJointMirrorAxis> JointMirrorAxes;
/* 0x050 */ public List<int> SkinMatrixLayout;
/* 0x060 */ public List<int> MeshVertRStart;
/* 0x070 */ public List<int> MeshVertREnd;
/* 0x080 */ public List<int> BoundHullVertSt;
/* 0x090 */ public List<int> BoundHullVertEd;
/* 0x0A0 */ public List<int> MeshBaseSkinMat;
/* 0x0B0 */ public List<Vector4f> MeshAABBMin;
/* 0x000 */ public TkVertexLayout SmallVertexLayout;
/* 0x020 */ public TkVertexLayout VertexLayout;
/* 0x040 */ public List<int> BoundHullVertEd;
/* 0x050 */ public List<Vector4f> BoundHullVerts;
/* 0x060 */ public List<int> BoundHullVertSt;
/* 0x070 */ public List<int> IndexBuffer;
/* 0x080 */ public List<TkJointBindingData> JointBindings;
/* 0x090 */ public List<TkJointExtentData> JointExtents;
/* 0x0A0 */ public List<TkJointMirrorAxis> JointMirrorAxes;
/* 0x0B0 */ public List<int> JointMirrorPairs;
/* 0x0C0 */ public List<Vector4f> MeshAABBMax;
/* 0x0D0 */ public List<Vector4f> BoundHullVerts;
/* 0x0E0 */ public TkVertexLayout VertexLayout;
/* 0x100 */ public TkVertexLayout SmallVertexLayout;
/* 0x120 */ public List<int> IndexBuffer;
/* 0x130 */ public List<TkMeshMetaData> StreamMetaDataArray;
/* 0x0D0 */ public List<Vector4f> MeshAABBMin;
/* 0x0E0 */ public List<int> MeshBaseSkinMat;
/* 0x0F0 */ public List<int> MeshVertREnd;
/* 0x100 */ public List<int> MeshVertRStart;
/* 0x110 */ public List<int> SkinMatrixLayout;
/* 0x120 */ public List<TkMeshMetaData> StreamMetaDataArray;
/* 0x130 */ public int CollisionIndexCount;
/* 0x134 */ public int IndexCount;
/* 0x138 */ public int Indices16Bit;
/* 0x13C */ public int VertexCount;

// TODO: add the list ending to this??
public override bool CustomSerialize(BinaryWriter writer, Type field, object fieldData, NMSAttribute settings, FieldInfo fieldInfo, ref List<Tuple<long, object>> additionalData, ref int addtDataIndex) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class TkMeshData : NMSTemplate
/* 0x18 */ public int IndexDataSize;
/* 0x1C */ public int VertexDataSize;
[NMS(Size = 0x80, Padding = 0xFE)]
/* 0x20 */ public NMSString0x80 IdString;
/* 0x20 */ public string IdString;

public override object CustomDeserialize( BinaryReader reader, Type field, NMSAttribute settings, FieldInfo fieldInfo ) {
var fieldName = fieldInfo.Name;
Expand Down
4 changes: 3 additions & 1 deletion libMBIN/Source/MBIN/MBINHeader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ public class MBINHeader : NMSTemplate
{
internal const uint MBIN_MAGIC = 0xCCCCCCCC; // MBIN format ID
internal const uint MBIN_MAGIC_PC = 0xDDDDDDDD; // only used by TkGeometryData and TkGeometryStreamData (*.MBIN.PC)
internal const uint MBIN_VERSION = 2500; // vanilla version
// Note: The MBIN_VERSION used to be 2500, but as of the 14144058 steam version this changed to 3250,
// presumably to indicate that the file format is indeed different (fields became ordered, probably for optimization reasons...)
internal const uint MBIN_VERSION = 3250; // vanilla version

// used for format V1
internal const ulong MBINCVER_TAG = 0x726576434E49424D; // "revCNIBM" ("MBINCver")
Expand Down
36 changes: 18 additions & 18 deletions libMBIN/Source/NMS/GameComponents/GcPlayerStateData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,24 +102,24 @@ public class GcPlayerStateData : NMSTemplate
/* 0x71A50 */ public GcStoryPageSeenDataArray[] SeenStories;
[NMS(Size = 0x4, EnumType = typeof(GcSynchronisedBufferType.SyncBufferTypeEnum))]
/* 0x71AE0 */ public GcSyncBufferSaveDataArray[] SyncBuffersData;
/* 0x71CB8 */ public GcPortalSaveData VisitedPortal;
/* 0x71B20 */ public GcInventoryLayout Chest10Layout;
/* 0x71B38 */ public GcInventoryLayout Chest1Layout;
/* 0x71B50 */ public GcInventoryLayout Chest2Layout;
/* 0x71B68 */ public GcInventoryLayout Chest3Layout;
/* 0x71B80 */ public GcInventoryLayout Chest4Layout;
/* 0x71B98 */ public GcInventoryLayout Chest5Layout;
/* 0x71BB0 */ public GcInventoryLayout Chest6Layout;
/* 0x71BC8 */ public GcInventoryLayout Chest7Layout;
/* 0x71BE0 */ public GcInventoryLayout Chest8Layout;
/* 0x71BF8 */ public GcInventoryLayout Chest9Layout;
/* 0x71C10 */ public GcInventoryLayout ChestMagic2Layout;
/* 0x71C28 */ public GcInventoryLayout ChestMagicLayout;
/* 0x71C40 */ public GcInventoryLayout CookingIngredientsLayout;
/* 0x71C58 */ public GcInventoryLayout FreighterCargoLayout;
/* 0x71C70 */ public GcInventoryLayout FreighterLayout;
/* 0x71C88 */ public GcInventoryLayout RocketLockerLayout;
/* 0x71CA0 */ public GcInventoryLayout ShipLayout;
/* 0x71B20 */ public GcPortalSaveData VisitedPortal;
/* 0x71B40 */ public GcInventoryLayout Chest10Layout;
/* 0x71B58 */ public GcInventoryLayout Chest1Layout;
/* 0x71B70 */ public GcInventoryLayout Chest2Layout;
/* 0x71B88 */ public GcInventoryLayout Chest3Layout;
/* 0x71BA0 */ public GcInventoryLayout Chest4Layout;
/* 0x71BB8 */ public GcInventoryLayout Chest5Layout;
/* 0x71BD0 */ public GcInventoryLayout Chest6Layout;
/* 0x71BE8 */ public GcInventoryLayout Chest7Layout;
/* 0x71C00 */ public GcInventoryLayout Chest8Layout;
/* 0x71C18 */ public GcInventoryLayout Chest9Layout;
/* 0x71C30 */ public GcInventoryLayout ChestMagic2Layout;
/* 0x71C48 */ public GcInventoryLayout ChestMagicLayout;
/* 0x71C60 */ public GcInventoryLayout CookingIngredientsLayout;
/* 0x71C78 */ public GcInventoryLayout FreighterCargoLayout;
/* 0x71C90 */ public GcInventoryLayout FreighterLayout;
/* 0x71CA8 */ public GcInventoryLayout RocketLockerLayout;
/* 0x71CC0 */ public GcInventoryLayout ShipLayout;
/* 0x71CD8 */ public GcInventoryLayout WeaponLayout;
/* 0x71CF0 */ public NMSString0x10 BannerTitleId;
/* 0x71D00 */ public List<GcPersistentBBObjectData> BaseBuildingObjects;
Expand Down
8 changes: 4 additions & 4 deletions libMBIN/Source/NMS/Globals/GcUIGlobals.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ public class GcUIGlobals : NMSTemplate
/* 0x2310 */ public TkNGuiTreeViewTemplate FileBrowserTreeViewTemplate;
/* 0x2390 */ public TkNGuiTreeViewTemplate SceneInfoTreeViewTemplate;
/* 0x2410 */ public TkNGuiTreeViewTemplate SkeletonToolsTreeViewTemplate;
/* 0x2530 */ public GcScanEffectData DebugEditorPreviewEffect;
/* 0x2580 */ public GcScanEffectData FreighterSummonScanEffect;
/* 0x2490 */ public GcHUDEffectRewardData OSDEpicItemRewardEffect;
/* 0x24E0 */ public GcHUDEffectRewardData OSDRareItemRewardEffect;
/* 0x2490 */ public GcScanEffectData DebugEditorPreviewEffect;
/* 0x24E0 */ public GcScanEffectData FreighterSummonScanEffect;
/* 0x2530 */ public GcHUDEffectRewardData OSDEpicItemRewardEffect;
/* 0x2580 */ public GcHUDEffectRewardData OSDRareItemRewardEffect;
/* 0x25D0 */ public GcScanEffectData TargetDisplayScanEffect;
[NMS(Size = 0x4, EnumType = typeof(GcGalaxyStarTypes.GalaxyStarTypeEnum))]
/* 0x2620 */ public Colour[] SystemHooverLEDColours;
Expand Down
40 changes: 20 additions & 20 deletions libMBIN/Source/NMS/Toolkit/TkGeometryData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,27 @@ namespace libMBIN.NMS.Toolkit
[NMS(GUID = 0x3705D946A3B218D4, NameHash = 0xA74EA06001E7577E)]
public class TkGeometryData : NMSTemplate
{
/* 0x000 */ public int VertexCount;
/* 0x004 */ public int IndexCount;
/* 0x008 */ public int Indices16Bit;
/* 0x00C */ public int CollisionIndexCount;
/* 0x010 */ public List<TkJointBindingData> JointBindings;
/* 0x020 */ public List<TkJointExtentData> JointExtents;
/* 0x030 */ public List<int> JointMirrorPairs;
/* 0x040 */ public List<TkJointMirrorAxis> JointMirrorAxes;
/* 0x050 */ public List<int> SkinMatrixLayout;
/* 0x060 */ public List<int> MeshVertRStart;
/* 0x070 */ public List<int> MeshVertREnd;
/* 0x080 */ public List<int> BoundHullVertSt;
/* 0x090 */ public List<int> BoundHullVertEd;
/* 0x0A0 */ public List<int> MeshBaseSkinMat;
/* 0x0B0 */ public List<Vector4f> MeshAABBMin;
/* 0x000 */ public TkVertexLayout SmallVertexLayout;
/* 0x020 */ public TkVertexLayout VertexLayout;
/* 0x040 */ public List<int> BoundHullVertEd;
/* 0x050 */ public List<Vector4f> BoundHullVerts;
/* 0x060 */ public List<int> BoundHullVertSt;
/* 0x070 */ public List<int> IndexBuffer;
/* 0x080 */ public List<TkJointBindingData> JointBindings;
/* 0x090 */ public List<TkJointExtentData> JointExtents;
/* 0x0A0 */ public List<TkJointMirrorAxis> JointMirrorAxes;
/* 0x0B0 */ public List<int> JointMirrorPairs;
/* 0x0C0 */ public List<Vector4f> MeshAABBMax;
/* 0x0D0 */ public List<Vector4f> BoundHullVerts;
/* 0x0E0 */ public TkVertexLayout VertexLayout;
/* 0x100 */ public TkVertexLayout SmallVertexLayout;
/* 0x120 */ public List<int> IndexBuffer;
/* 0x130 */ public List<TkMeshMetaData> StreamMetaDataArray;
/* 0x0D0 */ public List<Vector4f> MeshAABBMin;
/* 0x0E0 */ public List<int> MeshBaseSkinMat;
/* 0x0F0 */ public List<int> MeshVertREnd;
/* 0x100 */ public List<int> MeshVertRStart;
/* 0x110 */ public List<int> SkinMatrixLayout;
/* 0x120 */ public List<TkMeshMetaData> StreamMetaDataArray;
/* 0x130 */ public int CollisionIndexCount;
/* 0x134 */ public int IndexCount;
/* 0x138 */ public int Indices16Bit;
/* 0x13C */ public int VertexCount;

// TODO: add the list ending to this??
public override bool CustomSerialize(BinaryWriter writer, Type field, object fieldData, NMSAttribute settings, FieldInfo fieldInfo, ref List<Tuple<long, object>> additionalData, ref int addtDataIndex) {
Expand Down
10 changes: 5 additions & 5 deletions libMBIN/Source/NMS/Toolkit/TkMeshData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ namespace libMBIN.NMS.Toolkit
[NMS(GUID = 0xD3AC8F6F7A4D55FC, NameHash = 0xF671716161E708E3)]
public class TkMeshData : NMSTemplate
{
/* 0x00 */ public byte[] MeshDataStream;
/* 0x10 */ public ulong Hash;
/* 0x18 */ public int IndexDataSize;
/* 0x1C */ public int VertexDataSize;
[NMS(Size = 0x80, Padding = 0xFE)]
/* 0x00 */ public string IdString;
/* 0x80 */ public ulong Hash;
/* 0x88 */ public int VertexDataSize;
/* 0x8C */ public int IndexDataSize;
/* 0x90 */ public byte[] MeshDataStream;
/* 0x20 */ public string IdString;

public override object CustomDeserialize( BinaryReader reader, Type field, NMSAttribute settings, FieldInfo fieldInfo ) {
var fieldName = fieldInfo.Name;
Expand Down
12 changes: 6 additions & 6 deletions libMBIN/Source/NMS/Toolkit/TkMeshMetaData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ namespace libMBIN.NMS.Toolkit
[NMS(GUID = 0xCD95EDB97D142FC, NameHash = 0x4CF5A27A1458612D)]
public class TkMeshMetaData : NMSTemplate
{
/* 0x00 */ public NMSString0x80 IdString;
/* 0x80 */ public ulong Hash;
/* 0x88 */ public int VertexDataSize;
/* 0x8C */ public int VertexDataOffset;
/* 0x90 */ public int IndexDataSize;
/* 0x94 */ public int IndexDataOffset;
/* 0x00 */ public ulong Hash;
/* 0x08 */ public int IndexDataOffset;
/* 0x0C */ public int IndexDataSize;
/* 0x10 */ public int VertexDataOffset;
/* 0x14 */ public int VertexDataSize;
/* 0x18 */ public NMSString0x80 IdString;
/* 0x98 */ public bool DoubleBufferGeometry;
}
}
6 changes: 1 addition & 5 deletions libMBIN/Source/NMS/Toolkit/TkSceneNodeData.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
using System;
using libMBIN.NMS.Toolkit;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Text;

using libMBIN.NMS.Toolkit;
namespace libMBIN.NMS.Toolkit
{
[NMS(GUID = 0x1DCCBBEBB4547EB4, NameHash = 0x2C1B6B0E807F7193)]
Expand Down
14 changes: 7 additions & 7 deletions libMBIN/Source/NMS/Toolkit/TkVertexElement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ namespace libMBIN.NMS.Toolkit
[NMS(GUID = 0x1E084E1510B4A072, NameHash = 0x8687A0CA8457FC32)]
public class TkVertexElement : NMSTemplate
{
/* 0x00 */ public int SemanticID;
/* 0x04 */ public int Size;
/* 0x08 */ public int Type;
/* 0x0C */ public int Offset;
/* 0x10 */ public int Normalise;
/* 0x00 */ public long PlatformData;
// size: 0x2
public enum InstancingEnum : uint {
PerVertex,
PerModel,
}
/* 0x14 */ public InstancingEnum Instancing;
/* 0x18 */ public long PlatformData;
/* 0x08 */ public InstancingEnum Instancing;
/* 0x0C */ public int Normalise;
/* 0x10 */ public int Offset;
/* 0x14 */ public int SemanticID;
/* 0x18 */ public int Size;
/* 0x1C */ public int Type;
}
}
8 changes: 4 additions & 4 deletions libMBIN/Source/NMS/Toolkit/TkVertexLayout.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ namespace libMBIN.NMS.Toolkit
[NMS(GUID = 0x74A979AD2A0CECB6, NameHash = 0xDD31F212063601F7)]
public class TkVertexLayout : NMSTemplate
{
/* 0x00 */ public int ElementCount;
/* 0x04 */ public int Stride;
/* 0x08 */ public long PlatformData;
/* 0x10 */ public List<TkVertexElement> VertexElements;
/* 0x00 */ public List<TkVertexElement> VertexElements;
/* 0x10 */ public long PlatformData;
/* 0x18 */ public int ElementCount;
/* 0x1C */ public int Stride;
}
}

0 comments on commit 400a06b

Please sign in to comment.