Fix return type of ParticleSystem:getAreaSpreadIsRelativeDirection, remove optional parameters from ParticleSystem:setAreaSpread (resolves #1340)

I opted to remove the optional parameters altogether since they seemed oddly
out-of-place. They used to reset the values to defaults when not supplied, and
they also weren't returned by getAreaSpread(), so
setAreaSpread(getAreaSpread()) actually changed spread parameters.

The other option was to remove the separate getters/setters for
AreaSpreadIsRelativeDirection and AreaSpreadAngle, and fully rely on
setAreaSpread for these parameters, but the rest of the ParticleSystem API
tends to keep parameters separate.

--HG--
branch : minor
This commit is contained in:
Bart van Strien
2017-09-12 12:40:21 +02:00
parent 09c1259857
commit 7dae80f552
3 changed files with 5 additions and 56 deletions
+2 -17
View File
@@ -574,21 +574,6 @@ void ParticleSystem::setAreaSpread(AreaSpreadDistribution distribution, float x,
areaSpreadDistribution = distribution;
}
void ParticleSystem::setAreaSpread(AreaSpreadDistribution distribution, float x, float y, float angle)
{
areaSpread = love::Vector2(x, y);
areaSpreadDistribution = distribution;
areaSpreadAngle = angle;
}
void ParticleSystem::setAreaSpread(AreaSpreadDistribution distribution, float x, float y, float angle, bool isRelativeDirection)
{
areaSpread = love::Vector2(x, y);
areaSpreadDistribution = distribution;
areaSpreadAngle = angle;
areaSpreadIsRelativeDirection = isRelativeDirection;
}
ParticleSystem::AreaSpreadDistribution ParticleSystem::getAreaSpreadDistribution() const
{
return areaSpreadDistribution;
@@ -601,7 +586,7 @@ const love::Vector2 &ParticleSystem::getAreaSpreadParameters() const
void ParticleSystem::setAreaSpreadAngle(float angle)
{
this->areaSpreadAngle = angle;
areaSpreadAngle = angle;
}
float ParticleSystem::getAreaSpreadAngle() const
@@ -611,7 +596,7 @@ float ParticleSystem::getAreaSpreadAngle() const
void ParticleSystem::setAreaSpreadIsRelativeDirection(bool isRelativeDirection)
{
this->areaSpreadIsRelativeDirection = isRelativeDirection;
areaSpreadIsRelativeDirection = isRelativeDirection;
}
bool ParticleSystem::getAreaSpreadIsRelativeDirection() const