mirror of https://github.com/axmolengine/axmol.git
Merge pull request #5561 from boyu0/v3.0_final_test
Move Box2dTestBed step method to onDraw.
This commit is contained in:
commit
12206fc1fd
|
@ -176,9 +176,7 @@ Box2DView* Box2DView::viewWithEntryID(int entryId)
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Box2DView::initWithEntryID(int entryId)
|
bool Box2DView::initWithEntryID(int entryId)
|
||||||
{
|
{
|
||||||
schedule( schedule_selector(Box2DView::tick) );
|
|
||||||
|
|
||||||
m_entry = g_testEntries + entryId;
|
m_entry = g_testEntries + entryId;
|
||||||
m_test = m_entry->createFcn();
|
m_test = m_entry->createFcn();
|
||||||
|
|
||||||
|
@ -202,11 +200,6 @@ std::string Box2DView::title() const
|
||||||
return std::string(m_entry->name);
|
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)
|
void Box2DView::draw(Renderer *renderer, const kmMat4 &transform, bool transformUpdated)
|
||||||
{
|
{
|
||||||
Layer::draw(renderer, transform, transformUpdated);
|
Layer::draw(renderer, transform, transformUpdated);
|
||||||
|
@ -222,6 +215,7 @@ void Box2DView::onDraw()
|
||||||
kmGLGetMatrix(KM_GL_MODELVIEW, &oldMat);
|
kmGLGetMatrix(KM_GL_MODELVIEW, &oldMat);
|
||||||
kmGLLoadMatrix(&_modelViewTransform);
|
kmGLLoadMatrix(&_modelViewTransform);
|
||||||
GL::enableVertexAttribs( cocos2d::GL::VERTEX_ATTRIB_FLAG_POSITION );
|
GL::enableVertexAttribs( cocos2d::GL::VERTEX_ATTRIB_FLAG_POSITION );
|
||||||
|
m_test->Step(&settings);
|
||||||
m_test->m_world->DrawDebugData();
|
m_test->m_world->DrawDebugData();
|
||||||
CHECK_GL_ERROR_DEBUG();
|
CHECK_GL_ERROR_DEBUG();
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,6 @@ public:
|
||||||
|
|
||||||
bool initWithEntryID(int entryId);
|
bool initWithEntryID(int entryId);
|
||||||
std::string title() const;
|
std::string title() const;
|
||||||
void tick(float dt);
|
|
||||||
virtual void draw(Renderer *renderer, const kmMat4 &transform, bool transformUpdated) override;
|
virtual void draw(Renderer *renderer, const kmMat4 &transform, bool transformUpdated) override;
|
||||||
|
|
||||||
// virtual void registerWithTouchDispatcher();
|
// virtual void registerWithTouchDispatcher();
|
||||||
|
|
Loading…
Reference in New Issue