From 5ca18f73987fb3935ab34654cbbecf5eca4704cb Mon Sep 17 00:00:00 2001 From: Daniel Karbach Date: Wed, 17 Oct 2012 21:34:48 +0200 Subject: [PATCH] removed now superfluous Application parameter to State callbacks --- src/app/Application.cpp | 14 +++++++------- src/app/State.cpp | 12 ++++++------ src/app/State.h | 12 ++++++------ src/battle/BattleState.cpp | 18 +++++++++--------- src/battle/BattleState.h | 8 ++++---- src/battle/states/PerformAttacks.cpp | 8 ++++---- src/battle/states/PerformAttacks.h | 8 ++++---- src/battle/states/RunState.cpp | 8 ++++---- src/battle/states/RunState.h | 8 ++++---- src/battle/states/SelectAttackType.cpp | 10 +++++----- src/battle/states/SelectAttackType.h | 8 ++++---- src/battle/states/SelectIkari.cpp | 10 +++++----- src/battle/states/SelectIkari.h | 8 ++++---- src/battle/states/SelectItem.cpp | 10 +++++----- src/battle/states/SelectItem.h | 8 ++++---- src/battle/states/SelectMoveAction.cpp | 8 ++++---- src/battle/states/SelectMoveAction.h | 8 ++++---- src/battle/states/SelectSpell.cpp | 10 +++++----- src/battle/states/SelectSpell.h | 8 ++++---- src/battle/states/SelectTarget.cpp | 8 ++++---- src/battle/states/SelectTarget.h | 8 ++++---- src/battle/states/SwapHeroes.cpp | 8 ++++---- src/battle/states/SwapHeroes.h | 8 ++++---- src/graphics/ColorFade.cpp | 8 ++++---- src/graphics/ColorFade.h | 8 ++++---- src/map/MapState.cpp | 8 ++++---- src/map/MapState.h | 8 ++++---- src/map/TransitionState.cpp | 8 ++++---- src/map/TransitionState.h | 8 ++++---- 29 files changed, 132 insertions(+), 132 deletions(-) diff --git a/src/app/Application.cpp b/src/app/Application.cpp index f773cfc..90ed288 100644 --- a/src/app/Application.cpp +++ b/src/app/Application.cpp @@ -85,32 +85,32 @@ void Application::PopState() { void Application::RealChangeState(State *s) { if (!states.empty()) { - states.top()->PauseState(*this, screen.Screen()); + states.top()->PauseState(screen.Screen()); states.top()->ExitState(*this, screen.Screen()); states.pop(); } states.push(s); s->EnterState(*this, screen.Screen()); - s->ResumeState(*this, screen.Screen()); + s->ResumeState(screen.Screen()); } void Application::RealPushState(State *s) { if (!states.empty()) { - states.top()->PauseState(*this, screen.Screen()); + states.top()->PauseState(screen.Screen()); } states.push(s); s->EnterState(*this, screen.Screen()); - s->ResumeState(*this, screen.Screen()); + s->ResumeState(screen.Screen()); } void Application::RealPopState() { if (states.empty()) return; - states.top()->PauseState(*this, screen.Screen()); + states.top()->PauseState(screen.Screen()); states.top()->ExitState(*this, screen.Screen()); delete states.top(); states.pop(); if (!states.empty()) { - states.top()->ResumeState(*this, screen.Screen()); + states.top()->ResumeState(screen.Screen()); } } @@ -120,7 +120,7 @@ void Application::Quit() { void Application::PopAllStates() { while (!states.empty()) { - states.top()->PauseState(*this, screen.Screen()); + states.top()->PauseState(screen.Screen()); states.top()->ExitState(*this, screen.Screen()); delete states.top(); states.pop(); diff --git a/src/app/State.cpp b/src/app/State.cpp index f1c7712..2c8f0c3 100644 --- a/src/app/State.cpp +++ b/src/app/State.cpp @@ -25,20 +25,20 @@ State::~State() { void State::EnterState(Application &c, SDL_Surface *screen) { ctrl = &c; - OnEnterState(c, screen); + OnEnterState(screen); } void State::ExitState(Application &c, SDL_Surface *screen) { - OnExitState(c, screen); + OnExitState(screen); ctrl = 0; } -void State::ResumeState(Application &ctrl, SDL_Surface *screen) { - OnResumeState(ctrl, screen); +void State::ResumeState(SDL_Surface *screen) { + OnResumeState(screen); } -void State::PauseState(Application &ctrl, SDL_Surface *screen) { - OnPauseState(ctrl, screen); +void State::PauseState(SDL_Surface *screen) { + OnPauseState(screen); } void State::Resize(int width, int height) { diff --git a/src/app/State.h b/src/app/State.h index 2a4b5e1..4e1fd7f 100644 --- a/src/app/State.h +++ b/src/app/State.h @@ -28,9 +28,9 @@ public: /// Called by Application when popping this state. void ExitState(Application &ctrl, SDL_Surface *screen); /// Called by Application when this state becomes the top state. - void ResumeState(Application &ctrl, SDL_Surface *screen); + void ResumeState(SDL_Surface *screen); /// Called by Application when this state no longer is the top state. - void PauseState(Application &ctrl, SDL_Surface *screen); + void PauseState(SDL_Surface *screen); /// Called by Application on SDL window resize events. void Resize(int width, int height); @@ -54,14 +54,14 @@ private: /// can not be done by the constructor. /// Called when the state first enters the stack. /// @param ctrl the Application running the state - virtual void OnEnterState(Application &ctrl, SDL_Surface *screen) = 0; + virtual void OnEnterState(SDL_Surface *screen) = 0; /// Do some cleanup. /// Called when the state is popped from the stack. - virtual void OnExitState(Application &ctrl, SDL_Surface *screen) = 0; + virtual void OnExitState(SDL_Surface *screen) = 0; /// Called when the state becomes the active one. - virtual void OnResumeState(Application &ctrl, SDL_Surface *screen) = 0; + virtual void OnResumeState(SDL_Surface *screen) = 0; /// Called when the state becomes inactive. - virtual void OnPauseState(Application &ctrl, SDL_Surface *screen) = 0; + virtual void OnPauseState(SDL_Surface *screen) = 0; /// Adapt the state's graphics to given dimensions. /// NOTE: currently, this is only called for the stack top and not diff --git a/src/battle/BattleState.cpp b/src/battle/BattleState.cpp index d442f22..be1ef34 100644 --- a/src/battle/BattleState.cpp +++ b/src/battle/BattleState.cpp @@ -79,7 +79,7 @@ void BattleState::OnResize(int w, int h) { } -void BattleState::OnEnterState(Application &ctrl, SDL_Surface *screen) { +void BattleState::OnEnterState(SDL_Surface *screen) { for (int i(0); i < 4; ++i) { heroes[i].Position() = heroesLayout->CalculatePosition(i, background->w, background->h); heroes[i].SpellMenu() = *res->spellMenuProperties; @@ -130,28 +130,28 @@ void BattleState::LoadInventory() { ClearAllAttacks(); } -void BattleState::OnExitState(Application &ctrl, SDL_Surface *screen) { +void BattleState::OnExitState(SDL_Surface *screen) { } -void BattleState::OnResumeState(Application &ctrl, SDL_Surface *screen) { +void BattleState::OnResumeState(SDL_Surface *screen) { if (ranAway) { - ctrl.PopState(); // quit the battle scene + Ctrl().PopState(); // quit the battle scene return; } if (Victory()) { - ctrl.PopState(); + Ctrl().PopState(); return; } if (Defeat()) { - ctrl.PopState(); + Ctrl().PopState(); return; } // TODO: this should not push a state while quitting if (AttackSelectionDone()) { - ctrl.PushState(new PerformAttacks(this)); + Ctrl().PushState(new PerformAttacks(this)); } else { - ctrl.PushState(new SelectMoveAction(this)); + Ctrl().PushState(new SelectMoveAction(this)); } } @@ -169,7 +169,7 @@ bool BattleState::Defeat() const { return true; } -void BattleState::OnPauseState(Application &ctrl, SDL_Surface *screen) { +void BattleState::OnPauseState(SDL_Surface *screen) { } diff --git a/src/battle/BattleState.h b/src/battle/BattleState.h index cc9eaf1..e76440e 100644 --- a/src/battle/BattleState.h +++ b/src/battle/BattleState.h @@ -131,10 +131,10 @@ public: void RenderSmallHeroTags(SDL_Surface *screen, const geometry::Vector &offset); private: - virtual void OnEnterState(app::Application &ctrl, SDL_Surface *screen); - virtual void OnExitState(app::Application &ctrl, SDL_Surface *screen); - virtual void OnResumeState(app::Application &ctrl, SDL_Surface *screen); - virtual void OnPauseState(app::Application &ctrl, SDL_Surface *screen); + virtual void OnEnterState(SDL_Surface *screen); + virtual void OnExitState(SDL_Surface *screen); + virtual void OnResumeState(SDL_Surface *screen); + virtual void OnPauseState(SDL_Surface *screen); virtual void OnResize(int width, int height); diff --git a/src/battle/states/PerformAttacks.cpp b/src/battle/states/PerformAttacks.cpp index a1a5b8b..665756f 100644 --- a/src/battle/states/PerformAttacks.cpp +++ b/src/battle/states/PerformAttacks.cpp @@ -29,21 +29,21 @@ using std::vector; namespace battle { -void PerformAttacks::OnEnterState(Application &c, SDL_Surface *screen) { +void PerformAttacks::OnEnterState(SDL_Surface *screen) { battle->CalculateAttackOrder(); numberAnimation.reserve(battle->MaxMonsters() > battle->NumHeroes() + 1 ? battle->MaxMonsters() : battle->NumHeroes() + 1); numberPosition.reserve(numberAnimation.size()); } -void PerformAttacks::OnExitState(Application &c, SDL_Surface *screen) { +void PerformAttacks::OnExitState(SDL_Surface *screen) { battle->ClearAllAttacks(); } -void PerformAttacks::OnResumeState(Application &ctrl, SDL_Surface *screen) { +void PerformAttacks::OnResumeState(SDL_Surface *screen) { } -void PerformAttacks::OnPauseState(Application &ctrl, SDL_Surface *screen) { +void PerformAttacks::OnPauseState(SDL_Surface *screen) { } diff --git a/src/battle/states/PerformAttacks.h b/src/battle/states/PerformAttacks.h index 2fe9a06..06ce1b8 100644 --- a/src/battle/states/PerformAttacks.h +++ b/src/battle/states/PerformAttacks.h @@ -32,10 +32,10 @@ public: virtual void Render(SDL_Surface *); private: - virtual void OnEnterState(app::Application &ctrl, SDL_Surface *screen); - virtual void OnExitState(app::Application &ctrl, SDL_Surface *screen); - virtual void OnResumeState(app::Application &ctrl, SDL_Surface *screen); - virtual void OnPauseState(app::Application &ctrl, SDL_Surface *screen); + virtual void OnEnterState(SDL_Surface *screen); + virtual void OnExitState(SDL_Surface *screen); + virtual void OnResumeState(SDL_Surface *screen); + virtual void OnPauseState(SDL_Surface *screen); virtual void OnResize(int width, int height); diff --git a/src/battle/states/RunState.cpp b/src/battle/states/RunState.cpp index cf113f2..311e0f3 100644 --- a/src/battle/states/RunState.cpp +++ b/src/battle/states/RunState.cpp @@ -22,19 +22,19 @@ using geometry::Vector; namespace battle { -void RunState::OnEnterState(Application &c, SDL_Surface *screen) { +void RunState::OnEnterState(SDL_Surface *screen) { } -void RunState::OnExitState(Application &c, SDL_Surface *screen) { +void RunState::OnExitState(SDL_Surface *screen) { } -void RunState::OnResumeState(Application &ctrl, SDL_Surface *screen) { +void RunState::OnResumeState(SDL_Surface *screen) { timer = GraphicsTimers().StartCountdown(2500); } -void RunState::OnPauseState(Application &ctrl, SDL_Surface *screen) { +void RunState::OnPauseState(SDL_Surface *screen) { } diff --git a/src/battle/states/RunState.h b/src/battle/states/RunState.h index 9cee764..cf91f9a 100644 --- a/src/battle/states/RunState.h +++ b/src/battle/states/RunState.h @@ -28,10 +28,10 @@ public: virtual void Render(SDL_Surface *); private: - virtual void OnEnterState(app::Application &ctrl, SDL_Surface *screen); - virtual void OnExitState(app::Application &ctrl, SDL_Surface *screen); - virtual void OnResumeState(app::Application &ctrl, SDL_Surface *screen); - virtual void OnPauseState(app::Application &ctrl, SDL_Surface *screen); + virtual void OnEnterState(SDL_Surface *screen); + virtual void OnExitState(SDL_Surface *screen); + virtual void OnResumeState(SDL_Surface *screen); + virtual void OnPauseState(SDL_Surface *screen); virtual void OnResize(int width, int height); diff --git a/src/battle/states/SelectAttackType.cpp b/src/battle/states/SelectAttackType.cpp index 31a0be0..fade232 100644 --- a/src/battle/states/SelectAttackType.cpp +++ b/src/battle/states/SelectAttackType.cpp @@ -27,26 +27,26 @@ using geometry::Vector; namespace battle { -void SelectAttackType::OnEnterState(Application &c, SDL_Surface *screen) { +void SelectAttackType::OnEnterState(SDL_Surface *screen) { } -void SelectAttackType::OnExitState(Application &c, SDL_Surface *screen) { +void SelectAttackType::OnExitState(SDL_Surface *screen) { } -void SelectAttackType::OnResumeState(Application &ctrl, SDL_Surface *screen) { +void SelectAttackType::OnResumeState(SDL_Surface *screen) { if (battle->ActiveHero().GetAttackChoice().Selection().HasSelected()) { battle->ActiveHero().GetAttackChoice().SetType(battle->GetAttackTypeMenu().Selected()); battle->NextHero(); } if (battle->AttackSelectionDone()) { // pass through - ctrl.PopState(); + Ctrl().PopState(); } } -void SelectAttackType::OnPauseState(Application &ctrl, SDL_Surface *screen) { +void SelectAttackType::OnPauseState(SDL_Surface *screen) { } diff --git a/src/battle/states/SelectAttackType.h b/src/battle/states/SelectAttackType.h index 3f98327..64a7dbd 100644 --- a/src/battle/states/SelectAttackType.h +++ b/src/battle/states/SelectAttackType.h @@ -27,10 +27,10 @@ public: virtual void Render(SDL_Surface *); private: - virtual void OnEnterState(app::Application &ctrl, SDL_Surface *screen); - virtual void OnExitState(app::Application &ctrl, SDL_Surface *screen); - virtual void OnResumeState(app::Application &ctrl, SDL_Surface *screen); - virtual void OnPauseState(app::Application &ctrl, SDL_Surface *screen); + virtual void OnEnterState(SDL_Surface *screen); + virtual void OnExitState(SDL_Surface *screen); + virtual void OnResumeState(SDL_Surface *screen); + virtual void OnPauseState(SDL_Surface *screen); virtual void OnResize(int width, int height); diff --git a/src/battle/states/SelectIkari.cpp b/src/battle/states/SelectIkari.cpp index 604689c..2860a81 100644 --- a/src/battle/states/SelectIkari.cpp +++ b/src/battle/states/SelectIkari.cpp @@ -24,23 +24,23 @@ using graphics::Frame; namespace battle { -void SelectIkari::OnEnterState(Application &c, SDL_Surface *screen) { +void SelectIkari::OnEnterState(SDL_Surface *screen) { } -void SelectIkari::OnExitState(Application &c, SDL_Surface *screen) { +void SelectIkari::OnExitState(SDL_Surface *screen) { } -void SelectIkari::OnResumeState(Application &ctrl, SDL_Surface *screen) { +void SelectIkari::OnResumeState(SDL_Surface *screen) { if (battle->ActiveHero().GetAttackChoice().Selection().HasSelected()) { battle->ActiveHero().GetAttackChoice().SetType(AttackChoice::IKARI); battle->ActiveHero().GetAttackChoice().SetItem(battle->ActiveHero().IkariMenu().Selected()); - ctrl.PopState(); + Ctrl().PopState(); } } -void SelectIkari::OnPauseState(Application &ctrl, SDL_Surface *screen) { +void SelectIkari::OnPauseState(SDL_Surface *screen) { } diff --git a/src/battle/states/SelectIkari.h b/src/battle/states/SelectIkari.h index 136436f..8603a57 100644 --- a/src/battle/states/SelectIkari.h +++ b/src/battle/states/SelectIkari.h @@ -28,10 +28,10 @@ public: virtual void Render(SDL_Surface *); private: - virtual void OnEnterState(app::Application &ctrl, SDL_Surface *screen); - virtual void OnExitState(app::Application &ctrl, SDL_Surface *screen); - virtual void OnResumeState(app::Application &ctrl, SDL_Surface *screen); - virtual void OnPauseState(app::Application &ctrl, SDL_Surface *screen); + virtual void OnEnterState(SDL_Surface *screen); + virtual void OnExitState(SDL_Surface *screen); + virtual void OnResumeState(SDL_Surface *screen); + virtual void OnPauseState(SDL_Surface *screen); virtual void OnResize(int width, int height); diff --git a/src/battle/states/SelectItem.cpp b/src/battle/states/SelectItem.cpp index fe6ce7b..6ca4396 100644 --- a/src/battle/states/SelectItem.cpp +++ b/src/battle/states/SelectItem.cpp @@ -23,23 +23,23 @@ using graphics::Frame; namespace battle { -void SelectItem::OnEnterState(Application &c, SDL_Surface *screen) { +void SelectItem::OnEnterState(SDL_Surface *screen) { } -void SelectItem::OnExitState(Application &c, SDL_Surface *screen) { +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) { } diff --git a/src/battle/states/SelectItem.h b/src/battle/states/SelectItem.h index 52429aa..1942ff4 100644 --- a/src/battle/states/SelectItem.h +++ b/src/battle/states/SelectItem.h @@ -27,10 +27,10 @@ public: virtual void Render(SDL_Surface *); private: - virtual void OnEnterState(app::Application &ctrl, SDL_Surface *screen); - virtual void OnExitState(app::Application &ctrl, SDL_Surface *screen); - virtual void OnResumeState(app::Application &ctrl, SDL_Surface *screen); - virtual void OnPauseState(app::Application &ctrl, SDL_Surface *screen); + virtual void OnEnterState(SDL_Surface *screen); + virtual void OnExitState(SDL_Surface *screen); + virtual void OnResumeState(SDL_Surface *screen); + virtual void OnPauseState(SDL_Surface *screen); virtual void OnResize(int width, int height); diff --git a/src/battle/states/SelectMoveAction.cpp b/src/battle/states/SelectMoveAction.cpp index bb71487..52b670b 100644 --- a/src/battle/states/SelectMoveAction.cpp +++ b/src/battle/states/SelectMoveAction.cpp @@ -21,19 +21,19 @@ using geometry::Vector; namespace battle { -void SelectMoveAction::OnEnterState(Application &c, SDL_Surface *screen) { +void SelectMoveAction::OnEnterState(SDL_Surface *screen) { } -void SelectMoveAction::OnExitState(Application &c, SDL_Surface *screen) { +void SelectMoveAction::OnExitState(SDL_Surface *screen) { } -void SelectMoveAction::OnResumeState(Application &ctrl, SDL_Surface *screen) { +void SelectMoveAction::OnResumeState(SDL_Surface *screen) { } -void SelectMoveAction::OnPauseState(Application &ctrl, SDL_Surface *screen) { +void SelectMoveAction::OnPauseState(SDL_Surface *screen) { } diff --git a/src/battle/states/SelectMoveAction.h b/src/battle/states/SelectMoveAction.h index cd54aed..a48633d 100644 --- a/src/battle/states/SelectMoveAction.h +++ b/src/battle/states/SelectMoveAction.h @@ -27,10 +27,10 @@ public: virtual void Render(SDL_Surface *); private: - virtual void OnEnterState(app::Application &ctrl, SDL_Surface *screen); - virtual void OnExitState(app::Application &ctrl, SDL_Surface *screen); - virtual void OnResumeState(app::Application &ctrl, SDL_Surface *screen); - virtual void OnPauseState(app::Application &ctrl, SDL_Surface *screen); + virtual void OnEnterState(SDL_Surface *screen); + virtual void OnExitState(SDL_Surface *screen); + virtual void OnResumeState(SDL_Surface *screen); + virtual void OnPauseState(SDL_Surface *screen); virtual void OnResize(int width, int height); diff --git a/src/battle/states/SelectSpell.cpp b/src/battle/states/SelectSpell.cpp index 623181e..d7941c8 100644 --- a/src/battle/states/SelectSpell.cpp +++ b/src/battle/states/SelectSpell.cpp @@ -24,23 +24,23 @@ using graphics::Frame; namespace battle { -void SelectSpell::OnEnterState(Application &c, SDL_Surface *screen) { +void SelectSpell::OnEnterState(SDL_Surface *screen) { } -void SelectSpell::OnExitState(Application &c, SDL_Surface *screen) { +void SelectSpell::OnExitState(SDL_Surface *screen) { } -void SelectSpell::OnResumeState(Application &ctrl, SDL_Surface *screen) { +void SelectSpell::OnResumeState(SDL_Surface *screen) { if (battle->ActiveHero().GetAttackChoice().Selection().HasSelected()) { battle->ActiveHero().GetAttackChoice().SetType(AttackChoice::MAGIC); battle->ActiveHero().GetAttackChoice().SetSpell(battle->ActiveHero().SpellMenu().Selected()); - ctrl.PopState(); + Ctrl().PopState(); } } -void SelectSpell::OnPauseState(Application &ctrl, SDL_Surface *screen) { +void SelectSpell::OnPauseState(SDL_Surface *screen) { } diff --git a/src/battle/states/SelectSpell.h b/src/battle/states/SelectSpell.h index a1bbac7..514a2b8 100644 --- a/src/battle/states/SelectSpell.h +++ b/src/battle/states/SelectSpell.h @@ -27,10 +27,10 @@ public: virtual void Render(SDL_Surface *); private: - virtual void OnEnterState(app::Application &ctrl, SDL_Surface *screen); - virtual void OnExitState(app::Application &ctrl, SDL_Surface *screen); - virtual void OnResumeState(app::Application &ctrl, SDL_Surface *screen); - virtual void OnPauseState(app::Application &ctrl, SDL_Surface *screen); + virtual void OnEnterState(SDL_Surface *screen); + virtual void OnExitState(SDL_Surface *screen); + virtual void OnResumeState(SDL_Surface *screen); + virtual void OnPauseState(SDL_Surface *screen); virtual void OnResize(int width, int height); diff --git a/src/battle/states/SelectTarget.cpp b/src/battle/states/SelectTarget.cpp index 740e46c..1961738 100644 --- a/src/battle/states/SelectTarget.cpp +++ b/src/battle/states/SelectTarget.cpp @@ -19,19 +19,19 @@ using std::vector; namespace battle { -void SelectTarget::OnEnterState(Application &c, SDL_Surface *screen) { +void SelectTarget::OnEnterState(SDL_Surface *screen) { } -void SelectTarget::OnExitState(Application &c, SDL_Surface *screen) { +void SelectTarget::OnExitState(SDL_Surface *screen) { } -void SelectTarget::OnResumeState(Application &ctrl, SDL_Surface *screen) { +void SelectTarget::OnResumeState(SDL_Surface *screen) { } -void SelectTarget::OnPauseState(Application &ctrl, SDL_Surface *screen) { +void SelectTarget::OnPauseState(SDL_Surface *screen) { } diff --git a/src/battle/states/SelectTarget.h b/src/battle/states/SelectTarget.h index 01ebba7..388aef3 100644 --- a/src/battle/states/SelectTarget.h +++ b/src/battle/states/SelectTarget.h @@ -28,10 +28,10 @@ public: virtual void Render(SDL_Surface *); private: - virtual void OnEnterState(app::Application &ctrl, SDL_Surface *screen); - virtual void OnExitState(app::Application &ctrl, SDL_Surface *screen); - virtual void OnResumeState(app::Application &ctrl, SDL_Surface *screen); - virtual void OnPauseState(app::Application &ctrl, SDL_Surface *screen); + virtual void OnEnterState(SDL_Surface *screen); + virtual void OnExitState(SDL_Surface *screen); + virtual void OnResumeState(SDL_Surface *screen); + virtual void OnPauseState(SDL_Surface *screen); virtual void OnResize(int width, int height); diff --git a/src/battle/states/SwapHeroes.cpp b/src/battle/states/SwapHeroes.cpp index 0dcd0bd..357e324 100644 --- a/src/battle/states/SwapHeroes.cpp +++ b/src/battle/states/SwapHeroes.cpp @@ -19,19 +19,19 @@ using std::vector; namespace battle { -void SwapHeroes::OnEnterState(Application &c, SDL_Surface *screen) { +void SwapHeroes::OnEnterState(SDL_Surface *screen) { } -void SwapHeroes::OnExitState(Application &c, SDL_Surface *screen) { +void SwapHeroes::OnExitState(SDL_Surface *screen) { } -void SwapHeroes::OnResumeState(Application &ctrl, SDL_Surface *screen) { +void SwapHeroes::OnResumeState(SDL_Surface *screen) { } -void SwapHeroes::OnPauseState(Application &ctrl, SDL_Surface *screen) { +void SwapHeroes::OnPauseState(SDL_Surface *screen) { } diff --git a/src/battle/states/SwapHeroes.h b/src/battle/states/SwapHeroes.h index 1710721..198e4d3 100644 --- a/src/battle/states/SwapHeroes.h +++ b/src/battle/states/SwapHeroes.h @@ -27,10 +27,10 @@ public: virtual void Render(SDL_Surface *); private: - virtual void OnEnterState(app::Application &ctrl, SDL_Surface *screen); - virtual void OnExitState(app::Application &ctrl, SDL_Surface *screen); - virtual void OnResumeState(app::Application &ctrl, SDL_Surface *screen); - virtual void OnPauseState(app::Application &ctrl, SDL_Surface *screen); + virtual void OnEnterState(SDL_Surface *screen); + virtual void OnExitState(SDL_Surface *screen); + virtual void OnResumeState(SDL_Surface *screen); + virtual void OnPauseState(SDL_Surface *screen); virtual void OnResize(int width, int height); diff --git a/src/graphics/ColorFade.cpp b/src/graphics/ColorFade.cpp index f194665..8afd87b 100644 --- a/src/graphics/ColorFade.cpp +++ b/src/graphics/ColorFade.cpp @@ -29,7 +29,7 @@ ColorFade::ColorFade(State *slave, Uint32 color, int duration, bool in, bool int } -void ColorFade::OnEnterState(Application &c, SDL_Surface *screen) { +void ColorFade::OnEnterState(SDL_Surface *screen) { if (leadIn > 0) { timer = GraphicsTimers().StartCountdown(leadIn); } else { @@ -38,18 +38,18 @@ void ColorFade::OnEnterState(Application &c, SDL_Surface *screen) { } } -void ColorFade::OnExitState(Application &, SDL_Surface *screen) { +void ColorFade::OnExitState(SDL_Surface *screen) { if (blinds) { SDL_FreeSurface(blinds); blinds = 0; } } -void ColorFade::OnResumeState(Application &ctrl, SDL_Surface *screen) { +void ColorFade::OnResumeState(SDL_Surface *screen) { UpdateBlinds(screen->w, screen->h); } -void ColorFade::OnPauseState(Application &ctrl, SDL_Surface *screen) { +void ColorFade::OnPauseState(SDL_Surface *screen) { } diff --git a/src/graphics/ColorFade.h b/src/graphics/ColorFade.h index 5e14663..079d30e 100644 --- a/src/graphics/ColorFade.h +++ b/src/graphics/ColorFade.h @@ -32,10 +32,10 @@ public: virtual void Render(SDL_Surface *); private: - virtual void OnEnterState(app::Application &ctrl, SDL_Surface *screen); - virtual void OnExitState(app::Application &ctrl, SDL_Surface *screen); - virtual void OnResumeState(app::Application &ctrl, SDL_Surface *screen); - virtual void OnPauseState(app::Application &ctrl, SDL_Surface *screen); + virtual void OnEnterState(SDL_Surface *screen); + virtual void OnExitState(SDL_Surface *screen); + virtual void OnResumeState(SDL_Surface *screen); + virtual void OnPauseState(SDL_Surface *screen); virtual void OnResize(int width, int height); diff --git a/src/map/MapState.cpp b/src/map/MapState.cpp index 8e70acd..500acea 100644 --- a/src/map/MapState.cpp +++ b/src/map/MapState.cpp @@ -46,20 +46,20 @@ MapState::MapState(GameConfig *g, Map *map) } -void MapState::OnEnterState(Application &c, SDL_Surface *screen) { +void MapState::OnEnterState(SDL_Surface *screen) { camera.Resize(screen->w, screen->h); LoadMap(map); } -void MapState::OnExitState(Application &ctrl, SDL_Surface *screen) { +void MapState::OnExitState(SDL_Surface *screen) { } -void MapState::OnResumeState(Application &ctrl, SDL_Surface *screen) { +void MapState::OnResumeState(SDL_Surface *screen) { camera.Resize(screen->w, screen->h); } -void MapState::OnPauseState(Application &ctrl, SDL_Surface *screen) { +void MapState::OnPauseState(SDL_Surface *screen) { } diff --git a/src/map/MapState.h b/src/map/MapState.h index 9cff10c..1b53d77 100644 --- a/src/map/MapState.h +++ b/src/map/MapState.h @@ -45,10 +45,10 @@ public: virtual void HandleSyscall(common::ScriptRunner &); private: - virtual void OnEnterState(app::Application &ctrl, SDL_Surface *screen); - virtual void OnExitState(app::Application &ctrl, SDL_Surface *screen); - virtual void OnResumeState(app::Application &ctrl, SDL_Surface *screen); - virtual void OnPauseState(app::Application &ctrl, SDL_Surface *screen); + virtual void OnEnterState(SDL_Surface *screen); + virtual void OnExitState(SDL_Surface *screen); + virtual void OnResumeState(SDL_Surface *screen); + virtual void OnPauseState(SDL_Surface *screen); virtual void OnResize(int width, int height); diff --git a/src/map/TransitionState.cpp b/src/map/TransitionState.cpp index b339381..4490f83 100644 --- a/src/map/TransitionState.cpp +++ b/src/map/TransitionState.cpp @@ -24,19 +24,19 @@ TransitionState::TransitionState(MapState *ms, Map *map, const Vector &coor } -void TransitionState::OnEnterState(Application &c, SDL_Surface *screen) { +void TransitionState::OnEnterState(SDL_Surface *screen) { } -void TransitionState::OnExitState(Application &, SDL_Surface *screen) { +void TransitionState::OnExitState(SDL_Surface *screen) { } -void TransitionState::OnResumeState(Application &ctrl, SDL_Surface *screen) { +void TransitionState::OnResumeState(SDL_Surface *screen) { } -void TransitionState::OnPauseState(Application &ctrl, SDL_Surface *screen) { +void TransitionState::OnPauseState(SDL_Surface *screen) { } diff --git a/src/map/TransitionState.h b/src/map/TransitionState.h index 134e54a..1790d71 100644 --- a/src/map/TransitionState.h +++ b/src/map/TransitionState.h @@ -27,10 +27,10 @@ public: virtual void Render(SDL_Surface *); private: - virtual void OnEnterState(app::Application &ctrl, SDL_Surface *screen); - virtual void OnExitState(app::Application &ctrl, SDL_Surface *screen); - virtual void OnResumeState(app::Application &ctrl, SDL_Surface *screen); - virtual void OnPauseState(app::Application &ctrl, SDL_Surface *screen); + virtual void OnEnterState(SDL_Surface *screen); + virtual void OnExitState(SDL_Surface *screen); + virtual void OnResumeState(SDL_Surface *screen); + virtual void OnPauseState(SDL_Surface *screen); virtual void OnResize(int width, int height); -- 2.39.2