From ee952b1afd8afe242ece5cd3a11065b73bee4739 Mon Sep 17 00:00:00 2001 From: Iscle Date: Tue, 26 Oct 2021 15:47:48 +0200 Subject: [PATCH] Fix compiler warnings --- SpaceCadetPinball/TComponentGroup.cpp | 2 +- SpaceCadetPinball/TEdgeSegment.cpp | 4 ++-- SpaceCadetPinball/TFlipperEdge.cpp | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/SpaceCadetPinball/TComponentGroup.cpp b/SpaceCadetPinball/TComponentGroup.cpp index 6021766..9f7c4d1 100644 --- a/SpaceCadetPinball/TComponentGroup.cpp +++ b/SpaceCadetPinball/TComponentGroup.cpp @@ -45,7 +45,7 @@ int TComponentGroup::Message(int code, float value) if (value > 0.0f) this->Timer = timer::set(value, this, NotifyTimerExpired); } - else if (code <= 1007 || code > 1011 && code != 1020 && code != 1022) + else if (code <= 1007 || (code > 1011 && code != 1020 && code != 1022)) { for (auto component : List) { diff --git a/SpaceCadetPinball/TEdgeSegment.cpp b/SpaceCadetPinball/TEdgeSegment.cpp index 53a7675..df12ed9 100644 --- a/SpaceCadetPinball/TEdgeSegment.cpp +++ b/SpaceCadetPinball/TEdgeSegment.cpp @@ -93,8 +93,8 @@ TEdgeSegment* TEdgeSegment::install_wall(float* floatArr, TCollisionComponent* c vec2.X = centerX2 - centerX1; vec2.Y = centerY2 - center.Y; maths::cross(&vec1, &vec2, &dstVec); - if (dstVec.Z > 0.0f && offset > 0.0f || - dstVec.Z < 0.0f && offset < 0.0f) + if ((dstVec.Z > 0.0f && offset > 0.0f) || + (dstVec.Z < 0.0f && offset < 0.0f)) { float radius = offset * 1.001f; auto circle = new TCircle(collComp, activeFlagPtr, collisionGroup, ¢er, radius); diff --git a/SpaceCadetPinball/TFlipperEdge.cpp b/SpaceCadetPinball/TFlipperEdge.cpp index 3d3821d..e99a611 100644 --- a/SpaceCadetPinball/TFlipperEdge.cpp +++ b/SpaceCadetPinball/TFlipperEdge.cpp @@ -438,10 +438,10 @@ int TFlipperEdge::is_ball_inside(float x, float y) vector_type testPoint{}; float dx = RotOrigin.X - x; float dy = RotOrigin.Y - y; - if ((A2.X - A1.X) * (y - A1.Y) - (A2.Y - A1.Y) * (x - A1.X) >= 0.0f && + if (((A2.X - A1.X) * (y - A1.Y) - (A2.Y - A1.Y) * (x - A1.X) >= 0.0f && (B1.X - A2.X) * (y - A2.Y) - (B1.Y - A2.Y) * (x - A2.X) >= 0.0f && (B2.X - B1.X) * (y - B1.Y) - (B2.Y - B1.Y) * (x - B1.X) >= 0.0f && - (A1.X - B2.X) * (y - B2.Y) - (A1.Y - B2.Y) * (x - B2.X) >= 0.0f || + (A1.X - B2.X) * (y - B2.Y) - (A1.Y - B2.Y) * (x - B2.X) >= 0.0f) || dy * dy + dx * dx <= CirclebaseRadiusSq || (T1.Y - y) * (T1.Y - y) + (T1.X - x) * (T1.X - x) < CircleT1RadiusSq) {