X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fbattle%2Fstates%2FSelectItem.cpp;h=85ea773ce4d2420ecbbb2ecdf223585f44497358;hb=092a2dd175a4001a495c84ee85211734fb928c83;hp=35a0c61ca9262bf2deebb68f6805133d9aa7f04a;hpb=2ccc2369d32fb680a3047519d79c17de34c4e10a;p=l2e.git diff --git a/src/battle/states/SelectItem.cpp b/src/battle/states/SelectItem.cpp index 35a0c61..85ea773 100644 --- a/src/battle/states/SelectItem.cpp +++ b/src/battle/states/SelectItem.cpp @@ -14,32 +14,33 @@ #include "../../app/Input.h" #include "../../common/Item.h" #include "../../graphics/Frame.h" +#include "../../math/Vector.h" using app::Application; using app::Input; using common::Item; -using geometry::Vector; +using math::Vector; using graphics::Frame; namespace battle { -void SelectItem::OnEnterState(Application &c, SDL_Surface *screen) { - ctrl = &c; +void SelectItem::OnEnterState(SDL_Surface *screen) { + } -void SelectItem::OnExitState(Application &c, SDL_Surface *screen) { - ctrl = 0; +void SelectItem::OnExitState(SDL_Surface *screen) { + } -void SelectItem::OnResumeState(Application &ctrl, SDL_Surface *screen) { +void SelectItem::OnResumeState(SDL_Surface *screen) { if (battle->ActiveHero().GetAttackChoice().Selection().HasSelected()) { battle->ActiveHero().GetAttackChoice().SetType(AttackChoice::ITEM); battle->ActiveHero().GetAttackChoice().SetItem(battle->ItemMenu().Selected()); - ctrl.PopState(); + Ctrl().PopState(); } } -void SelectItem::OnPauseState(Application &ctrl, SDL_Surface *screen) { +void SelectItem::OnPauseState(SDL_Surface *screen) { } @@ -64,19 +65,19 @@ void SelectItem::HandleEvents(const Input &input) { ac.SetType(AttackChoice::ITEM); ac.SetItem(item); battle->NextHero(); - ctrl->PopState(); + Ctrl().PopState(); } else { if (item->GetTargetingMode().TargetsSingle()) { ac.Selection().SetSingle(); } else { ac.Selection().SetMultiple(); } - ctrl->PushState(new SelectTarget(battle, parent, &ac.Selection(), battle->Res().itemTargetCursor)); + Ctrl().PushState(new SelectTarget(battle, parent, &ac.Selection(), battle->Res().itemTargetCursor)); } } } if (input.JustPressed(Input::ACTION_B)) { - ctrl->PopState(); // return control to parent + Ctrl().PopState(); // return control to parent } if (input.JustPressed(Input::PAD_UP)) { battle->ItemMenu().PreviousRow(); @@ -92,7 +93,7 @@ void SelectItem::HandleEvents(const Input &input) { } } -void SelectItem::UpdateWorld(float deltaT) { +void SelectItem::UpdateWorld(Uint32 deltaT) { }