X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fbattle%2FHeroTag.cpp;h=0b7aa2700b83f33308bc05644100b0f101c5323c;hb=cccda573516f3bce30efbaba3fc20e4148d3cdc8;hp=713fb8fe35774fbf9766ef72f8791236d8d6b277;hpb=526504934732d84cf43f164125f04f1f3e9cb225;p=l2e.git diff --git a/src/battle/HeroTag.cpp b/src/battle/HeroTag.cpp index 713fb8f..0b7aa27 100644 --- a/src/battle/HeroTag.cpp +++ b/src/battle/HeroTag.cpp @@ -10,6 +10,7 @@ #include "Hero.h" #include "../geometry/operators.h" #include "../geometry/Vector.h" +#include "../graphics/Frame.h" #include "../graphics/Sprite.h" using geometry::Point; @@ -18,23 +19,11 @@ using geometry::Vector; namespace battle { void HeroTag::Render(SDL_Surface *screen, int width, int height, Point position, bool active) const { - SDL_Rect destRect; - destRect.x = position.X(); - destRect.y = position.Y(); - destRect.w = width; - destRect.h = height; - - destRect.x += 1; - destRect.y += 1; - destRect.w -= 2; - destRect.h -= 2; - SDL_FillRect(screen, &destRect, SDL_MapRGB(screen->format, 0xFF, active ? 0 : 0xFF, active ? 0 : 0xFF)); - - destRect.x += 1; - destRect.y += 1; - destRect.w -= 2; - destRect.h -= 2; - SDL_FillRect(screen, &destRect, SDL_MapRGB(screen->format, 0, 0, 0)); + if (active) { + activeFrame->Draw(screen, position, width, height); + } else { + frame->Draw(screen, position, width, height); + } Vector heroOffset( (align == LEFT) ? 3 : width - hero->Sprite()->Width() - 3,