4 * Created on: Aug 6, 2012
11 #include "../geometry/operators.h"
12 #include "../geometry/Vector.h"
13 #include "../graphics/Sprite.h"
15 using geometry::Point;
16 using geometry::Vector;
20 void HeroTag::Render(SDL_Surface *screen, int width, int height, Point<int> position, bool active) const {
22 destRect.x = position.X();
23 destRect.y = position.Y();
31 SDL_FillRect(screen, &destRect, SDL_MapRGB(screen->format, 0xFF, active ? 0 : 0xFF, active ? 0 : 0xFF));
37 SDL_FillRect(screen, &destRect, SDL_MapRGB(screen->format, 0, 0, 0));
39 Vector<int> heroOffset(
40 (align == LEFT) ? 3 : width - hero->Sprite()->Width() - 3,
41 height - hero->Sprite()->Height() - 3);
42 hero->Sprite()->Draw(screen, position + heroOffset, 0, hero->Health() > 0 ? 0 : 2);