mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2025-02-11 06:32:59 +08:00
Merge pull request #6 from neos7/master
Edited some names in Drawable.cs
This commit is contained in:
commit
28d66c0039
@ -135,8 +135,8 @@ namespace CodeWalker.GameFiles
|
||||
private void LoadMapParentTxds(string xml)
|
||||
{
|
||||
XmlDocument xmldoc = new XmlDocument();
|
||||
xmldoc.LoadXml(xml);
|
||||
XmlNodeList items = xmldoc.SelectNodes("CMapParentTxds/txdRelationships/Item");
|
||||
xmldoc.LoadXml(xml); //maybe better load xml.ToLower() and use "cmapparenttxds/txdrelationships/item" as xpath?
|
||||
XmlNodeList items = xmldoc.SelectNodes("CMapParentTxds/txdRelationships/Item | CMapParentTxds/txdRelationships/item");
|
||||
|
||||
CMapParentTxds = new Dictionary<string, string>();
|
||||
for (int i = 0; i < items.Count; i++)
|
||||
|
@ -1031,16 +1031,16 @@ namespace CodeWalker.GameFiles
|
||||
public ushort GeometriesCount1 { get; set; }
|
||||
public ushort GeometriesCount2 { get; set; }
|
||||
public uint Unknown_14h { get; set; } // 0x00000000
|
||||
public ulong Unknown_18h_Pointer { get; set; }
|
||||
public ulong BoundsPointer { get; set; }
|
||||
public ulong ShaderMappingPointer { get; set; }
|
||||
public uint Unknown_28h { get; set; }
|
||||
public uint Unknown_2Ch { get; set; }
|
||||
public uint Unknown_2Ch { get; set; } //First byte is called "Mask" in GIMS EVO, third byte is always equal to GeometriesCount, is it ShaderMappingCount?
|
||||
|
||||
// reference data
|
||||
public ResourcePointerArray64<DrawableGeometry> Geometries { get; set; }
|
||||
//public ResourceSimpleArray<AABB_r> Unknown_18h_Data;
|
||||
//public ResourceSimpleArray<ushort_r> ShaderMapping;
|
||||
public AABB_s[] Unknown_18h_Data { get; set; }
|
||||
public AABB_s[] BoundsData { get; set; }
|
||||
public ushort[] ShaderMapping { get; set; }
|
||||
|
||||
public long MemoryUsage
|
||||
@ -1074,9 +1074,9 @@ namespace CodeWalker.GameFiles
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Unknown_18h_Data != null)
|
||||
if (BoundsData != null)
|
||||
{
|
||||
val += Unknown_18h_Data.Length * 32;
|
||||
val += BoundsData.Length * 32;
|
||||
}
|
||||
return val;
|
||||
}
|
||||
@ -1094,7 +1094,7 @@ namespace CodeWalker.GameFiles
|
||||
this.GeometriesCount1 = reader.ReadUInt16();
|
||||
this.GeometriesCount2 = reader.ReadUInt16();
|
||||
this.Unknown_14h = reader.ReadUInt32();
|
||||
this.Unknown_18h_Pointer = reader.ReadUInt64();
|
||||
this.BoundsPointer = reader.ReadUInt64();
|
||||
this.ShaderMappingPointer = reader.ReadUInt64();
|
||||
this.Unknown_28h = reader.ReadUInt32();
|
||||
this.Unknown_2Ch = reader.ReadUInt32();
|
||||
@ -1112,7 +1112,7 @@ namespace CodeWalker.GameFiles
|
||||
// this.ShaderMappingPointer, // offset
|
||||
// this.GeometriesCount1
|
||||
//);
|
||||
this.Unknown_18h_Data = reader.ReadStructsAt<AABB_s>(this.Unknown_18h_Pointer, (uint)(this.GeometriesCount1 > 1 ? this.GeometriesCount1 + 1 : this.GeometriesCount1));
|
||||
this.BoundsData = reader.ReadStructsAt<AABB_s>(this.BoundsPointer, (uint)(this.GeometriesCount1 > 1 ? this.GeometriesCount1 + 1 : this.GeometriesCount1));
|
||||
this.ShaderMapping = reader.ReadUshortsAt(this.ShaderMappingPointer, this.GeometriesCount1);
|
||||
|
||||
}
|
||||
@ -1136,7 +1136,7 @@ namespace CodeWalker.GameFiles
|
||||
writer.Write(this.GeometriesCount1);
|
||||
writer.Write(this.GeometriesCount2);
|
||||
writer.Write(this.Unknown_14h);
|
||||
writer.Write(this.Unknown_18h_Pointer);
|
||||
writer.Write(this.BoundsPointer);
|
||||
writer.Write(this.ShaderMappingPointer);
|
||||
writer.Write(this.Unknown_28h);
|
||||
writer.Write(this.Unknown_2Ch);
|
||||
@ -1189,7 +1189,7 @@ namespace CodeWalker.GameFiles
|
||||
public uint Unknown_50h { get; set; } // 0x00000000
|
||||
public uint Unknown_54h { get; set; } // 0x00000000
|
||||
public uint IndicesCount { get; set; }
|
||||
public uint Unknown_5Ch { get; set; }
|
||||
public uint TrianglesCount { get; set; }
|
||||
public ushort VerticesCount { get; set; }
|
||||
public ushort Unknown_62h { get; set; } // 0x0003
|
||||
public uint Unknown_64h { get; set; } // 0x00000000
|
||||
@ -1239,7 +1239,7 @@ namespace CodeWalker.GameFiles
|
||||
this.Unknown_50h = reader.ReadUInt32();
|
||||
this.Unknown_54h = reader.ReadUInt32();
|
||||
this.IndicesCount = reader.ReadUInt32();
|
||||
this.Unknown_5Ch = reader.ReadUInt32();
|
||||
this.TrianglesCount = reader.ReadUInt32();
|
||||
this.VerticesCount = reader.ReadUInt16();
|
||||
this.Unknown_62h = reader.ReadUInt16();
|
||||
this.Unknown_64h = reader.ReadUInt32();
|
||||
@ -1333,7 +1333,7 @@ namespace CodeWalker.GameFiles
|
||||
writer.Write(this.Unknown_50h);
|
||||
writer.Write(this.Unknown_54h);
|
||||
writer.Write(this.IndicesCount);
|
||||
writer.Write(this.Unknown_5Ch);
|
||||
writer.Write(this.TrianglesCount);
|
||||
writer.Write(this.VerticesCount);
|
||||
writer.Write(this.Unknown_62h);
|
||||
writer.Write(this.Unknown_64h);
|
||||
@ -2034,10 +2034,10 @@ namespace CodeWalker.GameFiles
|
||||
public byte ColorB { get; set; }
|
||||
public byte Unknown_1Bh { get; set; }
|
||||
public float Intensity { get; set; }
|
||||
public uint Unknown_20h { get; set; }
|
||||
public uint Flags { get; set; }
|
||||
public ushort BoneId { get; set; }
|
||||
public ushort Type { get; set; }
|
||||
public uint Unknown_28h { get; set; }
|
||||
public uint TimeFlags { get; set; }
|
||||
public float Falloff { get; set; }
|
||||
public float FalloffExponent { get; set; }
|
||||
public float CullingPlaneNormalX { get; set; }
|
||||
@ -2099,10 +2099,10 @@ namespace CodeWalker.GameFiles
|
||||
public ulong DrawableModelsMediumPointer { get; set; }
|
||||
public ulong DrawableModelsLowPointer { get; set; }
|
||||
public ulong DrawableModelsVeryLowPointer { get; set; }
|
||||
public float Unknown_70h { get; set; }
|
||||
public float Unknown_74h { get; set; }
|
||||
public float Unknown_78h { get; set; }
|
||||
public float Unknown_7Ch { get; set; }
|
||||
public float LodGroupHigh { get; set; }
|
||||
public float LodGroupMed { get; set; }
|
||||
public float LodGroupLow { get; set; }
|
||||
public float LodGroupVlow { get; set; }
|
||||
public uint Unknown_80h { get; set; }
|
||||
public uint Unknown_84h { get; set; }
|
||||
public uint Unknown_88h { get; set; }
|
||||
@ -2169,10 +2169,10 @@ namespace CodeWalker.GameFiles
|
||||
this.DrawableModelsMediumPointer = reader.ReadUInt64();
|
||||
this.DrawableModelsLowPointer = reader.ReadUInt64();
|
||||
this.DrawableModelsVeryLowPointer = reader.ReadUInt64();
|
||||
this.Unknown_70h = reader.ReadSingle();
|
||||
this.Unknown_74h = reader.ReadSingle();
|
||||
this.Unknown_78h = reader.ReadSingle();
|
||||
this.Unknown_7Ch = reader.ReadSingle();
|
||||
this.LodGroupHigh = reader.ReadSingle();
|
||||
this.LodGroupMed = reader.ReadSingle();
|
||||
this.LodGroupLow = reader.ReadSingle();
|
||||
this.LodGroupVlow = reader.ReadSingle();
|
||||
this.Unknown_80h = reader.ReadUInt32();
|
||||
this.Unknown_84h = reader.ReadUInt32();
|
||||
this.Unknown_88h = reader.ReadUInt32();
|
||||
@ -2307,10 +2307,10 @@ namespace CodeWalker.GameFiles
|
||||
writer.Write(this.DrawableModelsMediumPointer);
|
||||
writer.Write(this.DrawableModelsLowPointer);
|
||||
writer.Write(this.DrawableModelsVeryLowPointer);
|
||||
writer.Write(this.Unknown_70h);
|
||||
writer.Write(this.Unknown_74h);
|
||||
writer.Write(this.Unknown_78h);
|
||||
writer.Write(this.Unknown_7Ch);
|
||||
writer.Write(this.LodGroupHigh);
|
||||
writer.Write(this.LodGroupMed);
|
||||
writer.Write(this.LodGroupLow);
|
||||
writer.Write(this.LodGroupVlow);
|
||||
writer.Write(this.Unknown_80h);
|
||||
writer.Write(this.Unknown_84h);
|
||||
writer.Write(this.Unknown_88h);
|
||||
|
@ -282,7 +282,7 @@ namespace CodeWalker.Rendering
|
||||
Unk4h = dmodel.Unknown_4h;
|
||||
Unk14h = dmodel.Unknown_14h;
|
||||
Unk28h = dmodel.Unknown_28h;
|
||||
Unk2Ch = dmodel.Unknown_2Ch;
|
||||
Unk2Ch = dmodel.Unknown_2Ch; //only the first byte of Unknown_2Ch seems be related to this
|
||||
|
||||
|
||||
DrawableModel = dmodel;
|
||||
@ -300,9 +300,9 @@ namespace CodeWalker.Rendering
|
||||
Geometries[i] = rgeom;
|
||||
GeometrySize += rgeom.TotalDataSize;
|
||||
|
||||
if ((dmodel.Unknown_18h_Data != null) && (i < dmodel.Unknown_18h_Data.Length))
|
||||
if ((dmodel.BoundsData != null) && (i < dmodel.BoundsData.Length))
|
||||
{
|
||||
GeometryBounds[i] = dmodel.Unknown_18h_Data[i];
|
||||
GeometryBounds[i] = dmodel.BoundsData[i];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -2130,7 +2130,7 @@ namespace CodeWalker
|
||||
for (int i = 0; i < dmodels.data_items.Length; i++)
|
||||
{
|
||||
var m = dmodels.data_items[i];
|
||||
if (m.Unknown_18h_Data == null)
|
||||
if (m.BoundsData == null)
|
||||
{ usegeomboxes = false; break; }
|
||||
}
|
||||
}
|
||||
@ -2152,10 +2152,10 @@ namespace CodeWalker
|
||||
for (int i = 0; i < dmodels.data_items.Length; i++)
|
||||
{
|
||||
var m = dmodels.data_items[i];
|
||||
int gbbcount = m.Unknown_18h_Data.Length;
|
||||
int gbbcount = m.BoundsData.Length;
|
||||
for (int j = 0; j < gbbcount; j++) //first box seems to be whole model
|
||||
{
|
||||
var gbox = m.Unknown_18h_Data[j];
|
||||
var gbox = m.BoundsData[j];
|
||||
gbbox.Minimum = gbox.Min.XYZ();
|
||||
gbbox.Maximum = gbox.Max.XYZ();
|
||||
bbox.Minimum = gbbox.Minimum * scale;
|
||||
|
Loading…
Reference in New Issue
Block a user