Skip to content

Commit

Permalink
Merge pull request #42 from General-101/ui_update
Browse files Browse the repository at this point in the history
[Tags] Undo a few post processing related values and blocks
  • Loading branch information
num0005 authored Oct 18, 2019
2 parents dfebea6 + 9199c3e commit 510d6d4
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 3 deletions.
12 changes: 12 additions & 0 deletions BlamLib/BlamLib/Blam/Halo2/Tags/Code/Models.cs
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,17 @@ internal void ReconstructShapeData(physics_model_group owner)
};
#endregion

#region havok shape base block
partial class havok_shape_base_block
{
internal override bool Reconstruct(BlamLib.Blam.CacheFile c)
{
Phantom.Value = -1;
return true;
}
};
#endregion

void ReconstructRigidBodyShapeData()
{
foreach (var rb in RigidBodies)
Expand All @@ -458,6 +469,7 @@ internal override bool Reconstruct(BlamLib.Blam.CacheFile c)
//ReconstructRigidBodyShapeData();
int Object_Count = Spheres.Count + MultiSpheres.Count + Pills.Count + Boxes.Count + Triangles.Count + Polyhedra.Count;
MassDistributions.Resize(Object_Count);//TODO: Find a proper way to generate values for this. This fix will only go so far.
Phantoms.DeleteAll();

return true;
}
Expand Down
8 changes: 8 additions & 0 deletions BlamLib/BlamLib/Blam/Halo2/Tags/Code/Objects.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@ partial class havok_vehicle_physics_struct
#region Reconstruct
internal override bool Reconstruct(BlamLib.Blam.CacheFile c)
{
/*
If gravity scale is set to 0 then it is turned into a 1 on package.
0.001 should turn into a 0 on package instead of a 1
*/
if (gravity_scale.Value == 0)
{
gravity_scale.Value = 0.001f;
}
shape_phantom_shape.DeleteAll();
return true;
}
Expand Down
4 changes: 3 additions & 1 deletion BlamLib/BlamLib/Blam/Halo2/Tags/Code/Resources.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ partial class bitmap_data_block
internal override bool Reconstruct(BlamLib.Blam.CacheFile c)
{
LowDetailMipmapCount.Value = 0;
// remove extra flags that will make the HEK think the tag is invalid
Flags.Value &= 0xff;
return true;
}

Expand Down Expand Up @@ -485,4 +487,4 @@ public override bool Contains(string path, uint group_tag)
return lookup.ContainsKey(new Entry(path, group_tag));
}
};
}
}
2 changes: 1 addition & 1 deletion BlamLib/BlamLib/Blam/Halo2/Tags/Models.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1454,7 +1454,7 @@ public hkSphereShape(TI.Definition parent) : base(parent) {}

// I made this up. Up this made I. Not a real definition.
#region havok_shape_base_block
public abstract class havok_shape_base_block : TI.Definition
public partial class havok_shape_base_block : TI.Definition
{
public TI.StringId Name;
public TI.BlockIndex Material;
Expand Down
3 changes: 2 additions & 1 deletion BlamLib/BlamLib/Blam/Halo2/Tags/Objects.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2130,6 +2130,7 @@ public vehicle_phantom_shape_block() : base(108)
#endregion

#region Fields
public TI.Real gravity_scale;
public TI.Block<vehicle_phantom_shape_block> shape_phantom_shape;
#endregion

Expand All @@ -2146,7 +2147,7 @@ public havok_vehicle_physics_struct() : base(15)
Add(new TI.Pad(16));
Add(/*anti_gravity_bank_lift = */ new TI.Real());
Add(/*steering_bank_reaction_scale = */ new TI.Real());
Add(/*gravity scale = */ new TI.Real());
Add(gravity_scale = new TI.Real());
Add(/*radius = */ new TI.Real());
Add(/*anti gravity points = */ new TI.Block<anti_gravity_point_definition_block>(this, 16));
Add(/*friction points = */ new TI.Block<friction_point_definition_block>(this, 16));
Expand Down

0 comments on commit 510d6d4

Please sign in to comment.