X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fbattle%2Fstates%2FSelectTarget.cpp;h=1961738623a30a1c9f3ec2f90c340c3a651f4dbe;hb=5ca18f73987fb3935ab34654cbbecf5eca4704cb;hp=f15f4558cd8ab8c32e6fe114ba7875b39036a629;hpb=0542849dfccfec1ce1477265fa0fee2401a8fb23;p=l2e.git diff --git a/src/battle/states/SelectTarget.cpp b/src/battle/states/SelectTarget.cpp index f15f455..1961738 100644 --- a/src/battle/states/SelectTarget.cpp +++ b/src/battle/states/SelectTarget.cpp @@ -19,24 +19,24 @@ using std::vector; namespace battle { -void SelectTarget::EnterState(Application &c, SDL_Surface *screen) { - ctrl = &c; +void SelectTarget::OnEnterState(SDL_Surface *screen) { + } -void SelectTarget::ExitState(Application &c, SDL_Surface *screen) { - ctrl = 0; +void SelectTarget::OnExitState(SDL_Surface *screen) { + } -void SelectTarget::ResumeState(Application &ctrl, SDL_Surface *screen) { +void SelectTarget::OnResumeState(SDL_Surface *screen) { } -void SelectTarget::PauseState(Application &ctrl, SDL_Surface *screen) { +void SelectTarget::OnPauseState(SDL_Surface *screen) { } -void SelectTarget::Resize(int width, int height) { +void SelectTarget::OnResize(int width, int height) { } @@ -44,11 +44,11 @@ void SelectTarget::Resize(int width, int height) { void SelectTarget::HandleEvents(const Input &input) { if (input.JustPressed(Input::ACTION_A)) { if (selection->CurrentIsSelected()) { - ctrl->PopState(); // return control to parent + Ctrl().PopState(); // return control to parent } else { selection->Select(); if (selection->SelectSingle()) { - ctrl->PopState(); // return control to parent + Ctrl().PopState(); // return control to parent } } } @@ -57,7 +57,7 @@ void SelectTarget::HandleEvents(const Input &input) { selection->Unselect(); } else { selection->UnselectAll(); - ctrl->PopState(); // return control to parent + Ctrl().PopState(); // return control to parent } } @@ -86,7 +86,6 @@ void SelectTarget::Render(SDL_Surface *screen) { } void SelectTarget::RenderCursors(SDL_Surface *screen, const geometry::Vector &offset) { - // TODO: this should be related to the enemy's width Vector cursorOffset(cursorIcon->Width() / -2, cursorIcon->Height()); // offset the indicator by 1/8th to the right and top Vector indicatorOffset(cursorOffset + Vector(cursorIcon->Width() / 8, cursorIcon->Height() / -8));