Skip to content

Commit 510d6d4

Browse files
authored
Merge pull request #42 from General-101/ui_update
[Tags] Undo a few post processing related values and blocks
2 parents dfebea6 + 9199c3e commit 510d6d4

5 files changed

Lines changed: 26 additions & 3 deletions

File tree

BlamLib/BlamLib/Blam/Halo2/Tags/Code/Models.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,17 @@ internal void ReconstructShapeData(physics_model_group owner)
447447
};
448448
#endregion
449449

450+
#region havok shape base block
451+
partial class havok_shape_base_block
452+
{
453+
internal override bool Reconstruct(BlamLib.Blam.CacheFile c)
454+
{
455+
Phantom.Value = -1;
456+
return true;
457+
}
458+
};
459+
#endregion
460+
450461
void ReconstructRigidBodyShapeData()
451462
{
452463
foreach (var rb in RigidBodies)
@@ -458,6 +469,7 @@ internal override bool Reconstruct(BlamLib.Blam.CacheFile c)
458469
//ReconstructRigidBodyShapeData();
459470
int Object_Count = Spheres.Count + MultiSpheres.Count + Pills.Count + Boxes.Count + Triangles.Count + Polyhedra.Count;
460471
MassDistributions.Resize(Object_Count);//TODO: Find a proper way to generate values for this. This fix will only go so far.
472+
Phantoms.DeleteAll();
461473

462474
return true;
463475
}

BlamLib/BlamLib/Blam/Halo2/Tags/Code/Objects.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,14 @@ partial class havok_vehicle_physics_struct
5656
#region Reconstruct
5757
internal override bool Reconstruct(BlamLib.Blam.CacheFile c)
5858
{
59+
/*
60+
If gravity scale is set to 0 then it is turned into a 1 on package.
61+
0.001 should turn into a 0 on package instead of a 1
62+
*/
63+
if (gravity_scale.Value == 0)
64+
{
65+
gravity_scale.Value = 0.001f;
66+
}
5967
shape_phantom_shape.DeleteAll();
6068
return true;
6169
}

BlamLib/BlamLib/Blam/Halo2/Tags/Code/Resources.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ partial class bitmap_data_block
2323
internal override bool Reconstruct(BlamLib.Blam.CacheFile c)
2424
{
2525
LowDetailMipmapCount.Value = 0;
26+
// remove extra flags that will make the HEK think the tag is invalid
27+
Flags.Value &= 0xff;
2628
return true;
2729
}
2830

@@ -485,4 +487,4 @@ public override bool Contains(string path, uint group_tag)
485487
return lookup.ContainsKey(new Entry(path, group_tag));
486488
}
487489
};
488-
}
490+
}

BlamLib/BlamLib/Blam/Halo2/Tags/Models.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1454,7 +1454,7 @@ public hkSphereShape(TI.Definition parent) : base(parent) {}
14541454

14551455
// I made this up. Up this made I. Not a real definition.
14561456
#region havok_shape_base_block
1457-
public abstract class havok_shape_base_block : TI.Definition
1457+
public partial class havok_shape_base_block : TI.Definition
14581458
{
14591459
public TI.StringId Name;
14601460
public TI.BlockIndex Material;

BlamLib/BlamLib/Blam/Halo2/Tags/Objects.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2130,6 +2130,7 @@ public vehicle_phantom_shape_block() : base(108)
21302130
#endregion
21312131

21322132
#region Fields
2133+
public TI.Real gravity_scale;
21332134
public TI.Block<vehicle_phantom_shape_block> shape_phantom_shape;
21342135
#endregion
21352136

@@ -2146,7 +2147,7 @@ public havok_vehicle_physics_struct() : base(15)
21462147
Add(new TI.Pad(16));
21472148
Add(/*anti_gravity_bank_lift = */ new TI.Real());
21482149
Add(/*steering_bank_reaction_scale = */ new TI.Real());
2149-
Add(/*gravity scale = */ new TI.Real());
2150+
Add(gravity_scale = new TI.Real());
21502151
Add(/*radius = */ new TI.Real());
21512152
Add(/*anti gravity points = */ new TI.Block<anti_gravity_point_definition_block>(this, 16));
21522153
Add(/*friction points = */ new TI.Block<friction_point_definition_block>(this, 16));

0 commit comments

Comments
 (0)