Merge pull request #5561 from boyu0/v3.0_final_test

Move Box2dTestBed step method to onDraw.
This commit is contained in:
James Chen 2014-03-05 19:28:42 +08:00
commit 12206fc1fd
2 changed files with 2 additions and 9 deletions

View File

@ -176,9 +176,7 @@ Box2DView* Box2DView::viewWithEntryID(int entryId)
}
bool Box2DView::initWithEntryID(int entryId)
{
schedule( schedule_selector(Box2DView::tick) );
{
m_entry = g_testEntries + entryId;
m_test = m_entry->createFcn();
@ -202,11 +200,6 @@ std::string Box2DView::title() const
return std::string(m_entry->name);
}
void Box2DView::tick(float dt)
{
m_test->Step(&settings);
}
void Box2DView::draw(Renderer *renderer, const kmMat4 &transform, bool transformUpdated)
{
Layer::draw(renderer, transform, transformUpdated);
@ -222,6 +215,7 @@ void Box2DView::onDraw()
kmGLGetMatrix(KM_GL_MODELVIEW, &oldMat);
kmGLLoadMatrix(&_modelViewTransform);
GL::enableVertexAttribs( cocos2d::GL::VERTEX_ATTRIB_FLAG_POSITION );
m_test->Step(&settings);
m_test->m_world->DrawDebugData();
CHECK_GL_ERROR_DEBUG();

View File

@ -41,7 +41,6 @@ public:
bool initWithEntryID(int entryId);
std::string title() const;
void tick(float dt);
virtual void draw(Renderer *renderer, const kmMat4 &transform, bool transformUpdated) override;
// virtual void registerWithTouchDispatcher();