X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fbattle%2FAttackTypeMenu.cpp;h=16bda253dd86df85206e00ba3531e8f68b354bba;hb=cc3d698b8c1ad09d7a3f9e3f28bc84e0ac1735ea;hp=bee794f453a813e53355816a3c0ffa6d33cd36a0;hpb=628b3a7276d0b330719e05504b23bafcf88f8fca;p=l2e.git diff --git a/src/battle/AttackTypeMenu.cpp b/src/battle/AttackTypeMenu.cpp index bee794f..16bda25 100644 --- a/src/battle/AttackTypeMenu.cpp +++ b/src/battle/AttackTypeMenu.cpp @@ -1,33 +1,24 @@ -/* - * AttackTypeMenu.cpp - * - * Created on: Aug 6, 2012 - * Author: holy - */ - #include "AttackTypeMenu.h" -#include "../geometry/operators.h" #include "../geometry/Vector.h" #include "../graphics/Sprite.h" -using geometry::Point; using geometry::Vector; namespace battle { -void AttackTypeMenu::Render(SDL_Surface *screen, const geometry::Point &position) { - Vector swordOffset(IconWidth(), IconHeight()); - Vector magicOffset(IconWidth(), 0); - Vector defendOffset(2 * IconWidth(), IconHeight()); - Vector ikariOffset(IconWidth(), 2 * IconHeight()); - Vector itemOffset(0, IconHeight()); +void AttackTypeMenu::Render(SDL_Surface *screen, const geometry::Vector &position) { + const Vector &swordOffset(IconSize()); + const Vector magicOffset(IconWidth(), 0); + const Vector defendOffset(2 * IconWidth(), IconHeight()); + const Vector ikariOffset(IconWidth(), 2 * IconHeight()); + const Vector itemOffset(0, IconHeight()); - icons->Draw(screen, position + swordOffset, SWORD, (selected == SWORD) ? 1 : 0); - icons->Draw(screen, position + magicOffset, MAGIC, (selected == MAGIC) ? 1 : 0); - icons->Draw(screen, position + defendOffset, DEFEND, (selected == DEFEND) ? 1 : 0); - icons->Draw(screen, position + ikariOffset, IKARI, (selected == IKARI) ? 1 : 0); - icons->Draw(screen, position + itemOffset, ITEM, (selected == ITEM) ? 1 : 0); + icons->Draw(screen, position + swordOffset, AttackChoice::SWORD, (selected == AttackChoice::SWORD) ? 1 : 0); + icons->Draw(screen, position + magicOffset, AttackChoice::MAGIC, (selected == AttackChoice::MAGIC) ? 1 : 0); + icons->Draw(screen, position + defendOffset, AttackChoice::DEFEND, (selected == AttackChoice::DEFEND) ? 1 : 0); + icons->Draw(screen, position + ikariOffset, AttackChoice::IKARI, (selected == AttackChoice::IKARI) ? 1 : 0); + icons->Draw(screen, position + itemOffset, AttackChoice::ITEM, (selected == AttackChoice::ITEM) ? 1 : 0); } }