Color values in love's APIs are now in the range of [0, 1] rather than [0, 255].

--HG--
branch : minor
This commit is contained in:
Alex Szpakowski
2016-01-31 10:49:29 -04:00
parent 50087bd60e
commit ed933847f8
19 changed files with 126 additions and 144 deletions
+1 -21
View File
@@ -687,31 +687,11 @@ love::Vector ParticleSystem::getOffset() const
void ParticleSystem::setColor(const std::vector<Colorf> &newColors)
{
colors = newColors;
for (Colorf &c : colors)
{
// We want to store the colors as [0, 1], rather than [0, 255].
c.r /= 255.0f;
c.g /= 255.0f;
c.b /= 255.0f;
c.a /= 255.0f;
}
}
std::vector<Colorf> ParticleSystem::getColor() const
{
// The particle system stores colors in the range of [0, 1]...
std::vector<Colorf> ncolors(colors);
for (Colorf &c : ncolors)
{
c.r *= 255.0f;
c.g *= 255.0f;
c.b *= 255.0f;
c.a *= 255.0f;
}
return ncolors;
return colors;
}
void ParticleSystem::setQuads(const std::vector<Quad *> &newQuads)