From 1319175bdc60e4e07ca1dac60659940b294f0b7c Mon Sep 17 00:00:00 2001 From: toneyisnow Date: Mon, 27 Jan 2020 00:34:59 -0800 Subject: [PATCH] Removed the create functions in the ColorShifter classes. --- client/CPlayerInterface.cpp | 7 +++++-- client/gui/SDL_Extensions.h | 18 ------------------ 2 files changed, 5 insertions(+), 20 deletions(-) diff --git a/client/CPlayerInterface.cpp b/client/CPlayerInterface.cpp index f4af8bbf6..defe847c5 100644 --- a/client/CPlayerInterface.cpp +++ b/client/CPlayerInterface.cpp @@ -739,8 +739,11 @@ void CPlayerInterface::battleUnitsChanged(const std::vector & units if(unit->alive() && animation->isDead()) animation->setType(CCreatureAnim::HOLDING); - if(unit->isClone()) - animation->shiftColor(ColorShifterDeepBlue::create()); + if (unit->isClone()) + { + std::unique_ptr shifter(new ColorShifterDeepBlue()); + animation->shiftColor(shifter.get()); + } //TODO: handle more cases } diff --git a/client/gui/SDL_Extensions.h b/client/gui/SDL_Extensions.h index 73b2b48cb..b88054bfa 100644 --- a/client/gui/SDL_Extensions.h +++ b/client/gui/SDL_Extensions.h @@ -161,12 +161,6 @@ public: class ColorShifterLightBlue : public ColorShifter { public: - static ColorShifterLightBlue * create() - { - std::unique_ptr 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 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 shifter(new ColorShifterDeepRed()); - return shifter.get(); - } - SDL_Color shiftColor(SDL_Color clr) const override { clr.r = 255;