]> git.localhorst.tv Git - l2e.git/blobdiff - src/battle/states/SelectItem.cpp
switched geometric scalars from floating to fixed
[l2e.git] / src / battle / states / SelectItem.cpp
index 35a0c61ca9262bf2deebb68f6805133d9aa7f04a..acebefa2796f25e0901c34869780b2772838e34f 100644 (file)
 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 +64,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 +92,7 @@ void SelectItem::HandleEvents(const Input &input) {
        }
 }
 
-void SelectItem::UpdateWorld(float deltaT) {
+void SelectItem::UpdateWorld(Uint32 deltaT) {
 
 }