From add23eecda8a2c515cf4f54526ba0a5ff0d6a800 Mon Sep 17 00:00:00 2001 From: James Chen Date: Thu, 22 Nov 2012 09:49:37 +0800 Subject: [PATCH 1/4] issue #1564: Adding missing setter and getter function. --- extensions/physics_nodes/CCPhysicsSprite.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/extensions/physics_nodes/CCPhysicsSprite.cpp b/extensions/physics_nodes/CCPhysicsSprite.cpp index 932b36231b..d8f37e891a 100644 --- a/extensions/physics_nodes/CCPhysicsSprite.cpp +++ b/extensions/physics_nodes/CCPhysicsSprite.cpp @@ -154,6 +154,16 @@ bool CCPhysicsSprite::isDirty() return true; } +bool CCPhysicsSprite::isIgnoreBodyRotation() const +{ + return m_bIgnoreBodyRotation; +} + +void CCPhysicsSprite::setIgnoreBodyRotation(bool bIgnoreBodyRotation) +{ + m_bIgnoreBodyRotation = bIgnoreBodyRotation; +} + #if CC_ENABLE_CHIPMUNK_INTEGRATION cpBody* CCPhysicsSprite::getBody() const From e1f7c0bab68a86dfc0d3be0981cde97d1c0aa131 Mon Sep 17 00:00:00 2001 From: James Chen Date: Thu, 22 Nov 2012 09:52:50 +0800 Subject: [PATCH 2/4] issue #1564: Removing one unnecessary line in CCRenderTexture::visit. --- cocos2dx/misc_nodes/CCRenderTexture.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/cocos2dx/misc_nodes/CCRenderTexture.cpp b/cocos2dx/misc_nodes/CCRenderTexture.cpp index 73e4dcbe72..fc7656de6a 100644 --- a/cocos2dx/misc_nodes/CCRenderTexture.cpp +++ b/cocos2dx/misc_nodes/CCRenderTexture.cpp @@ -394,9 +394,9 @@ void CCRenderTexture::beginWithClear(float r, float g, float b, float a, float d this->begin(); // save clear color - GLfloat clearColor[4]; - GLfloat depthClearValue; - int stencilClearValue; + GLfloat clearColor[4] = {0.0f}; + GLfloat depthClearValue = 0.0f; + int stencilClearValue = 0; if (flags & GL_COLOR_BUFFER_BIT) { @@ -512,7 +512,6 @@ void CCRenderTexture::visit() if (m_pGrid && m_pGrid->isActive()) { m_pGrid->afterDraw(this); - transformAncestors(); } kmGLPopMatrix(); @@ -528,9 +527,9 @@ void CCRenderTexture::draw() if (m_uClearFlags) { - GLfloat oldClearColor[4]; - GLfloat oldDepthClearValue; - GLint oldStencilClearValue; + GLfloat oldClearColor[4] = {0.0f}; + GLfloat oldDepthClearValue = 0.0f; + GLint oldStencilClearValue = 0; // backup and set if (m_uClearFlags & GL_COLOR_BUFFER_BIT) From 6c81e21935d8205be6d3d72412d83bee7beaa2da Mon Sep 17 00:00:00 2001 From: James Chen Date: Thu, 22 Nov 2012 09:54:11 +0800 Subject: [PATCH 3/4] issue #1564: Set depth buffer to 24bit, stencil buffer to 8bit. --- cocos2dx/platform/win32/CCEGLView.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cocos2dx/platform/win32/CCEGLView.cpp b/cocos2dx/platform/win32/CCEGLView.cpp index 3dc8a05be3..44df86f806 100644 --- a/cocos2dx/platform/win32/CCEGLView.cpp +++ b/cocos2dx/platform/win32/CCEGLView.cpp @@ -78,14 +78,14 @@ static void SetupPixelFormat(HDC hDC) PFD_DRAW_TO_WINDOW | // render to window PFD_DOUBLEBUFFER, // support double-buffering PFD_TYPE_RGBA, // color type - 32, // prefered color depth + 32, // preferred color depth 0, 0, 0, 0, 0, 0, // color bits (ignored) 0, // no alpha buffer 0, // alpha bits (ignored) 0, // no accumulation buffer 0, 0, 0, 0, // accum bits (ignored) - 16, // depth buffer - 0, // no stencil buffer + 24, // depth buffer + 8, // no stencil buffer 0, // no auxiliary buffers PFD_MAIN_PLANE, // main layer 0, // reserved From 73b409f116a23eee8cb5b2dbc97526b0093a48af Mon Sep 17 00:00:00 2001 From: James Chen Date: Thu, 22 Nov 2012 10:04:35 +0800 Subject: [PATCH 4/4] issue #1564: Enable point size by default on windows. This can fix point size is always equal to 1 pixel in DrawPrimitivesTest. --- cocos2dx/platform/win32/CCEGLView.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cocos2dx/platform/win32/CCEGLView.cpp b/cocos2dx/platform/win32/CCEGLView.cpp index 44df86f806..264ac658ba 100644 --- a/cocos2dx/platform/win32/CCEGLView.cpp +++ b/cocos2dx/platform/win32/CCEGLView.cpp @@ -248,6 +248,9 @@ bool CCEGLView::initGL() return false; } + // Enable point size by default on windows. + glEnable(GL_VERTEX_PROGRAM_POINT_SIZE); + return true; }