Skip to content

Commit

Permalink
fix compilation for Release-builds by adding more [[maybe_unused]] st…
Browse files Browse the repository at this point in the history
…atements (#1051)
  • Loading branch information
crocdialer authored Apr 12, 2024
1 parent 1564caf commit d58e655
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Jolt/Physics/Collision/Shape/ConvexShape.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class JPH_EXPORT ConvexShape : public Shape
virtual uint GetSubShapeIDBitsRecursive() const override { return 0; } // Convex shapes don't have sub shapes

// See Shape::GetMaterial
virtual const PhysicsMaterial * GetMaterial(const SubShapeID &inSubShapeID) const override { JPH_ASSERT(inSubShapeID.IsEmpty(), "Invalid subshape ID"); return GetMaterial(); }
virtual const PhysicsMaterial * GetMaterial([[maybe_unused]] const SubShapeID &inSubShapeID) const override { JPH_ASSERT(inSubShapeID.IsEmpty(), "Invalid subshape ID"); return GetMaterial(); }

// See Shape::CastRay
virtual bool CastRay(const RayCast &inRay, const SubShapeIDCreator &inSubShapeIDCreator, RayCastResult &ioHit) const override;
Expand Down
4 changes: 2 additions & 2 deletions Jolt/Physics/Collision/Shape/Shape.h
Original file line number Diff line number Diff line change
Expand Up @@ -370,13 +370,13 @@ class JPH_EXPORT Shape : public RefTarget<Shape>, public NonCopyable
virtual void SaveMaterialState([[maybe_unused]] PhysicsMaterialList &outMaterials) const { /* By default do nothing */ }

/// Restore the material references after calling sRestoreFromBinaryState. Note that the exact same materials need to be provided in the same order as returned by SaveMaterialState.
virtual void RestoreMaterialState([[maybe_unused]] const PhysicsMaterialRefC *inMaterials, uint inNumMaterials) { JPH_ASSERT(inNumMaterials == 0); }
virtual void RestoreMaterialState([[maybe_unused]] const PhysicsMaterialRefC *inMaterials, [[maybe_unused]] uint inNumMaterials) { JPH_ASSERT(inNumMaterials == 0); }

/// Outputs the shape references that this shape has to outSubShapes.
virtual void SaveSubShapeState([[maybe_unused]] ShapeList &outSubShapes) const { /* By default do nothing */ }

/// Restore the shape references after calling sRestoreFromBinaryState. Note that the exact same shapes need to be provided in the same order as returned by SaveSubShapeState.
virtual void RestoreSubShapeState([[maybe_unused]] const ShapeRefC *inSubShapes, uint inNumShapes) { JPH_ASSERT(inNumShapes == 0); }
virtual void RestoreSubShapeState([[maybe_unused]] const ShapeRefC *inSubShapes, [[maybe_unused]] uint inNumShapes) { JPH_ASSERT(inNumShapes == 0); }

using ShapeToIDMap = StreamUtils::ObjectToIDMap<Shape>;
using IDToShapeMap = StreamUtils::IDToObjectMap<Shape>;
Expand Down

0 comments on commit d58e655

Please sign in to comment.