From 8a4f16fec62961a935f3b8da04d55387d19a1b56 Mon Sep 17 00:00:00 2001 From: boyu0 Date: Wed, 5 Mar 2014 15:40:16 +0800 Subject: [PATCH 1/2] Move Box2dTestBed step method to onDraw --- tests/Classes/Box2DTestBed/Box2dView.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Classes/Box2DTestBed/Box2dView.cpp b/tests/Classes/Box2DTestBed/Box2dView.cpp index eee2ea87de..0c2338b181 100644 --- a/tests/Classes/Box2DTestBed/Box2dView.cpp +++ b/tests/Classes/Box2DTestBed/Box2dView.cpp @@ -204,7 +204,6 @@ std::string Box2DView::title() const void Box2DView::tick(float dt) { - m_test->Step(&settings); } void Box2DView::draw(Renderer *renderer, const kmMat4 &transform, bool transformUpdated) @@ -222,6 +221,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(); From b0414a88ed23aec3cda6bb1599dee6bb20d73892 Mon Sep 17 00:00:00 2001 From: boyu0 Date: Wed, 5 Mar 2014 15:55:08 +0800 Subject: [PATCH 2/2] Delete Box2DView::tick() method. --- tests/Classes/Box2DTestBed/Box2dView.cpp | 8 +------- tests/Classes/Box2DTestBed/Box2dView.h | 1 - 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/tests/Classes/Box2DTestBed/Box2dView.cpp b/tests/Classes/Box2DTestBed/Box2dView.cpp index 0c2338b181..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,10 +200,6 @@ std::string Box2DView::title() const return std::string(m_entry->name); } -void Box2DView::tick(float dt) -{ -} - void Box2DView::draw(Renderer *renderer, const kmMat4 &transform, bool transformUpdated) { Layer::draw(renderer, transform, transformUpdated); 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();