Skip to content

Commit 54b2206

Browse files
committed
for debug
1 parent 1aff693 commit 54b2206

11 files changed

Lines changed: 17 additions & 17 deletions

src/Box2D.NET.Samples/Box2D.NET.Samples.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
</PropertyGroup>
1919

2020
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
21-
<DefineConstants>$(DefineConstants);B2_SNOOP_TOI_COUNTERS;ENABLED;B2_SNOOP_TABLE_COUNTERS;B2_SNOOP_PAIR_COUNTERS;B2_ENABLE_VALIDATION</DefineConstants>
21+
<DefineConstants>$(DefineConstants);B2_SNOOP_TOI_COUNTERS;ENABLED;B2_SNOOP_TABLE_COUNTERS;B2_SNOOP_PAIR_COUNTERS</DefineConstants>
2222
</PropertyGroup>
2323

2424
<ItemGroup>

src/Box2D.NET/B2BoardPhases.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ internal static void b2ValidateBroadphase(B2BroadPhase bp)
568568

569569
internal static void b2ValidateNoEnlarged(B2BroadPhase bp)
570570
{
571-
#if B2_ENABLE_VALIDATION
571+
#if DEBUG
572572
for (int j = 0; j < (int)B2BodyType.b2_bodyTypeCount; ++j)
573573
{
574574
B2DynamicTree tree = bp.trees[j];

src/Box2D.NET/B2ContactSim.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public class B2ContactSim
1414
public B2Transform cachedTransformA;
1515
public B2Transform cachedTransformB;
1616

17-
#if B2_ENABLE_VALIDATION
17+
#if DEBUG
1818
public int bodyIdA;
1919
public int bodyIdB;
2020
#endif

src/Box2D.NET/B2ContactSolvers.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ internal static void b2PrepareOverflowContacts(B2StepContext context)
4141
B2ContactSim[] contacts = color.contactSims.data;
4242
B2BodyState[] awakeStates = context.states;
4343

44-
#if B2_ENABLE_VALIDATION
44+
#if DEBUG
4545
B2Body[] bodies = world.bodies.data;
4646
#endif
4747

@@ -63,7 +63,7 @@ internal static void b2PrepareOverflowContacts(B2StepContext context)
6363
int indexA = contactSim.bodySimIndexA;
6464
int indexB = contactSim.bodySimIndexB;
6565

66-
#if B2_ENABLE_VALIDATION
66+
#if DEBUG
6767
B2Body bodyA = bodies[contactSim.bodyIdA];
6868
int validIndexA = bodyA.setIndex == (int)B2SolverSetType.b2_awakeSet ? bodyA.localIndex : B2_NULL_INDEX;
6969
B2_ASSERT(indexA == validIndexA);
@@ -1249,7 +1249,7 @@ internal static void b2PrepareContactsTask(int startIndex, int endIndex, B2StepC
12491249
Span<B2ContactSim> contacts = context.contacts;
12501250
Span<B2ContactConstraintWide> constraints = context.wideContactConstraints;
12511251
B2BodyState[] awakeStates = context.states;
1252-
#if B2_ENABLE_VALIDATION
1252+
#if DEBUG
12531253
B2Body[] bodies = world.bodies.data;
12541254
#endif
12551255

@@ -1275,7 +1275,7 @@ internal static void b2PrepareContactsTask(int startIndex, int endIndex, B2StepC
12751275
int indexA = contactSim.bodySimIndexA;
12761276
int indexB = contactSim.bodySimIndexB;
12771277

1278-
#if B2_ENABLE_VALIDATION
1278+
#if DEBUG
12791279
B2Body bodyA = bodies[contactSim.bodyIdA];
12801280
int validIndexA = bodyA.setIndex == (int)B2SolverSetType.b2_awakeSet ? bodyA.localIndex : B2_NULL_INDEX;
12811281
B2Body bodyB = bodies[contactSim.bodyIdB];

src/Box2D.NET/B2Contacts.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ public static void b2CreateContact(B2World world, B2Shape shapeA, B2Shape shapeB
271271
ref B2ContactSim contactSim = ref b2Array_Add(ref set.contactSims);
272272
contactSim.contactId = contactId;
273273

274-
#if B2_ENABLE_VALIDATION
274+
#if DEBUG
275275
contactSim.bodyIdA = shapeA.bodyId;
276276
contactSim.bodyIdB = shapeB.bodyId;
277277
#endif

src/Box2D.NET/B2Diagnostics.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public static void B2_ASSERT(bool condition, string message = "", [CallerFilePat
6262
throw new InvalidOperationException($"{message} {memberName}() {fileName}:{lineNumber}");
6363
}
6464

65-
[Conditional("B2_ENABLE_VALIDATION")]
65+
[Conditional("DEBUG")]
6666
public static void B2_VALIDATE(bool condition, string message = "", [CallerFilePath] string fileName = "", [CallerLineNumber] int lineNumber = 0, [CallerMemberName] string memberName = "")
6767
{
6868
if (condition)

src/Box2D.NET/B2DynamicTrees.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -934,7 +934,7 @@ public static B2AABB b2DynamicTree_GetRootBounds(B2DynamicTree tree)
934934
return empty;
935935
}
936936

937-
#if B2_ENABLE_VALIDATION
937+
#if DEBUG
938938
// Compute the height of a sub-tree.
939939
internal static int b2ComputeHeight(B2DynamicTree tree, int nodeId)
940940
{
@@ -1038,7 +1038,7 @@ internal static void b2ValidateMetrics(B2DynamicTree tree, int index)
10381038
/// Validate this tree. For testing.
10391039
public static void b2DynamicTree_Validate(B2DynamicTree tree)
10401040
{
1041-
#if B2_ENABLE_VALIDATION
1041+
#if DEBUG
10421042
if (tree.root == B2_NULL_INDEX)
10431043
{
10441044
return;
@@ -1069,7 +1069,7 @@ public static void b2DynamicTree_Validate(B2DynamicTree tree)
10691069
/// Validate this tree has no enlarged AABBs. For testing.
10701070
internal static void b2DynamicTree_ValidateNoEnlarged(B2DynamicTree tree)
10711071
{
1072-
#if B2_ENABLE_VALIDATION
1072+
#if DEBUG
10731073
int capacity = tree.nodeCapacity;
10741074
B2TreeNode[] nodes = tree.nodes;
10751075
for (int i = 0; i < capacity; ++i)
@@ -2047,7 +2047,7 @@ public static int b2DynamicTree_Rebuild(B2DynamicTree tree, bool fullBuild)
20472047
node = ref nodes[nodeIndex];
20482048
}
20492049

2050-
#if B2_ENABLE_VALIDATION
2050+
#if DEBUG
20512051
int capacity = tree.nodeCapacity;
20522052
for (int i = 0; i < capacity; ++i)
20532053
{

src/Box2D.NET/B2IdPools.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ internal static void b2FreeId(B2IdPool pool, int id)
6060
b2Array_Push(ref pool.freeArray, id);
6161
}
6262

63-
#if B2_ENABLE_VALIDATION
63+
#if DEBUG
6464
internal static void b2ValidateFreeId(B2IdPool pool, int id)
6565
{
6666
int freeCount = pool.freeArray.count;

src/Box2D.NET/B2Islands.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,7 @@ internal static void b2SplitIslandTask(int startIndex, int endIndex, uint thread
722722
b2TracyCZoneEnd(B2TracyCZone.split);
723723
}
724724

725-
#if B2_ENABLE_VALIDATION
725+
#if DEBUG
726726
internal static void b2ValidateIsland(B2World world, int islandId)
727727
{
728728
if (islandId == B2_NULL_INDEX)

src/Box2D.NET/B2Worlds.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2586,7 +2586,7 @@ public static void b2World_EnableSpeculative(B2WorldId worldId, bool flag)
25862586
world.enableSpeculative = flag;
25872587
}
25882588

2589-
#if B2_ENABLE_VALIDATION
2589+
#if DEBUG
25902590
// This validates island graph connectivity for each body
25912591
internal static void b2ValidateConnectivity(B2World world)
25922592
{

0 commit comments

Comments
 (0)