summaryrefslogtreecommitdiff
path: root/src/particle/imageparticle.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-06-06 23:34:34 +0300
committerAndrei Karas <akaras@inbox.ru>2017-06-07 19:23:40 +0300
commit36ba43d6ea38062b17f7e63ef659962bfc51c64d (patch)
tree190156cb88b13a38a6d13c69ee0742cc078065a1 /src/particle/imageparticle.cpp
parentf1518dd8476c968a43fa57cfb06198e290a4f77a (diff)
downloadplus-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.gz
plus-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.bz2
plus-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.xz
plus-36ba43d6ea38062b17f7e63ef659962bfc51c64d.zip
Fix clang-tidy check readability-implicit-bool-cast.
Diffstat (limited to 'src/particle/imageparticle.cpp')
-rw-r--r--src/particle/imageparticle.cpp8
1 files changed, 4 insertions, 4 deletions
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<float>(mLifetimeLeft)
/ static_cast<float>(mFadeOut);
}
- if (mFadeIn && mLifetimePast < mFadeIn)
+ if ((mFadeIn != 0) && mLifetimePast < mFadeIn)
{
alphafactor *= static_cast<float>(mLifetimePast)
/ static_cast<float>(mFadeIn);