1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-03-19 21:10:12 +02:00

Removed the create functions in the ColorShifter classes.

This commit is contained in:
toneyisnow 2020-01-27 00:34:59 -08:00
parent a03e696ec0
commit 1319175bdc
2 changed files with 5 additions and 20 deletions

View File

@ -739,8 +739,11 @@ void CPlayerInterface::battleUnitsChanged(const std::vector<UnitChanges> & units
if(unit->alive() && animation->isDead())
animation->setType(CCreatureAnim::HOLDING);
if(unit->isClone())
animation->shiftColor(ColorShifterDeepBlue::create());
if (unit->isClone())
{
std::unique_ptr<ColorShifterDeepBlue> shifter(new ColorShifterDeepBlue());
animation->shiftColor(shifter.get());
}
//TODO: handle more cases
}

View File

@ -161,12 +161,6 @@ public:
class ColorShifterLightBlue : public ColorShifter
{
public:
static ColorShifterLightBlue * create()
{
std::unique_ptr<ColorShifterLightBlue> shifter(new ColorShifterLightBlue());
return shifter.get();
}
SDL_Color shiftColor(SDL_Color clr) const override
{
clr.b = clr.b + (255 - clr.b) / 2;
@ -177,12 +171,6 @@ public:
class ColorShifterDeepBlue : public ColorShifter
{
public:
static ColorShifterDeepBlue * create()
{
std::unique_ptr<ColorShifterDeepBlue> shifter(new ColorShifterDeepBlue());
return shifter.get();
}
SDL_Color shiftColor(SDL_Color clr) const override
{
clr.b = 255;
@ -193,12 +181,6 @@ public:
class ColorShifterDeepRed : public ColorShifter
{
public:
static ColorShifterDeepRed * create()
{
std::unique_ptr<ColorShifterDeepRed> shifter(new ColorShifterDeepRed());
return shifter.get();
}
SDL_Color shiftColor(SDL_Color clr) const override
{
clr.r = 255;