From 36ba43d6ea38062b17f7e63ef659962bfc51c64d Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 6 Jun 2017 23:34:34 +0300 Subject: Fix clang-tidy check readability-implicit-bool-cast. --- src/particle/imageparticle.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/particle/imageparticle.cpp') diff --git a/src/particle/imageparticle.cpp b/src/particle/imageparticle.cpp index a8b5cd1ae..7e4a6105a 100644 --- a/src/particle/imageparticle.cpp +++ b/src/particle/imageparticle.cpp @@ -35,7 +35,7 @@ ImageParticle::ImageParticle(Image *restrict const image) : { mType = ParticleType::Image; mImage = image; - if (mImage) + if (mImage != nullptr) { mImage->incRef(); @@ -54,7 +54,7 @@ void ImageParticle::draw(Graphics *restrict const graphics, const int offsetY) const restrict2 { FUNC_BLOCK("ImageParticle::draw", 1) - if (mAlive != AliveStatus::ALIVE || !mImage) + if (mAlive != AliveStatus::ALIVE || (mImage == nullptr)) return; const int w = mImage->mBounds.w; @@ -75,13 +75,13 @@ void ImageParticle::draw(Graphics *restrict const graphics, float alphafactor = mAlpha; - if (mFadeOut && mLifetimeLeft > -1 && mLifetimeLeft < mFadeOut) + if ((mFadeOut != 0) && mLifetimeLeft > -1 && mLifetimeLeft < mFadeOut) { alphafactor *= static_cast(mLifetimeLeft) / static_cast(mFadeOut); } - if (mFadeIn && mLifetimePast < mFadeIn) + if ((mFadeIn != 0) && mLifetimePast < mFadeIn) { alphafactor *= static_cast(mLifetimePast) / static_cast(mFadeIn); -- cgit v1.2.3-60-g2f50