Merge pull request #4525 from ricardoquesada/renderer_files_with_cc

Renderer files with cc
This commit is contained in:
Ricardo Quesada 2013-12-17 19:17:50 -08:00
commit ad66f7ac41
39 changed files with 138 additions and 107 deletions

View File

@ -1 +1 @@
354adeaebe4016c9e4ff3407a37181ec33758416
4691fe42345db3f1c43fc39d5517fd5115fe0520

View File

@ -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 \

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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"

View File

@ -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"

View File

@ -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)

View File

@ -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"

View File

@ -22,7 +22,7 @@
THE SOFTWARE.
****************************************************************************/
#include "CustomCommand.h"
#include "CCCustomCommand.h"
NS_CC_BEGIN
RenderCommandPool<CustomCommand> CustomCommand::_commandPool;

View File

@ -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

View File

@ -22,7 +22,7 @@
THE SOFTWARE.
****************************************************************************/
#include "Frustum.h"
#include "CCFrustum.h"
#include "platform/CCCommon.h"
#include <stdlib.h>

View File

@ -23,8 +23,8 @@
****************************************************************************/
#include "GroupCommand.h"
#include "Renderer.h"
#include "CCGroupCommand.h"
#include "CCRenderer.h"
#include "CCDirector.h"
NS_CC_BEGIN

View File

@ -27,8 +27,8 @@
#define _CC_GROUPCOMMAND_H_
#include "CCPlatformMacros.h"
#include "RenderCommand.h"
#include "RenderCommandPool.h"
#include "CCRenderCommand.h"
#include "CCRenderCommandPool.h"
#include <unordered_map>
NS_CC_BEGIN

View File

@ -23,7 +23,7 @@
****************************************************************************/
#include "MaterialManager.h"
#include "CCMaterialManager.h"
NS_CC_BEGIN

View File

@ -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"

View File

@ -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

View File

@ -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"

View File

@ -28,7 +28,7 @@
#include "CCLabelAtlas.h"
#include "CCPlatformMacros.h"
#include "QuadCommand.h"
#include "CCQuadCommand.h"
NS_CC_BEGIN

View File

@ -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"

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -23,7 +23,7 @@
****************************************************************************/
#include "QuadCommand.h"
#include "CCQuadCommand.h"
#include "ccGLStateCache.h"
NS_CC_BEGIN

View File

@ -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

View File

@ -23,7 +23,7 @@
****************************************************************************/
#include "RenderCommand.h"
#include "CCRenderCommand.h"
NS_CC_BEGIN

View File

@ -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<T*> _allocatedPoolBlocks;
std::list<T*> _freePool;
//std::set<T*> _usedPool;

View File

@ -23,4 +23,4 @@
****************************************************************************/
#include "RenderMaterial.h"
#include "CCRenderMaterial.h"

View File

@ -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"

View File

@ -27,7 +27,7 @@
#define __CC_RENDERER_H_
#include "CCPlatformMacros.h"
#include "RenderCommand.h"
#include "CCRenderCommand.h"
#include "CCGLProgram.h"
#include "CCGL.h"
#include <vector>
@ -43,7 +43,7 @@ struct RenderStackElement
size_t currentIndex;
};
class Renderer
class Renderer : public Object
{
public:
static const int vbo_size = 65536 / 6;

View File

@ -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"

View File

@ -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;

View File

@ -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;