X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fmenu%2FHeroStatus.cpp;h=2d038b1a3c69b247f661b4fe807c72c2a8ee5def;hb=317100aa5878503dad034a1e1eb734d1e952f842;hp=e84327ebddb8e8718724e90e6169c614d8aa7601;hpb=57a75f13e98f4b5d311c2d3b9d9ff637120c5ee2;p=l2e.git diff --git a/src/menu/HeroStatus.cpp b/src/menu/HeroStatus.cpp index e84327e..2d038b1 100644 --- a/src/menu/HeroStatus.cpp +++ b/src/menu/HeroStatus.cpp @@ -28,55 +28,55 @@ HeroStatus::~HeroStatus() { int HeroStatus::Width() const { - return hero->BattleSprite()->Width() + res->normalFont->CharWidth() * 10; + return hero->BattleSprite()->Width() + res->statusFont->CharWidth() * 11; } int HeroStatus::Height() const { - return hero->BattleSprite()->Height(); + return hero->BattleSprite()->Height() + res->statusFont->CharWidth(); } void HeroStatus::Render(SDL_Surface *screen, const Vector &offset) const { if (!hero) return; - hero->BattleSprite()->Draw(screen, position + offset, 0, 0); + hero->BattleSprite()->Draw(screen, offset, 0, 0); // for some reason, fonts are shifted by one pixel in the original Vector nameOffset( hero->BattleSprite()->Width(), - res->normalFont->CharHeight() * 7 / 8); - nameOffset += position + offset; - res->normalFont->DrawString(hero->Name(), screen, nameOffset, 5); + res->statusFont->CharHeight() * 7 / 8); + nameOffset += offset; + res->statusFont->DrawString(hero->Name(), screen, nameOffset, 5); - Vector levelLabelOffset(nameOffset.X() + 6 * res->normalFont->CharWidth(), nameOffset.Y()); + Vector levelLabelOffset(nameOffset.X() + 6 * res->statusFont->CharWidth(), nameOffset.Y()); res->statusLabels->Draw(screen, levelLabelOffset, 0, 0); - Vector levelOffset(levelLabelOffset.X() + 2 * res->normalFont->CharWidth(), levelLabelOffset.Y()); - res->normalFont->DrawNumber(hero->Level(), screen, levelOffset, 2); + Vector levelOffset(levelLabelOffset.X() + 2 * res->statusFont->CharWidth(), levelLabelOffset.Y()); + res->statusFont->DrawNumber(hero->Level(), screen, levelOffset, 2); - Vector healthLabelOffset(nameOffset.X(), nameOffset.Y() + res->normalFont->CharHeight()); + Vector healthLabelOffset(nameOffset.X(), nameOffset.Y() + res->statusFont->CharHeight()); res->statusLabels->Draw(screen, healthLabelOffset, 0, 1); - Vector healthOffset(nameOffset.X() + 3 * res->normalFont->CharWidth(), nameOffset.Y() + res->normalFont->CharHeight()); - res->normalFont->DrawNumber(hero->Health(), screen, healthOffset, 3); + Vector healthOffset(nameOffset.X() + 3 * res->statusFont->CharWidth(), nameOffset.Y() + res->statusFont->CharHeight()); + res->statusFont->DrawNumber(hero->Health(), screen, healthOffset, 3); - Vector healthSeparatorOffset(healthOffset.X() + 3 * res->normalFont->CharWidth(), healthOffset.Y()); - res->normalFont->DrawChar('/', screen, healthSeparatorOffset); + Vector healthSeparatorOffset(healthOffset.X() + 3 * res->statusFont->CharWidth(), healthOffset.Y()); + res->statusFont->DrawChar('/', screen, healthSeparatorOffset); - Vector maxHealthOffset(healthSeparatorOffset.X() + res->normalFont->CharWidth(), healthOffset.Y()); - res->normalFont->DrawNumber(hero->MaxHealth(), screen, maxHealthOffset, 3); + Vector maxHealthOffset(healthSeparatorOffset.X() + res->statusFont->CharWidth(), healthOffset.Y()); + res->statusFont->DrawNumber(hero->MaxHealth(), screen, maxHealthOffset, 3); - Vector manaLabelOffset(healthLabelOffset.X(), healthLabelOffset.Y() + res->normalFont->CharHeight()); + Vector manaLabelOffset(healthLabelOffset.X(), healthLabelOffset.Y() + res->statusFont->CharHeight()); res->statusLabels->Draw(screen, manaLabelOffset, 0, 2); - Vector manaOffset(healthOffset.X(), healthOffset.Y() + res->normalFont->CharHeight()); - res->normalFont->DrawNumber(hero->Mana(), screen, manaOffset, 3); + Vector manaOffset(healthOffset.X(), healthOffset.Y() + res->statusFont->CharHeight()); + res->statusFont->DrawNumber(hero->Mana(), screen, manaOffset, 3); Vector manaSeparatorOffset(healthSeparatorOffset.X(), manaOffset.Y()); - res->normalFont->DrawChar('/', screen, manaSeparatorOffset); + res->statusFont->DrawChar('/', screen, manaSeparatorOffset); Vector maxManaOffset(maxHealthOffset.X(), manaOffset.Y()); - res->normalFont->DrawNumber(hero->MaxMana(), screen, maxManaOffset, 3); + res->statusFont->DrawNumber(hero->MaxMana(), screen, maxManaOffset, 3); } }