From 83cfb79f8e02bea6473d11785e1770b94f60df1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20=E2=80=98Touky=E2=80=99=20Huet?= Date: Fri, 13 Sep 2013 10:54:08 +0000 Subject: [PATCH] btphystest : InitApp delay --- test/btphystest.cpp | 17 +++++++++++------ test/btphystest.h | 2 +- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/test/btphystest.cpp b/test/btphystest.cpp index 2a881ff6..03273913 100644 --- a/test/btphystest.cpp +++ b/test/btphystest.cpp @@ -59,12 +59,12 @@ LOLFX_RESOURCE_DECLARE(front_camera_sprite); BtPhysTest::BtPhysTest(bool editor) { - m_init_done = false; + m_init_status = 0; } void BtPhysTest::InitApp() { - m_init_done = true; + m_init_status = 1; m_loop_value = .0f; @@ -305,14 +305,19 @@ void BtPhysTest::TickGame(float seconds) { WorldEntity::TickGame(seconds); - if (!m_init_done) + if (!m_init_status) { if (g_renderer) InitApp(); - else - return; + return; + } + else if (m_init_status == 1) + { + m_init_status++; + return; } + if (m_controller->GetKey(KEY_QUIT).IsReleased()) Ticker::Shutdown(); @@ -565,7 +570,7 @@ void BtPhysTest::TickDraw(float seconds) { WorldEntity::TickDraw(seconds); - if (!m_init_done) + if (m_init_status != 2) return; if (!m_ready) diff --git a/test/btphystest.h b/test/btphystest.h index 773bf6f9..c63cbb53 100644 --- a/test/btphystest.h +++ b/test/btphystest.h @@ -64,7 +64,7 @@ private: Controller * m_controller; Light * m_light1; Light * m_light2; - bool m_init_done; + int m_init_status; bool m_ready; lol::phys::Simulation* m_simulation;