diff --git a/tests/Classes/Box2DTestBed/Box2dView.cpp b/tests/Classes/Box2DTestBed/Box2dView.cpp index eee2ea87de..d1f8518bb1 100644 --- a/tests/Classes/Box2DTestBed/Box2dView.cpp +++ b/tests/Classes/Box2DTestBed/Box2dView.cpp @@ -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(); diff --git a/tests/Classes/Box2DTestBed/Box2dView.h b/tests/Classes/Box2DTestBed/Box2dView.h index aded546074..ec7307e453 100644 --- a/tests/Classes/Box2DTestBed/Box2dView.h +++ b/tests/Classes/Box2DTestBed/Box2dView.h @@ -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();