From 33c4f891a08042999f0e4ec1b5ce0001477a82e5 Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Tue, 17 Dec 2013 18:41:09 -0800 Subject: [PATCH 1/4] Adds 'CC' to renderer files --- .../project.pbxproj.REMOVED.git-id | 2 +- cocos/2d/CCDirector.cpp | 4 +-- cocos/2d/CCLayer.cpp | 4 +-- cocos/2d/CCParticleBatchNode.cpp | 4 +-- cocos/2d/CCParticleSystemQuad.cpp | 7 ++-- cocos/2d/CCProgressTimer.cpp | 4 +-- cocos/2d/CCSprite.cpp | 4 +-- cocos/2d/cocos2d.h | 20 +++++------ ...{CustomCommand.cpp => CCCustomCommand.cpp} | 2 +- .../{CustomCommand.h => CCCustomCommand.h} | 4 +-- .../renderer/{Frustum.cpp => CCFrustum.cpp} | 2 +- cocos/2d/renderer/{Frustum.h => CCFrustum.h} | 0 .../{GroupCommand.cpp => CCGroupCommand.cpp} | 4 +-- .../{GroupCommand.h => CCGroupCommand.h} | 4 +-- ...erialManager.cpp => CCMaterialManager.cpp} | 2 +- ...{MaterialManager.h => CCMaterialManager.h} | 0 ...ClippingNode.cpp => CCNewClippingNode.cpp} | 8 ++--- ...{NewClippingNode.h => CCNewClippingNode.h} | 0 cocos/2d/renderer/CCNewDrawNode.cpp | 6 ++-- cocos/2d/renderer/CCNewLabelAtlas.cpp | 8 ++--- cocos/2d/renderer/CCNewLabelAtlas.h | 2 +- cocos/2d/renderer/CCNewRenderTexture.cpp | 6 ++-- cocos/2d/renderer/CCNewSprite.cpp | 6 ++-- cocos/2d/renderer/CCNewSpriteBatchNode.cpp | 4 +-- cocos/2d/renderer/CCNewTextureAtlas.cpp | 4 +-- .../{QuadCommand.cpp => CCQuadCommand.cpp} | 2 +- .../{QuadCommand.h => CCQuadCommand.h} | 4 +-- ...{RenderCommand.cpp => CCRenderCommand.cpp} | 2 +- .../{RenderCommand.h => CCRenderCommand.h} | 0 ...derCommandPool.h => CCRenderCommandPool.h} | 36 +++++++++++++------ ...enderMaterial.cpp => CCRenderMaterial.cpp} | 2 +- .../{RenderMaterial.h => CCRenderMaterial.h} | 0 .../renderer/{Renderer.cpp => CCRenderer.cpp} | 8 ++--- .../2d/renderer/{Renderer.h => CCRenderer.h} | 2 +- .../editor-support/cocostudio/CCArmature.cpp | 6 ++-- .../editor-support/cocostudio/CCBatchNode.cpp | 4 +-- .../NewRendererTest/NewRendererTest.cpp | 30 ++++++++++++---- 37 files changed, 119 insertions(+), 88 deletions(-) rename cocos/2d/renderer/{CustomCommand.cpp => CCCustomCommand.cpp} (98%) rename cocos/2d/renderer/{CustomCommand.h => CCCustomCommand.h} (97%) rename cocos/2d/renderer/{Frustum.cpp => CCFrustum.cpp} (99%) rename cocos/2d/renderer/{Frustum.h => CCFrustum.h} (100%) rename cocos/2d/renderer/{GroupCommand.cpp => CCGroupCommand.cpp} (98%) rename cocos/2d/renderer/{GroupCommand.h => CCGroupCommand.h} (97%) rename cocos/2d/renderer/{MaterialManager.cpp => CCMaterialManager.cpp} (98%) rename cocos/2d/renderer/{MaterialManager.h => CCMaterialManager.h} (100%) rename cocos/2d/renderer/{NewClippingNode.cpp => CCNewClippingNode.cpp} (98%) rename cocos/2d/renderer/{NewClippingNode.h => CCNewClippingNode.h} (100%) rename cocos/2d/renderer/{QuadCommand.cpp => CCQuadCommand.cpp} (99%) rename cocos/2d/renderer/{QuadCommand.h => CCQuadCommand.h} (98%) rename cocos/2d/renderer/{RenderCommand.cpp => CCRenderCommand.cpp} (97%) rename cocos/2d/renderer/{RenderCommand.h => CCRenderCommand.h} (100%) rename cocos/2d/renderer/{RenderCommandPool.h => CCRenderCommandPool.h} (57%) rename cocos/2d/renderer/{RenderMaterial.cpp => CCRenderMaterial.cpp} (97%) rename cocos/2d/renderer/{RenderMaterial.h => CCRenderMaterial.h} (100%) rename cocos/2d/renderer/{Renderer.cpp => CCRenderer.cpp} (99%) rename cocos/2d/renderer/{Renderer.h => CCRenderer.h} (98%) diff --git a/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id b/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id index 1213d3d12a..b16f4b5a9a 100644 --- a/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -354adeaebe4016c9e4ff3407a37181ec33758416 \ No newline at end of file +4691fe42345db3f1c43fc39d5517fd5115fe0520 \ No newline at end of file diff --git a/cocos/2d/CCDirector.cpp b/cocos/2d/CCDirector.cpp index f6dbf8be87..5174ae4df1 100644 --- a/cocos/2d/CCDirector.cpp +++ b/cocos/2d/CCDirector.cpp @@ -61,8 +61,8 @@ THE SOFTWARE. #include "CCConfiguration.h" #include "CCEventDispatcher.h" #include "CCFontFreeType.h" -#include "Renderer.h" -#include "renderer/Frustum.h" +#include "CCRenderer.h" +#include "renderer/CCFrustum.h" /** Position of the FPS diff --git a/cocos/2d/CCLayer.cpp b/cocos/2d/CCLayer.cpp index 20e49ecc1b..09c6f12e25 100644 --- a/cocos/2d/CCLayer.cpp +++ b/cocos/2d/CCLayer.cpp @@ -43,8 +43,8 @@ THE SOFTWARE. #include "CCEventListenerAcceleration.h" #include "platform/CCDevice.h" #include "CCScene.h" -#include "CustomCommand.h" -#include "Renderer.h" +#include "CCCustomCommand.h" +#include "CCRenderer.h" NS_CC_BEGIN diff --git a/cocos/2d/CCParticleBatchNode.cpp b/cocos/2d/CCParticleBatchNode.cpp index 0448a940b1..028fc7f3f6 100644 --- a/cocos/2d/CCParticleBatchNode.cpp +++ b/cocos/2d/CCParticleBatchNode.cpp @@ -42,8 +42,8 @@ #include "platform/CCFileUtils.h" #include "kazmath/GL/matrix.h" #include "CCProfiling.h" -#include "QuadCommand.h" -#include "Renderer.h" +#include "CCQuadCommand.h" +#include "CCRenderer.h" NS_CC_BEGIN diff --git a/cocos/2d/CCParticleSystemQuad.cpp b/cocos/2d/CCParticleSystemQuad.cpp index a6965c3ebd..b7e901c85b 100644 --- a/cocos/2d/CCParticleSystemQuad.cpp +++ b/cocos/2d/CCParticleSystemQuad.cpp @@ -38,13 +38,12 @@ THE SOFTWARE. #include "CCNotificationCenter.h" #include "CCEventType.h" #include "CCConfiguration.h" -#include "CustomCommand.h" +#include "CCRenderer.h" +#include "CCQuadCommand.h" +#include "CCCustomCommand.h" // extern #include "kazmath/GL/matrix.h" -#include "Renderer.h" -#include "QuadCommand.h" -#include "CustomCommand.h" NS_CC_BEGIN diff --git a/cocos/2d/CCProgressTimer.cpp b/cocos/2d/CCProgressTimer.cpp index 75bd34b4e1..020252c5eb 100644 --- a/cocos/2d/CCProgressTimer.cpp +++ b/cocos/2d/CCProgressTimer.cpp @@ -32,8 +32,8 @@ THE SOFTWARE. #include "CCDirector.h" #include "TransformUtils.h" #include "CCDrawingPrimitives.h" -#include "Renderer.h" -#include "CustomCommand.h" +#include "CCRenderer.h" +#include "CCCustomCommand.h" // extern #include "kazmath/GL/matrix.h" diff --git a/cocos/2d/CCSprite.cpp b/cocos/2d/CCSprite.cpp index 01cf81a4cc..b48191ebf3 100644 --- a/cocos/2d/CCSprite.cpp +++ b/cocos/2d/CCSprite.cpp @@ -44,8 +44,8 @@ THE SOFTWARE. #include "CCAffineTransform.h" #include "TransformUtils.h" #include "CCProfiling.h" -#include "Renderer.h" -#include "QuadCommand.h" +#include "CCRenderer.h" +#include "CCQuadCommand.h" // external #include "kazmath/GL/matrix.h" diff --git a/cocos/2d/cocos2d.h b/cocos/2d/cocos2d.h index bf23ce6271..f1f47553dd 100644 --- a/cocos/2d/cocos2d.h +++ b/cocos/2d/cocos2d.h @@ -126,16 +126,16 @@ THE SOFTWARE. #include "renderer/CCNewSprite.h" #include "renderer/CCNewSpriteBatchNode.h" #include "renderer/CCNewTextureAtlas.h" -#include "renderer/CustomCommand.h" -#include "renderer/Frustum.h" -#include "renderer/GroupCommand.h" -#include "renderer/MaterialManager.h" -#include "renderer/NewClippingNode.h" -#include "renderer/QuadCommand.h" -#include "renderer/RenderCommand.h" -#include "renderer/RenderCommandPool.h" -#include "renderer/RenderMaterial.h" -#include "renderer/Renderer.h" +#include "renderer/CCCustomCommand.h" +#include "renderer/CCFrustum.h" +#include "renderer/CCGroupCommand.h" +#include "renderer/CCMaterialManager.h" +#include "renderer/CCNewClippingNode.h" +#include "renderer/CCQuadCommand.h" +#include "renderer/CCRenderCommand.h" +#include "renderer/CCRenderCommandPool.h" +#include "renderer/CCRenderMaterial.h" +#include "renderer/CCRenderer.h" // physics #include "CCPhysicsBody.h" diff --git a/cocos/2d/renderer/CustomCommand.cpp b/cocos/2d/renderer/CCCustomCommand.cpp similarity index 98% rename from cocos/2d/renderer/CustomCommand.cpp rename to cocos/2d/renderer/CCCustomCommand.cpp index 566ecae299..49e7a0a06c 100644 --- a/cocos/2d/renderer/CustomCommand.cpp +++ b/cocos/2d/renderer/CCCustomCommand.cpp @@ -22,7 +22,7 @@ THE SOFTWARE. ****************************************************************************/ -#include "CustomCommand.h" +#include "CCCustomCommand.h" NS_CC_BEGIN RenderCommandPool CustomCommand::_commandPool; diff --git a/cocos/2d/renderer/CustomCommand.h b/cocos/2d/renderer/CCCustomCommand.h similarity index 97% rename from cocos/2d/renderer/CustomCommand.h rename to cocos/2d/renderer/CCCustomCommand.h index 4cb7ed9502..6b5744bc75 100644 --- a/cocos/2d/renderer/CustomCommand.h +++ b/cocos/2d/renderer/CCCustomCommand.h @@ -26,8 +26,8 @@ #ifndef _CC_CUSTOMCOMMAND_H_ #define _CC_CUSTOMCOMMAND_H_ -#include "RenderCommand.h" -#include "RenderCommandPool.h" +#include "CCRenderCommand.h" +#include "CCRenderCommandPool.h" NS_CC_BEGIN diff --git a/cocos/2d/renderer/Frustum.cpp b/cocos/2d/renderer/CCFrustum.cpp similarity index 99% rename from cocos/2d/renderer/Frustum.cpp rename to cocos/2d/renderer/CCFrustum.cpp index 74410c07e8..d23780612c 100644 --- a/cocos/2d/renderer/Frustum.cpp +++ b/cocos/2d/renderer/CCFrustum.cpp @@ -22,7 +22,7 @@ THE SOFTWARE. ****************************************************************************/ -#include "Frustum.h" +#include "CCFrustum.h" #include "platform/CCCommon.h" #include diff --git a/cocos/2d/renderer/Frustum.h b/cocos/2d/renderer/CCFrustum.h similarity index 100% rename from cocos/2d/renderer/Frustum.h rename to cocos/2d/renderer/CCFrustum.h diff --git a/cocos/2d/renderer/GroupCommand.cpp b/cocos/2d/renderer/CCGroupCommand.cpp similarity index 98% rename from cocos/2d/renderer/GroupCommand.cpp rename to cocos/2d/renderer/CCGroupCommand.cpp index c8e3537688..f9dac2f01e 100644 --- a/cocos/2d/renderer/GroupCommand.cpp +++ b/cocos/2d/renderer/CCGroupCommand.cpp @@ -23,8 +23,8 @@ ****************************************************************************/ -#include "GroupCommand.h" -#include "Renderer.h" +#include "CCGroupCommand.h" +#include "CCRenderer.h" #include "CCDirector.h" NS_CC_BEGIN diff --git a/cocos/2d/renderer/GroupCommand.h b/cocos/2d/renderer/CCGroupCommand.h similarity index 97% rename from cocos/2d/renderer/GroupCommand.h rename to cocos/2d/renderer/CCGroupCommand.h index b23a24bca5..683fa8d58a 100644 --- a/cocos/2d/renderer/GroupCommand.h +++ b/cocos/2d/renderer/CCGroupCommand.h @@ -27,8 +27,8 @@ #define _CC_GROUPCOMMAND_H_ #include "CCPlatformMacros.h" -#include "RenderCommand.h" -#include "RenderCommandPool.h" +#include "CCRenderCommand.h" +#include "CCRenderCommandPool.h" #include NS_CC_BEGIN diff --git a/cocos/2d/renderer/MaterialManager.cpp b/cocos/2d/renderer/CCMaterialManager.cpp similarity index 98% rename from cocos/2d/renderer/MaterialManager.cpp rename to cocos/2d/renderer/CCMaterialManager.cpp index b96555d9ed..9f4e7c898c 100644 --- a/cocos/2d/renderer/MaterialManager.cpp +++ b/cocos/2d/renderer/CCMaterialManager.cpp @@ -23,7 +23,7 @@ ****************************************************************************/ -#include "MaterialManager.h" +#include "CCMaterialManager.h" NS_CC_BEGIN diff --git a/cocos/2d/renderer/MaterialManager.h b/cocos/2d/renderer/CCMaterialManager.h similarity index 100% rename from cocos/2d/renderer/MaterialManager.h rename to cocos/2d/renderer/CCMaterialManager.h diff --git a/cocos/2d/renderer/NewClippingNode.cpp b/cocos/2d/renderer/CCNewClippingNode.cpp similarity index 98% rename from cocos/2d/renderer/NewClippingNode.cpp rename to cocos/2d/renderer/CCNewClippingNode.cpp index 65efe2001e..399636212d 100644 --- a/cocos/2d/renderer/NewClippingNode.cpp +++ b/cocos/2d/renderer/CCNewClippingNode.cpp @@ -22,10 +22,10 @@ THE SOFTWARE. ****************************************************************************/ -#include "NewClippingNode.h" -#include "GroupCommand.h" -#include "Renderer.h" -#include "CustomCommand.h" +#include "CCNewClippingNode.h" +#include "CCGroupCommand.h" +#include "CCRenderer.h" +#include "CCCustomCommand.h" #include "CCShaderCache.h" #include "CCDirector.h" diff --git a/cocos/2d/renderer/NewClippingNode.h b/cocos/2d/renderer/CCNewClippingNode.h similarity index 100% rename from cocos/2d/renderer/NewClippingNode.h rename to cocos/2d/renderer/CCNewClippingNode.h diff --git a/cocos/2d/renderer/CCNewDrawNode.cpp b/cocos/2d/renderer/CCNewDrawNode.cpp index fc41399bf3..7b1cf8b33a 100644 --- a/cocos/2d/renderer/CCNewDrawNode.cpp +++ b/cocos/2d/renderer/CCNewDrawNode.cpp @@ -23,9 +23,9 @@ ****************************************************************************/ #include "CCNewDrawNode.h" -#include "QuadCommand.h" -#include "Renderer.h" -#include "CustomCommand.h" +#include "CCQuadCommand.h" +#include "CCRenderer.h" +#include "CCCustomCommand.h" #include "CCDirector.h" NS_CC_BEGIN diff --git a/cocos/2d/renderer/CCNewLabelAtlas.cpp b/cocos/2d/renderer/CCNewLabelAtlas.cpp index b9718d923e..5200528c8d 100644 --- a/cocos/2d/renderer/CCNewLabelAtlas.cpp +++ b/cocos/2d/renderer/CCNewLabelAtlas.cpp @@ -24,11 +24,11 @@ #include "CCNewLabelAtlas.h" -#include "RenderCommand.h" -#include "Renderer.h" -#include "QuadCommand.h" +#include "CCRenderCommand.h" +#include "CCRenderer.h" +#include "CCQuadCommand.h" #include "CCMenuItem.h" -#include "Frustum.h" +#include "CCFrustum.h" #include "CCDirector.h" #include "CCTextureAtlas.h" #include "CCShaderCache.h" diff --git a/cocos/2d/renderer/CCNewLabelAtlas.h b/cocos/2d/renderer/CCNewLabelAtlas.h index 7bb9cc1dca..9440a22ad6 100644 --- a/cocos/2d/renderer/CCNewLabelAtlas.h +++ b/cocos/2d/renderer/CCNewLabelAtlas.h @@ -28,7 +28,7 @@ #include "CCLabelAtlas.h" #include "CCPlatformMacros.h" -#include "QuadCommand.h" +#include "CCQuadCommand.h" NS_CC_BEGIN diff --git a/cocos/2d/renderer/CCNewRenderTexture.cpp b/cocos/2d/renderer/CCNewRenderTexture.cpp index c501182d78..a837c4c9b6 100644 --- a/cocos/2d/renderer/CCNewRenderTexture.cpp +++ b/cocos/2d/renderer/CCNewRenderTexture.cpp @@ -24,9 +24,9 @@ #include "CCNewRenderTexture.h" -#include "CustomCommand.h" -#include "Renderer.h" -#include "GroupCommand.h" +#include "CCCustomCommand.h" +#include "CCRenderer.h" +#include "CCGroupCommand.h" #include "CCConfiguration.h" #include "CCDirector.h" diff --git a/cocos/2d/renderer/CCNewSprite.cpp b/cocos/2d/renderer/CCNewSprite.cpp index c6f44c943a..330c2afe68 100644 --- a/cocos/2d/renderer/CCNewSprite.cpp +++ b/cocos/2d/renderer/CCNewSprite.cpp @@ -23,10 +23,10 @@ ****************************************************************************/ #include "CCNewSprite.h" -#include "Renderer.h" -#include "Frustum.h" +#include "CCRenderer.h" +#include "CCFrustum.h" #include "CCDirector.h" -#include "QuadCommand.h" +#include "CCQuadCommand.h" NS_CC_BEGIN diff --git a/cocos/2d/renderer/CCNewSpriteBatchNode.cpp b/cocos/2d/renderer/CCNewSpriteBatchNode.cpp index 105bfeaf0c..07aa234fce 100644 --- a/cocos/2d/renderer/CCNewSpriteBatchNode.cpp +++ b/cocos/2d/renderer/CCNewSpriteBatchNode.cpp @@ -28,8 +28,8 @@ #include "CCTextureCache.h" #include "CCSprite.h" #include "CCNewSprite.h" -#include "QuadCommand.h" -#include "Renderer.h" +#include "CCQuadCommand.h" +#include "CCRenderer.h" NS_CC_BEGIN diff --git a/cocos/2d/renderer/CCNewTextureAtlas.cpp b/cocos/2d/renderer/CCNewTextureAtlas.cpp index d10557d5c7..23ddff20dc 100644 --- a/cocos/2d/renderer/CCNewTextureAtlas.cpp +++ b/cocos/2d/renderer/CCNewTextureAtlas.cpp @@ -25,8 +25,8 @@ #include "CCNewTextureAtlas.h" #include "CCTexture2D.h" #include "CCDirector.h" -#include "Renderer.h" -#include "QuadCommand.h" +#include "CCRenderer.h" +#include "CCQuadCommand.h" NS_CC_BEGIN diff --git a/cocos/2d/renderer/QuadCommand.cpp b/cocos/2d/renderer/CCQuadCommand.cpp similarity index 99% rename from cocos/2d/renderer/QuadCommand.cpp rename to cocos/2d/renderer/CCQuadCommand.cpp index 0a88acaaf2..89b5630db9 100644 --- a/cocos/2d/renderer/QuadCommand.cpp +++ b/cocos/2d/renderer/CCQuadCommand.cpp @@ -23,7 +23,7 @@ ****************************************************************************/ -#include "QuadCommand.h" +#include "CCQuadCommand.h" #include "ccGLStateCache.h" NS_CC_BEGIN diff --git a/cocos/2d/renderer/QuadCommand.h b/cocos/2d/renderer/CCQuadCommand.h similarity index 98% rename from cocos/2d/renderer/QuadCommand.h rename to cocos/2d/renderer/CCQuadCommand.h index 1b7825f281..14a5531fac 100644 --- a/cocos/2d/renderer/QuadCommand.h +++ b/cocos/2d/renderer/CCQuadCommand.h @@ -25,9 +25,9 @@ #ifndef _CC_QUADCOMMAND_H_ #define _CC_QUADCOMMAND_H_ -#include "RenderCommand.h" +#include "CCRenderCommand.h" #include "CCGLProgram.h" -#include "RenderCommandPool.h" +#include "CCRenderCommandPool.h" #include "kazmath/kazmath.h" NS_CC_BEGIN diff --git a/cocos/2d/renderer/RenderCommand.cpp b/cocos/2d/renderer/CCRenderCommand.cpp similarity index 97% rename from cocos/2d/renderer/RenderCommand.cpp rename to cocos/2d/renderer/CCRenderCommand.cpp index f353277800..3184d9c042 100644 --- a/cocos/2d/renderer/RenderCommand.cpp +++ b/cocos/2d/renderer/CCRenderCommand.cpp @@ -23,7 +23,7 @@ ****************************************************************************/ -#include "RenderCommand.h" +#include "CCRenderCommand.h" NS_CC_BEGIN diff --git a/cocos/2d/renderer/RenderCommand.h b/cocos/2d/renderer/CCRenderCommand.h similarity index 100% rename from cocos/2d/renderer/RenderCommand.h rename to cocos/2d/renderer/CCRenderCommand.h diff --git a/cocos/2d/renderer/RenderCommandPool.h b/cocos/2d/renderer/CCRenderCommandPool.h similarity index 57% rename from cocos/2d/renderer/RenderCommandPool.h rename to cocos/2d/renderer/CCRenderCommandPool.h index 17e4716a38..0f7f721f46 100644 --- a/cocos/2d/renderer/RenderCommandPool.h +++ b/cocos/2d/renderer/CCRenderCommandPool.h @@ -1,10 +1,27 @@ -// -// RenderCommandPool.h -// cocos2d_libs -// -// Created by Huabing on 11/28/13. -// -// +/**************************************************************************** + Copyright (c) 2013 cocos2d-x.org + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + #ifndef __CC_RENDERCOMMANDPOOL_H__ #define __CC_RENDERCOMMANDPOOL_H__ @@ -35,8 +52,7 @@ public: } _allocatedPoolBlocks.clear(); } - -public: + T* generateCommand() { T* result = nullptr; @@ -73,7 +89,7 @@ private: _freePool.push_back(commands+index); } } -private: + std::list _allocatedPoolBlocks; std::list _freePool; //std::set _usedPool; diff --git a/cocos/2d/renderer/RenderMaterial.cpp b/cocos/2d/renderer/CCRenderMaterial.cpp similarity index 97% rename from cocos/2d/renderer/RenderMaterial.cpp rename to cocos/2d/renderer/CCRenderMaterial.cpp index 8ea9576357..da32ca0357 100644 --- a/cocos/2d/renderer/RenderMaterial.cpp +++ b/cocos/2d/renderer/CCRenderMaterial.cpp @@ -23,4 +23,4 @@ ****************************************************************************/ -#include "RenderMaterial.h" +#include "CCRenderMaterial.h" diff --git a/cocos/2d/renderer/RenderMaterial.h b/cocos/2d/renderer/CCRenderMaterial.h similarity index 100% rename from cocos/2d/renderer/RenderMaterial.h rename to cocos/2d/renderer/CCRenderMaterial.h diff --git a/cocos/2d/renderer/Renderer.cpp b/cocos/2d/renderer/CCRenderer.cpp similarity index 99% rename from cocos/2d/renderer/Renderer.cpp rename to cocos/2d/renderer/CCRenderer.cpp index ea4db2cd6d..cdf63eee9a 100644 --- a/cocos/2d/renderer/Renderer.cpp +++ b/cocos/2d/renderer/CCRenderer.cpp @@ -22,12 +22,12 @@ THE SOFTWARE. ****************************************************************************/ -#include "Renderer.h" +#include "CCRenderer.h" #include "CCShaderCache.h" #include "ccGLStateCache.h" -#include "CustomCommand.h" -#include "QuadCommand.h" -#include "GroupCommand.h" +#include "CCCustomCommand.h" +#include "CCQuadCommand.h" +#include "CCGroupCommand.h" #include "CCConfiguration.h" #include "CCNotificationCenter.h" #include "CCEventType.h" diff --git a/cocos/2d/renderer/Renderer.h b/cocos/2d/renderer/CCRenderer.h similarity index 98% rename from cocos/2d/renderer/Renderer.h rename to cocos/2d/renderer/CCRenderer.h index b1c2a2609b..8091063e6e 100644 --- a/cocos/2d/renderer/Renderer.h +++ b/cocos/2d/renderer/CCRenderer.h @@ -27,7 +27,7 @@ #define __CC_RENDERER_H_ #include "CCPlatformMacros.h" -#include "RenderCommand.h" +#include "CCRenderCommand.h" #include "CCGLProgram.h" #include "CCGL.h" #include diff --git a/cocos/editor-support/cocostudio/CCArmature.cpp b/cocos/editor-support/cocostudio/CCArmature.cpp index b89d6d5740..cd2632560a 100644 --- a/cocos/editor-support/cocostudio/CCArmature.cpp +++ b/cocos/editor-support/cocostudio/CCArmature.cpp @@ -28,9 +28,9 @@ THE SOFTWARE. #include "cocostudio/CCDataReaderHelper.h" #include "cocostudio/CCDatas.h" #include "cocostudio/CCSkin.h" -#include "QuadCommand.h" -#include "Renderer.h" -#include "GroupCommand.h" +#include "CCQuadCommand.h" +#include "CCRenderer.h" +#include "CCGroupCommand.h" #if ENABLE_PHYSICS_BOX2D_DETECT #include "Box2D/Box2D.h" diff --git a/cocos/editor-support/cocostudio/CCBatchNode.cpp b/cocos/editor-support/cocostudio/CCBatchNode.cpp index 4667bcd9ac..8e605bfd1c 100644 --- a/cocos/editor-support/cocostudio/CCBatchNode.cpp +++ b/cocos/editor-support/cocostudio/CCBatchNode.cpp @@ -26,8 +26,8 @@ THE SOFTWARE. #include "cocostudio/CCArmatureDefine.h" #include "cocostudio/CCArmature.h" #include "cocostudio/CCSkin.h" -#include "Renderer.h" -#include "GroupCommand.h" +#include "CCRenderer.h" +#include "CCGroupCommand.h" using namespace cocos2d; diff --git a/samples/Cpp/TestCpp/Classes/NewRendererTest/NewRendererTest.cpp b/samples/Cpp/TestCpp/Classes/NewRendererTest/NewRendererTest.cpp index 71d30eb0e7..b896c5d624 100644 --- a/samples/Cpp/TestCpp/Classes/NewRendererTest/NewRendererTest.cpp +++ b/samples/Cpp/TestCpp/Classes/NewRendererTest/NewRendererTest.cpp @@ -1,13 +1,29 @@ -// -// Created by NiTe Luo on 11/1/13. -// +/**************************************************************************** + Copyright (c) 2013 cocos2d-x.org + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ #include "NewRendererTest.h" -#include "renderer/CCNewSprite.h" -#include "renderer/CCNewSpriteBatchNode.h" -#include "renderer/NewClippingNode.h" -#include "renderer/CCNewDrawNode.h" static int sceneIdx = -1; From 5c9b8db0cb4b3fa043dccd4e3b730bdecbaaab9b Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Tue, 17 Dec 2013 18:47:46 -0800 Subject: [PATCH 2/4] Updates project files file Linux and Android --- cocos/2d/Android.mk | 18 +++++++++--------- cocos/2d/CMakeLists.txt | 18 +++++++++--------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/cocos/2d/Android.mk b/cocos/2d/Android.mk index 4f37b1d413..ca720b6251 100644 --- a/cocos/2d/Android.mk +++ b/cocos/2d/Android.mk @@ -124,15 +124,15 @@ renderer/CCNewRenderTexture.cpp \ renderer/CCNewSprite.cpp \ renderer/CCNewSpriteBatchNode.cpp \ renderer/CCNewTextureAtlas.cpp \ -renderer/CustomCommand.cpp \ -renderer/Frustum.cpp \ -renderer/GroupCommand.cpp \ -renderer/MaterialManager.cpp \ -renderer/NewClippingNode.cpp \ -renderer/QuadCommand.cpp \ -renderer/RenderCommand.cpp \ -renderer/Renderer.cpp \ -renderer/RenderMaterial.cpp \ +renderer/CCCustomCommand.cpp \ +renderer/CCFrustum.cpp \ +renderer/CCGroupCommand.cpp \ +renderer/CCMaterialManager.cpp \ +renderer/CCNewClippingNode.cpp \ +renderer/CCQuadCommand.cpp \ +renderer/CCRenderCommand.cpp \ +renderer/CCRenderer.cpp \ +renderer/CCRenderMaterial.cpp \ ../base/atitc.cpp \ ../base/CCAffineTransform.cpp \ ../base/CCArray.cpp \ diff --git a/cocos/2d/CMakeLists.txt b/cocos/2d/CMakeLists.txt index 36d37f0113..e3e07c803d 100644 --- a/cocos/2d/CMakeLists.txt +++ b/cocos/2d/CMakeLists.txt @@ -146,15 +146,15 @@ set(COCOS2D_SRC renderer/CCNewSprite.cpp renderer/CCNewSpriteBatchNode.cpp renderer/CCNewTextureAtlas.cpp - renderer/CustomCommand.cpp - renderer/Frustum.cpp - renderer/GroupCommand.cpp - renderer/MaterialManager.cpp - renderer/NewClippingNode.cpp - renderer/QuadCommand.cpp - renderer/RenderCommand.cpp - renderer/Renderer.cpp - renderer/RenderMaterial.cpp + renderer/CCCustomCommand.cpp + renderer/CCFrustum.cpp + renderer/CCGroupCommand.cpp + renderer/CCMaterialManager.cpp + renderer/CCNewClippingNode.cpp + renderer/CCQuadCommand.cpp + renderer/CCRenderCommand.cpp + renderer/CCRenderer.cpp + renderer/CCRenderMaterial.cpp ) include(../physics/CMakeLists.txt) From 156f69c528b5f4eb1bc67b60750e13bc6428dd04 Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Tue, 17 Dec 2013 19:06:22 -0800 Subject: [PATCH 3/4] Renderer is subclass of Object again... needed for Android. ouch --- cocos/2d/platform/android/java/project.properties | 2 +- cocos/2d/renderer/CCRenderer.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cocos/2d/platform/android/java/project.properties b/cocos/2d/platform/android/java/project.properties index 88ca83f9d0..4a46b9d1c9 100644 --- a/cocos/2d/platform/android/java/project.properties +++ b/cocos/2d/platform/android/java/project.properties @@ -12,4 +12,4 @@ android.library=true # Project target. -target=android-10 +target=android-17 diff --git a/cocos/2d/renderer/CCRenderer.h b/cocos/2d/renderer/CCRenderer.h index 8091063e6e..87fc85fdea 100644 --- a/cocos/2d/renderer/CCRenderer.h +++ b/cocos/2d/renderer/CCRenderer.h @@ -43,7 +43,7 @@ struct RenderStackElement size_t currentIndex; }; -class Renderer +class Renderer : public Object { public: static const int vbo_size = 65536 / 6; From 24f89ac45c37188d54e164398c7985a232985602 Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Tue, 17 Dec 2013 19:07:28 -0800 Subject: [PATCH 4/4] Revert... android platform is 10 --- cocos/2d/platform/android/java/project.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/2d/platform/android/java/project.properties b/cocos/2d/platform/android/java/project.properties index 4a46b9d1c9..88ca83f9d0 100644 --- a/cocos/2d/platform/android/java/project.properties +++ b/cocos/2d/platform/android/java/project.properties @@ -12,4 +12,4 @@ android.library=true # Project target. -target=android-17 +target=android-10