From 65158353d1ecbed0032752863c6c4eb96b1a084a Mon Sep 17 00:00:00 2001 From: Daniel Karbach Date: Tue, 16 Oct 2012 23:02:42 +0200 Subject: [PATCH] renamed state callbacks --- src/app/Application.cpp | 24 ++++++++++++------------ src/app/State.h | 8 ++++---- src/battle/BattleState.cpp | 8 ++++---- 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 | 8 ++++---- src/battle/states/SelectAttackType.h | 8 ++++---- src/battle/states/SelectIkari.cpp | 8 ++++---- src/battle/states/SelectIkari.h | 8 ++++---- src/battle/states/SelectItem.cpp | 8 ++++---- src/battle/states/SelectItem.h | 8 ++++---- src/battle/states/SelectMoveAction.cpp | 8 ++++---- src/battle/states/SelectMoveAction.h | 8 ++++---- src/battle/states/SelectSpell.cpp | 8 ++++---- 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 ++++---- 28 files changed, 120 insertions(+), 120 deletions(-) diff --git a/src/app/Application.cpp b/src/app/Application.cpp index f773cfc..06ea727 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()->ExitState(*this, screen.Screen()); + states.top()->OnPauseState(*this, screen.Screen()); + states.top()->OnExitState(*this, screen.Screen()); states.pop(); } states.push(s); - s->EnterState(*this, screen.Screen()); - s->ResumeState(*this, screen.Screen()); + s->OnEnterState(*this, screen.Screen()); + s->OnResumeState(*this, screen.Screen()); } void Application::RealPushState(State *s) { if (!states.empty()) { - states.top()->PauseState(*this, screen.Screen()); + states.top()->OnPauseState(*this, screen.Screen()); } states.push(s); - s->EnterState(*this, screen.Screen()); - s->ResumeState(*this, screen.Screen()); + s->OnEnterState(*this, screen.Screen()); + s->OnResumeState(*this, screen.Screen()); } void Application::RealPopState() { if (states.empty()) return; - states.top()->PauseState(*this, screen.Screen()); - states.top()->ExitState(*this, screen.Screen()); + states.top()->OnPauseState(*this, screen.Screen()); + states.top()->OnExitState(*this, screen.Screen()); delete states.top(); states.pop(); if (!states.empty()) { - states.top()->ResumeState(*this, screen.Screen()); + states.top()->OnResumeState(*this, screen.Screen()); } } @@ -120,8 +120,8 @@ void Application::Quit() { void Application::PopAllStates() { while (!states.empty()) { - states.top()->PauseState(*this, screen.Screen()); - states.top()->ExitState(*this, screen.Screen()); + states.top()->OnPauseState(*this, screen.Screen()); + states.top()->OnExitState(*this, screen.Screen()); delete states.top(); states.pop(); } diff --git a/src/app/State.h b/src/app/State.h index 41af536..28cb94d 100644 --- a/src/app/State.h +++ b/src/app/State.h @@ -26,14 +26,14 @@ public: /// can not be done by the constructor. /// Called when the state first enters the stack. /// @param ctrl the Application running the state - virtual void EnterState(Application &ctrl, SDL_Surface *screen) = 0; + virtual void OnEnterState(Application &ctrl, SDL_Surface *screen) = 0; /// Do some cleanup. /// Called when the state is popped from the stack. - virtual void ExitState(Application &ctrl, SDL_Surface *screen) = 0; + virtual void OnExitState(Application &ctrl, SDL_Surface *screen) = 0; /// Called when the state becomes the active one. - virtual void ResumeState(Application &ctrl, SDL_Surface *screen) = 0; + virtual void OnResumeState(Application &ctrl, SDL_Surface *screen) = 0; /// Called when the state becomes inactive. - virtual void PauseState(Application &ctrl, SDL_Surface *screen) = 0; + virtual void OnPauseState(Application &ctrl, 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 dcd824e..c2310ea 100644 --- a/src/battle/BattleState.cpp +++ b/src/battle/BattleState.cpp @@ -79,7 +79,7 @@ void BattleState::Resize(int w, int h) { } -void BattleState::EnterState(Application &ctrl, SDL_Surface *screen) { +void BattleState::OnEnterState(Application &ctrl, 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,11 +130,11 @@ void BattleState::LoadInventory() { ClearAllAttacks(); } -void BattleState::ExitState(Application &ctrl, SDL_Surface *screen) { +void BattleState::OnExitState(Application &ctrl, SDL_Surface *screen) { } -void BattleState::ResumeState(Application &ctrl, SDL_Surface *screen) { +void BattleState::OnResumeState(Application &ctrl, SDL_Surface *screen) { if (ranAway) { ctrl.PopState(); // quit the battle scene return; @@ -169,7 +169,7 @@ bool BattleState::Defeat() const { return true; } -void BattleState::PauseState(Application &ctrl, SDL_Surface *screen) { +void BattleState::OnPauseState(Application &ctrl, SDL_Surface *screen) { } diff --git a/src/battle/BattleState.h b/src/battle/BattleState.h index 60c24bc..4ac6459 100644 --- a/src/battle/BattleState.h +++ b/src/battle/BattleState.h @@ -56,10 +56,10 @@ public: void AddHero(const Hero &); public: - virtual void EnterState(app::Application &ctrl, SDL_Surface *screen); - virtual void ExitState(app::Application &ctrl, SDL_Surface *screen); - virtual void ResumeState(app::Application &ctrl, SDL_Surface *screen); - virtual void PauseState(app::Application &ctrl, SDL_Surface *screen); + 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 Resize(int width, int height); diff --git a/src/battle/states/PerformAttacks.cpp b/src/battle/states/PerformAttacks.cpp index 19fccb0..2c82c09 100644 --- a/src/battle/states/PerformAttacks.cpp +++ b/src/battle/states/PerformAttacks.cpp @@ -29,23 +29,23 @@ using std::vector; namespace battle { -void PerformAttacks::EnterState(Application &c, SDL_Surface *screen) { +void PerformAttacks::OnEnterState(Application &c, SDL_Surface *screen) { ctrl = &c; battle->CalculateAttackOrder(); numberAnimation.reserve(battle->MaxMonsters() > battle->NumHeroes() + 1 ? battle->MaxMonsters() : battle->NumHeroes() + 1); numberPosition.reserve(numberAnimation.size()); } -void PerformAttacks::ExitState(Application &c, SDL_Surface *screen) { +void PerformAttacks::OnExitState(Application &c, SDL_Surface *screen) { battle->ClearAllAttacks(); ctrl = 0; } -void PerformAttacks::ResumeState(Application &ctrl, SDL_Surface *screen) { +void PerformAttacks::OnResumeState(Application &ctrl, SDL_Surface *screen) { } -void PerformAttacks::PauseState(Application &ctrl, SDL_Surface *screen) { +void PerformAttacks::OnPauseState(Application &ctrl, SDL_Surface *screen) { } diff --git a/src/battle/states/PerformAttacks.h b/src/battle/states/PerformAttacks.h index 19c6967..44ea74b 100644 --- a/src/battle/states/PerformAttacks.h +++ b/src/battle/states/PerformAttacks.h @@ -27,10 +27,10 @@ public: : ctrl(0), battle(battle), moveAnimation(0), targetAnimation(0), titleBarText(0), cursor(-1) { } public: - virtual void EnterState(app::Application &ctrl, SDL_Surface *screen); - virtual void ExitState(app::Application &ctrl, SDL_Surface *screen); - virtual void ResumeState(app::Application &ctrl, SDL_Surface *screen); - virtual void PauseState(app::Application &ctrl, SDL_Surface *screen); + 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 Resize(int width, int height); diff --git a/src/battle/states/RunState.cpp b/src/battle/states/RunState.cpp index c75255c..56bcbed 100644 --- a/src/battle/states/RunState.cpp +++ b/src/battle/states/RunState.cpp @@ -22,19 +22,19 @@ using geometry::Vector; namespace battle { -void RunState::EnterState(Application &c, SDL_Surface *screen) { +void RunState::OnEnterState(Application &c, SDL_Surface *screen) { ctrl = &c; } -void RunState::ExitState(Application &c, SDL_Surface *screen) { +void RunState::OnExitState(Application &c, SDL_Surface *screen) { ctrl = 0; } -void RunState::ResumeState(Application &ctrl, SDL_Surface *screen) { +void RunState::OnResumeState(Application &ctrl, SDL_Surface *screen) { timer = GraphicsTimers().StartCountdown(2500); } -void RunState::PauseState(Application &ctrl, SDL_Surface *screen) { +void RunState::OnPauseState(Application &ctrl, SDL_Surface *screen) { } diff --git a/src/battle/states/RunState.h b/src/battle/states/RunState.h index 7af5461..b1c18cb 100644 --- a/src/battle/states/RunState.h +++ b/src/battle/states/RunState.h @@ -22,10 +22,10 @@ public: : ctrl(0), battle(battle){ } public: - virtual void EnterState(app::Application &ctrl, SDL_Surface *screen); - virtual void ExitState(app::Application &ctrl, SDL_Surface *screen); - virtual void ResumeState(app::Application &ctrl, SDL_Surface *screen); - virtual void PauseState(app::Application &ctrl, SDL_Surface *screen); + 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 Resize(int width, int height); diff --git a/src/battle/states/SelectAttackType.cpp b/src/battle/states/SelectAttackType.cpp index fbd4333..351ad1c 100644 --- a/src/battle/states/SelectAttackType.cpp +++ b/src/battle/states/SelectAttackType.cpp @@ -27,15 +27,15 @@ using geometry::Vector; namespace battle { -void SelectAttackType::EnterState(Application &c, SDL_Surface *screen) { +void SelectAttackType::OnEnterState(Application &c, SDL_Surface *screen) { ctrl = &c; } -void SelectAttackType::ExitState(Application &c, SDL_Surface *screen) { +void SelectAttackType::OnExitState(Application &c, SDL_Surface *screen) { ctrl = 0; } -void SelectAttackType::ResumeState(Application &ctrl, SDL_Surface *screen) { +void SelectAttackType::OnResumeState(Application &ctrl, SDL_Surface *screen) { if (battle->ActiveHero().GetAttackChoice().Selection().HasSelected()) { battle->ActiveHero().GetAttackChoice().SetType(battle->GetAttackTypeMenu().Selected()); battle->NextHero(); @@ -46,7 +46,7 @@ void SelectAttackType::ResumeState(Application &ctrl, SDL_Surface *screen) { } } -void SelectAttackType::PauseState(Application &ctrl, SDL_Surface *screen) { +void SelectAttackType::OnPauseState(Application &ctrl, SDL_Surface *screen) { } diff --git a/src/battle/states/SelectAttackType.h b/src/battle/states/SelectAttackType.h index 17298b2..6acaaef 100644 --- a/src/battle/states/SelectAttackType.h +++ b/src/battle/states/SelectAttackType.h @@ -22,10 +22,10 @@ public: : ctrl(0), battle(battle) { } public: - virtual void EnterState(app::Application &ctrl, SDL_Surface *screen); - virtual void ExitState(app::Application &ctrl, SDL_Surface *screen); - virtual void ResumeState(app::Application &ctrl, SDL_Surface *screen); - virtual void PauseState(app::Application &ctrl, SDL_Surface *screen); + 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 Resize(int width, int height); diff --git a/src/battle/states/SelectIkari.cpp b/src/battle/states/SelectIkari.cpp index 22853ce..898b85c 100644 --- a/src/battle/states/SelectIkari.cpp +++ b/src/battle/states/SelectIkari.cpp @@ -24,15 +24,15 @@ using graphics::Frame; namespace battle { -void SelectIkari::EnterState(Application &c, SDL_Surface *screen) { +void SelectIkari::OnEnterState(Application &c, SDL_Surface *screen) { ctrl = &c; } -void SelectIkari::ExitState(Application &c, SDL_Surface *screen) { +void SelectIkari::OnExitState(Application &c, SDL_Surface *screen) { ctrl = 0; } -void SelectIkari::ResumeState(Application &ctrl, SDL_Surface *screen) { +void SelectIkari::OnResumeState(Application &ctrl, SDL_Surface *screen) { if (battle->ActiveHero().GetAttackChoice().Selection().HasSelected()) { battle->ActiveHero().GetAttackChoice().SetType(AttackChoice::IKARI); battle->ActiveHero().GetAttackChoice().SetItem(battle->ActiveHero().IkariMenu().Selected()); @@ -40,7 +40,7 @@ void SelectIkari::ResumeState(Application &ctrl, SDL_Surface *screen) { } } -void SelectIkari::PauseState(Application &ctrl, SDL_Surface *screen) { +void SelectIkari::OnPauseState(Application &ctrl, SDL_Surface *screen) { } diff --git a/src/battle/states/SelectIkari.h b/src/battle/states/SelectIkari.h index 8e565c4..9e89912 100644 --- a/src/battle/states/SelectIkari.h +++ b/src/battle/states/SelectIkari.h @@ -23,10 +23,10 @@ public: : ctrl(0), battle(battle), parent(parent) { } public: - virtual void EnterState(app::Application &ctrl, SDL_Surface *screen); - virtual void ExitState(app::Application &ctrl, SDL_Surface *screen); - virtual void ResumeState(app::Application &ctrl, SDL_Surface *screen); - virtual void PauseState(app::Application &ctrl, SDL_Surface *screen); + 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 Resize(int width, int height); diff --git a/src/battle/states/SelectItem.cpp b/src/battle/states/SelectItem.cpp index e0f6aeb..86f11c2 100644 --- a/src/battle/states/SelectItem.cpp +++ b/src/battle/states/SelectItem.cpp @@ -23,15 +23,15 @@ using graphics::Frame; namespace battle { -void SelectItem::EnterState(Application &c, SDL_Surface *screen) { +void SelectItem::OnEnterState(Application &c, SDL_Surface *screen) { ctrl = &c; } -void SelectItem::ExitState(Application &c, SDL_Surface *screen) { +void SelectItem::OnExitState(Application &c, SDL_Surface *screen) { ctrl = 0; } -void SelectItem::ResumeState(Application &ctrl, SDL_Surface *screen) { +void SelectItem::OnResumeState(Application &ctrl, SDL_Surface *screen) { if (battle->ActiveHero().GetAttackChoice().Selection().HasSelected()) { battle->ActiveHero().GetAttackChoice().SetType(AttackChoice::ITEM); battle->ActiveHero().GetAttackChoice().SetItem(battle->ItemMenu().Selected()); @@ -39,7 +39,7 @@ void SelectItem::ResumeState(Application &ctrl, SDL_Surface *screen) { } } -void SelectItem::PauseState(Application &ctrl, SDL_Surface *screen) { +void SelectItem::OnPauseState(Application &ctrl, SDL_Surface *screen) { } diff --git a/src/battle/states/SelectItem.h b/src/battle/states/SelectItem.h index 3d03d2f..bf29124 100644 --- a/src/battle/states/SelectItem.h +++ b/src/battle/states/SelectItem.h @@ -22,10 +22,10 @@ public: : ctrl(0), battle(battle), parent(parent) { } public: - virtual void EnterState(app::Application &ctrl, SDL_Surface *screen); - virtual void ExitState(app::Application &ctrl, SDL_Surface *screen); - virtual void ResumeState(app::Application &ctrl, SDL_Surface *screen); - virtual void PauseState(app::Application &ctrl, SDL_Surface *screen); + 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 Resize(int width, int height); diff --git a/src/battle/states/SelectMoveAction.cpp b/src/battle/states/SelectMoveAction.cpp index b2cac81..351116b 100644 --- a/src/battle/states/SelectMoveAction.cpp +++ b/src/battle/states/SelectMoveAction.cpp @@ -21,19 +21,19 @@ using geometry::Vector; namespace battle { -void SelectMoveAction::EnterState(Application &c, SDL_Surface *screen) { +void SelectMoveAction::OnEnterState(Application &c, SDL_Surface *screen) { ctrl = &c; } -void SelectMoveAction::ExitState(Application &c, SDL_Surface *screen) { +void SelectMoveAction::OnExitState(Application &c, SDL_Surface *screen) { ctrl = 0; } -void SelectMoveAction::ResumeState(Application &ctrl, SDL_Surface *screen) { +void SelectMoveAction::OnResumeState(Application &ctrl, SDL_Surface *screen) { } -void SelectMoveAction::PauseState(Application &ctrl, SDL_Surface *screen) { +void SelectMoveAction::OnPauseState(Application &ctrl, SDL_Surface *screen) { } diff --git a/src/battle/states/SelectMoveAction.h b/src/battle/states/SelectMoveAction.h index 8a28468..f302ebf 100644 --- a/src/battle/states/SelectMoveAction.h +++ b/src/battle/states/SelectMoveAction.h @@ -22,10 +22,10 @@ public: : ctrl(0), battle(battle) { } public: - virtual void EnterState(app::Application &ctrl, SDL_Surface *screen); - virtual void ExitState(app::Application &ctrl, SDL_Surface *screen); - virtual void ResumeState(app::Application &ctrl, SDL_Surface *screen); - virtual void PauseState(app::Application &ctrl, SDL_Surface *screen); + 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 Resize(int width, int height); diff --git a/src/battle/states/SelectSpell.cpp b/src/battle/states/SelectSpell.cpp index df92733..cdf9b69 100644 --- a/src/battle/states/SelectSpell.cpp +++ b/src/battle/states/SelectSpell.cpp @@ -24,15 +24,15 @@ using graphics::Frame; namespace battle { -void SelectSpell::EnterState(Application &c, SDL_Surface *screen) { +void SelectSpell::OnEnterState(Application &c, SDL_Surface *screen) { ctrl = &c; } -void SelectSpell::ExitState(Application &c, SDL_Surface *screen) { +void SelectSpell::OnExitState(Application &c, SDL_Surface *screen) { ctrl = 0; } -void SelectSpell::ResumeState(Application &ctrl, SDL_Surface *screen) { +void SelectSpell::OnResumeState(Application &ctrl, SDL_Surface *screen) { if (battle->ActiveHero().GetAttackChoice().Selection().HasSelected()) { battle->ActiveHero().GetAttackChoice().SetType(AttackChoice::MAGIC); battle->ActiveHero().GetAttackChoice().SetSpell(battle->ActiveHero().SpellMenu().Selected()); @@ -40,7 +40,7 @@ void SelectSpell::ResumeState(Application &ctrl, SDL_Surface *screen) { } } -void SelectSpell::PauseState(Application &ctrl, SDL_Surface *screen) { +void SelectSpell::OnPauseState(Application &ctrl, SDL_Surface *screen) { } diff --git a/src/battle/states/SelectSpell.h b/src/battle/states/SelectSpell.h index 38d2c39..237e662 100644 --- a/src/battle/states/SelectSpell.h +++ b/src/battle/states/SelectSpell.h @@ -22,10 +22,10 @@ public: : ctrl(0), battle(battle), parent(parent) { } public: - virtual void EnterState(app::Application &ctrl, SDL_Surface *screen); - virtual void ExitState(app::Application &ctrl, SDL_Surface *screen); - virtual void ResumeState(app::Application &ctrl, SDL_Surface *screen); - virtual void PauseState(app::Application &ctrl, SDL_Surface *screen); + 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 Resize(int width, int height); diff --git a/src/battle/states/SelectTarget.cpp b/src/battle/states/SelectTarget.cpp index e857288..0b5b01d 100644 --- a/src/battle/states/SelectTarget.cpp +++ b/src/battle/states/SelectTarget.cpp @@ -19,19 +19,19 @@ using std::vector; namespace battle { -void SelectTarget::EnterState(Application &c, SDL_Surface *screen) { +void SelectTarget::OnEnterState(Application &c, SDL_Surface *screen) { ctrl = &c; } -void SelectTarget::ExitState(Application &c, SDL_Surface *screen) { +void SelectTarget::OnExitState(Application &c, SDL_Surface *screen) { ctrl = 0; } -void SelectTarget::ResumeState(Application &ctrl, SDL_Surface *screen) { +void SelectTarget::OnResumeState(Application &ctrl, SDL_Surface *screen) { } -void SelectTarget::PauseState(Application &ctrl, SDL_Surface *screen) { +void SelectTarget::OnPauseState(Application &ctrl, SDL_Surface *screen) { } diff --git a/src/battle/states/SelectTarget.h b/src/battle/states/SelectTarget.h index 9bd51f5..50d1000 100644 --- a/src/battle/states/SelectTarget.h +++ b/src/battle/states/SelectTarget.h @@ -23,10 +23,10 @@ public: : ctrl(0), battle(battle), parent(parent), selection(selection), cursorIcon(cursorIcon), flipFlop(true) { } public: - virtual void EnterState(app::Application &ctrl, SDL_Surface *screen); - virtual void ExitState(app::Application &ctrl, SDL_Surface *screen); - virtual void ResumeState(app::Application &ctrl, SDL_Surface *screen); - virtual void PauseState(app::Application &ctrl, SDL_Surface *screen); + 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 Resize(int width, int height); diff --git a/src/battle/states/SwapHeroes.cpp b/src/battle/states/SwapHeroes.cpp index 5c83f74..0feb7e9 100644 --- a/src/battle/states/SwapHeroes.cpp +++ b/src/battle/states/SwapHeroes.cpp @@ -19,19 +19,19 @@ using std::vector; namespace battle { -void SwapHeroes::EnterState(Application &c, SDL_Surface *screen) { +void SwapHeroes::OnEnterState(Application &c, SDL_Surface *screen) { ctrl = &c; } -void SwapHeroes::ExitState(Application &c, SDL_Surface *screen) { +void SwapHeroes::OnExitState(Application &c, SDL_Surface *screen) { ctrl = 0; } -void SwapHeroes::ResumeState(Application &ctrl, SDL_Surface *screen) { +void SwapHeroes::OnResumeState(Application &ctrl, SDL_Surface *screen) { } -void SwapHeroes::PauseState(Application &ctrl, SDL_Surface *screen) { +void SwapHeroes::OnPauseState(Application &ctrl, SDL_Surface *screen) { } diff --git a/src/battle/states/SwapHeroes.h b/src/battle/states/SwapHeroes.h index 8ad9298..1e7602a 100644 --- a/src/battle/states/SwapHeroes.h +++ b/src/battle/states/SwapHeroes.h @@ -22,10 +22,10 @@ public: : ctrl(0), battle(battle), parent(parent), cursor(0), selected(-1), flipFlop(true) { } public: - virtual void EnterState(app::Application &ctrl, SDL_Surface *screen); - virtual void ExitState(app::Application &ctrl, SDL_Surface *screen); - virtual void ResumeState(app::Application &ctrl, SDL_Surface *screen); - virtual void PauseState(app::Application &ctrl, SDL_Surface *screen); + 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 Resize(int width, int height); diff --git a/src/graphics/ColorFade.cpp b/src/graphics/ColorFade.cpp index e83edbb..ac45a9e 100644 --- a/src/graphics/ColorFade.cpp +++ b/src/graphics/ColorFade.cpp @@ -30,7 +30,7 @@ ColorFade::ColorFade(State *slave, Uint32 color, int duration, bool in, bool int } -void ColorFade::EnterState(Application &c, SDL_Surface *screen) { +void ColorFade::OnEnterState(Application &c, SDL_Surface *screen) { ctrl = &c; if (leadIn > 0) { timer = GraphicsTimers().StartCountdown(leadIn); @@ -40,18 +40,18 @@ void ColorFade::EnterState(Application &c, SDL_Surface *screen) { } } -void ColorFade::ExitState(Application &, SDL_Surface *screen) { +void ColorFade::OnExitState(Application &, SDL_Surface *screen) { if (blinds) { SDL_FreeSurface(blinds); blinds = 0; } } -void ColorFade::ResumeState(Application &ctrl, SDL_Surface *screen) { +void ColorFade::OnResumeState(Application &ctrl, SDL_Surface *screen) { UpdateBlinds(screen->w, screen->h); } -void ColorFade::PauseState(Application &ctrl, SDL_Surface *screen) { +void ColorFade::OnPauseState(Application &ctrl, SDL_Surface *screen) { } diff --git a/src/graphics/ColorFade.h b/src/graphics/ColorFade.h index 7226a00..4ccb02b 100644 --- a/src/graphics/ColorFade.h +++ b/src/graphics/ColorFade.h @@ -27,10 +27,10 @@ public: void SetLeadOutTime(int ms) { leadOut = ms; } public: - virtual void EnterState(app::Application &ctrl, SDL_Surface *screen); - virtual void ExitState(app::Application &ctrl, SDL_Surface *screen); - virtual void ResumeState(app::Application &ctrl, SDL_Surface *screen); - virtual void PauseState(app::Application &ctrl, SDL_Surface *screen); + 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 Resize(int width, int height); diff --git a/src/map/MapState.cpp b/src/map/MapState.cpp index 37ccc72..8103fb1 100644 --- a/src/map/MapState.cpp +++ b/src/map/MapState.cpp @@ -47,21 +47,21 @@ MapState::MapState(GameConfig *g, Map *map) } -void MapState::EnterState(Application &c, SDL_Surface *screen) { +void MapState::OnEnterState(Application &c, SDL_Surface *screen) { ctrl = &c; camera.Resize(screen->w, screen->h); LoadMap(map); } -void MapState::ExitState(Application &ctrl, SDL_Surface *screen) { +void MapState::OnExitState(Application &ctrl, SDL_Surface *screen) { } -void MapState::ResumeState(Application &ctrl, SDL_Surface *screen) { +void MapState::OnResumeState(Application &ctrl, SDL_Surface *screen) { camera.Resize(screen->w, screen->h); } -void MapState::PauseState(Application &ctrl, SDL_Surface *screen) { +void MapState::OnPauseState(Application &ctrl, SDL_Surface *screen) { } diff --git a/src/map/MapState.h b/src/map/MapState.h index 952bcee..35c6d64 100644 --- a/src/map/MapState.h +++ b/src/map/MapState.h @@ -30,10 +30,10 @@ public: virtual ~MapState() { } public: - virtual void EnterState(app::Application &ctrl, SDL_Surface *screen); - virtual void ExitState(app::Application &ctrl, SDL_Surface *screen); - virtual void ResumeState(app::Application &ctrl, SDL_Surface *screen); - virtual void PauseState(app::Application &ctrl, SDL_Surface *screen); + 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 Resize(int width, int height); virtual void HandleEvents(const app::Input &); diff --git a/src/map/TransitionState.cpp b/src/map/TransitionState.cpp index 9a1d699..75a4dea 100644 --- a/src/map/TransitionState.cpp +++ b/src/map/TransitionState.cpp @@ -25,19 +25,19 @@ TransitionState::TransitionState(MapState *ms, Map *map, const Vector &coor } -void TransitionState::EnterState(Application &c, SDL_Surface *screen) { +void TransitionState::OnEnterState(Application &c, SDL_Surface *screen) { ctrl = &c; } -void TransitionState::ExitState(Application &, SDL_Surface *screen) { +void TransitionState::OnExitState(Application &, SDL_Surface *screen) { } -void TransitionState::ResumeState(Application &ctrl, SDL_Surface *screen) { +void TransitionState::OnResumeState(Application &ctrl, SDL_Surface *screen) { } -void TransitionState::PauseState(Application &ctrl, SDL_Surface *screen) { +void TransitionState::OnPauseState(Application &ctrl, SDL_Surface *screen) { } diff --git a/src/map/TransitionState.h b/src/map/TransitionState.h index ee832a8..844665a 100644 --- a/src/map/TransitionState.h +++ b/src/map/TransitionState.h @@ -22,10 +22,10 @@ public: virtual ~TransitionState() { } public: - virtual void EnterState(app::Application &ctrl, SDL_Surface *screen); - virtual void ExitState(app::Application &ctrl, SDL_Surface *screen); - virtual void ResumeState(app::Application &ctrl, SDL_Surface *screen); - virtual void PauseState(app::Application &ctrl, SDL_Surface *screen); + 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 Resize(int width, int height); -- 2.39.2