Make the Prepare and Destroy step more customizable.

This commit is contained in:
King_DuckZ 2014-07-28 10:58:15 +02:00
parent 250600d8b2
commit 63bb31e728
5 changed files with 20 additions and 5 deletions

View file

@ -60,7 +60,7 @@ namespace cloonel {
///--------------------------------------------------------------------------
///--------------------------------------------------------------------------
void GameplaySceneClassic::Prepare() {
void GameplaySceneClassic::OnPrepare() {
const float halfRefHeight = static_cast<float>(REFERENCE_HEIGHT) / 2.0f;
std::unique_ptr<MoverSine> moverSine(new MoverSine());
@ -101,6 +101,8 @@ namespace cloonel {
///--------------------------------------------------------------------------
///--------------------------------------------------------------------------
void GameplaySceneClassic::Destroy() noexcept {
GameplayScene::Destroy();
//Destroy in reverse creation order
m_platforms = std::move(std::unique_ptr<PlatformSystem>(nullptr));
m_wallpaper = std::move(std::unique_ptr<TiledWallpaper>(nullptr));
@ -108,6 +110,7 @@ namespace cloonel {
m_moverLeftRight = std::move(std::unique_ptr<MoverLeftRight>(nullptr));
m_player = std::move(std::unique_ptr<Character>(nullptr));
m_moverSine = std::move(std::unique_ptr<MoverSine>(nullptr));
}
///--------------------------------------------------------------------------