瀏覽代碼

btphystest tweak to delay app init.

undefined
Benjamin ‘Touky’ Huet Sam Hocevar <sam@hocevar.net> 11 年之前
父節點
當前提交
fb7d8a25e2
共有 2 個檔案被更改,包括 21 行新增0 行删除
  1. +18
    -0
      test/btphystest.cpp
  2. +3
    -0
      test/btphystest.h

+ 18
- 0
test/btphystest.cpp 查看文件

@@ -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 查看文件

@@ -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…
取消
儲存