Merge pull request #1624 from dumganhar/iss1564-update-tests

issue #1564: Fixed some bugs as follows.
Adding missing setter and getter function.
Removing one unnecessary line in CCRenderTexture::visit.
Set depth buffer to 24bit, stencil buffer to 8bit for windows.
Enable point size by default on windows. This can fix point size is always equal to 1 pixel in DrawPrimitivesTest.
This commit is contained in:
James Chen 2012-11-21 18:10:52 -08:00
commit ab86068ec4
3 changed files with 22 additions and 10 deletions

View File

@ -394,9 +394,9 @@ void CCRenderTexture::beginWithClear(float r, float g, float b, float a, float d
this->begin(); this->begin();
// save clear color // save clear color
GLfloat clearColor[4]; GLfloat clearColor[4] = {0.0f};
GLfloat depthClearValue; GLfloat depthClearValue = 0.0f;
int stencilClearValue; int stencilClearValue = 0;
if (flags & GL_COLOR_BUFFER_BIT) if (flags & GL_COLOR_BUFFER_BIT)
{ {
@ -512,7 +512,6 @@ void CCRenderTexture::visit()
if (m_pGrid && m_pGrid->isActive()) if (m_pGrid && m_pGrid->isActive())
{ {
m_pGrid->afterDraw(this); m_pGrid->afterDraw(this);
transformAncestors();
} }
kmGLPopMatrix(); kmGLPopMatrix();
@ -528,9 +527,9 @@ void CCRenderTexture::draw()
if (m_uClearFlags) if (m_uClearFlags)
{ {
GLfloat oldClearColor[4]; GLfloat oldClearColor[4] = {0.0f};
GLfloat oldDepthClearValue; GLfloat oldDepthClearValue = 0.0f;
GLint oldStencilClearValue; GLint oldStencilClearValue = 0;
// backup and set // backup and set
if (m_uClearFlags & GL_COLOR_BUFFER_BIT) if (m_uClearFlags & GL_COLOR_BUFFER_BIT)

View File

@ -78,14 +78,14 @@ static void SetupPixelFormat(HDC hDC)
PFD_DRAW_TO_WINDOW | // render to window PFD_DRAW_TO_WINDOW | // render to window
PFD_DOUBLEBUFFER, // support double-buffering PFD_DOUBLEBUFFER, // support double-buffering
PFD_TYPE_RGBA, // color type PFD_TYPE_RGBA, // color type
32, // prefered color depth 32, // preferred color depth
0, 0, 0, 0, 0, 0, // color bits (ignored) 0, 0, 0, 0, 0, 0, // color bits (ignored)
0, // no alpha buffer 0, // no alpha buffer
0, // alpha bits (ignored) 0, // alpha bits (ignored)
0, // no accumulation buffer 0, // no accumulation buffer
0, 0, 0, 0, // accum bits (ignored) 0, 0, 0, 0, // accum bits (ignored)
16, // depth buffer 24, // depth buffer
0, // no stencil buffer 8, // no stencil buffer
0, // no auxiliary buffers 0, // no auxiliary buffers
PFD_MAIN_PLANE, // main layer PFD_MAIN_PLANE, // main layer
0, // reserved 0, // reserved
@ -248,6 +248,9 @@ bool CCEGLView::initGL()
return false; return false;
} }
// Enable point size by default on windows.
glEnable(GL_VERTEX_PROGRAM_POINT_SIZE);
return true; return true;
} }

View File

@ -154,6 +154,16 @@ bool CCPhysicsSprite::isDirty()
return true; return true;
} }
bool CCPhysicsSprite::isIgnoreBodyRotation() const
{
return m_bIgnoreBodyRotation;
}
void CCPhysicsSprite::setIgnoreBodyRotation(bool bIgnoreBodyRotation)
{
m_bIgnoreBodyRotation = bIgnoreBodyRotation;
}
#if CC_ENABLE_CHIPMUNK_INTEGRATION #if CC_ENABLE_CHIPMUNK_INTEGRATION
cpBody* CCPhysicsSprite::getBody() const cpBody* CCPhysicsSprite::getBody() const