Browse Source

btphystest tweak to delay app init.

undefined
Benjamin ‘Touky’ Huet Sam Hocevar <sam@hocevar.net> 11 years ago
parent
commit
fb7d8a25e2
2 changed files with 21 additions and 0 deletions
  1. +18
    -0
      test/btphystest.cpp
  2. +3
    -0
      test/btphystest.h

+ 18
- 0
test/btphystest.cpp View File

@@ -59,6 +59,13 @@ LOLFX_RESOURCE_DECLARE(front_camera_sprite);

BtPhysTest::BtPhysTest(bool editor)
{
m_init_done = false;
}

void BtPhysTest::InitApp()
{
m_init_done = true;

m_loop_value = .0f;

#if CAT_MODE
@@ -298,6 +305,14 @@ void BtPhysTest::TickGame(float seconds)
{
WorldEntity::TickGame(seconds);

if (!m_init_done)
{
if (g_renderer)
InitApp();
else
return;
}

if (m_controller->GetKey(KEY_QUIT).IsReleased())
Ticker::Shutdown();

@@ -550,6 +565,9 @@ void BtPhysTest::TickDraw(float seconds)
{
WorldEntity::TickDraw(seconds);

if (!m_init_done)
return;

if (!m_ready)
{
#if CAT_MODE


+ 3
- 0
test/btphystest.h View File

@@ -41,6 +41,8 @@ protected:
virtual void TickGame(float seconds);
virtual void TickDraw(float seconds);

void InitApp();

private:
enum
{
@@ -62,6 +64,7 @@ private:
Controller * m_controller;
Light * m_light1;
Light * m_light2;
bool m_init_done;
bool m_ready;

lol::phys::Simulation* m_simulation;


Loading…
Cancel
Save