浏览代码

btphystest tweak to delay app init.

undefined
Benjamin ‘Touky’ Huet Sam Hocevar <sam@hocevar.net> 12 年前
父节点
当前提交
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) BtPhysTest::BtPhysTest(bool editor)
{ {
m_init_done = false;
}

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

m_loop_value = .0f; m_loop_value = .0f;


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


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

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


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


if (!m_init_done)
return;

if (!m_ready) if (!m_ready)
{ {
#if CAT_MODE #if CAT_MODE


+ 3
- 0
test/btphystest.h 查看文件

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


void InitApp();

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


lol::phys::Simulation* m_simulation; lol::phys::Simulation* m_simulation;


正在加载...
取消
保存