mirror of https://github.com/axmolengine/axmol.git
change QuadCommand variable to class member.
This commit is contained in:
parent
9bd609a8fb
commit
2fb0179293
|
@ -34,7 +34,7 @@ THE SOFTWARE.
|
||||||
#include "CCDirector.h"
|
#include "CCDirector.h"
|
||||||
#include "TransformUtils.h"
|
#include "TransformUtils.h"
|
||||||
#include "CCRenderer.h"
|
#include "CCRenderer.h"
|
||||||
#include "CCQuadCommand.h"
|
#include "renderer/CCQuadCommand.h"
|
||||||
|
|
||||||
// external
|
// external
|
||||||
#include "kazmath/GL/matrix.h"
|
#include "kazmath/GL/matrix.h"
|
||||||
|
@ -151,8 +151,7 @@ void AtlasNode::draw(void)
|
||||||
|
|
||||||
auto shader = ShaderCache::getInstance()->getProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR_NO_MVP);
|
auto shader = ShaderCache::getInstance()->getProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR_NO_MVP);
|
||||||
|
|
||||||
QuadCommand* cmd = new QuadCommand();
|
_quadCommand.init(0,
|
||||||
cmd->init(0,
|
|
||||||
_vertexZ,
|
_vertexZ,
|
||||||
_textureAtlas->getTexture()->getName(),
|
_textureAtlas->getTexture()->getName(),
|
||||||
shader,
|
shader,
|
||||||
|
@ -161,7 +160,7 @@ void AtlasNode::draw(void)
|
||||||
_textureAtlas->getTotalQuads(),
|
_textureAtlas->getTotalQuads(),
|
||||||
_modelViewTransform);
|
_modelViewTransform);
|
||||||
|
|
||||||
Director::getInstance()->getRenderer()->addCommand(cmd);
|
Director::getInstance()->getRenderer()->addCommand(&_quadCommand);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,7 @@ THE SOFTWARE.
|
||||||
#include "CCNode.h"
|
#include "CCNode.h"
|
||||||
#include "CCProtocols.h"
|
#include "CCProtocols.h"
|
||||||
#include "ccTypes.h"
|
#include "ccTypes.h"
|
||||||
|
#include "renderer/CCQuadCommand.h"
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
|
@ -130,6 +131,8 @@ protected:
|
||||||
GLint _uniformColor;
|
GLint _uniformColor;
|
||||||
// This varible is only used for LabelAtlas FPS display. So plz don't modify its value.
|
// This varible is only used for LabelAtlas FPS display. So plz don't modify its value.
|
||||||
bool _ignoreContentScaleFactor;
|
bool _ignoreContentScaleFactor;
|
||||||
|
// quad command
|
||||||
|
QuadCommand _quadCommand;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CC_DISALLOW_COPY_AND_ASSIGN(AtlasNode);
|
CC_DISALLOW_COPY_AND_ASSIGN(AtlasNode);
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
#include "platform/CCFileUtils.h"
|
#include "platform/CCFileUtils.h"
|
||||||
#include "kazmath/GL/matrix.h"
|
#include "kazmath/GL/matrix.h"
|
||||||
#include "CCProfiling.h"
|
#include "CCProfiling.h"
|
||||||
#include "CCQuadCommand.h"
|
#include "renderer/CCQuadCommand.h"
|
||||||
#include "CCRenderer.h"
|
#include "CCRenderer.h"
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
@ -392,8 +392,7 @@ void ParticleBatchNode::draw(void)
|
||||||
kmMat4 mv;
|
kmMat4 mv;
|
||||||
kmGLGetMatrix(KM_GL_MODELVIEW, &mv);
|
kmGLGetMatrix(KM_GL_MODELVIEW, &mv);
|
||||||
|
|
||||||
QuadCommand* cmd = new QuadCommand();
|
_quadCommand.init(0,
|
||||||
cmd->init(0,
|
|
||||||
_vertexZ,
|
_vertexZ,
|
||||||
_textureAtlas->getTexture()->getName(),
|
_textureAtlas->getTexture()->getName(),
|
||||||
shader,
|
shader,
|
||||||
|
@ -401,7 +400,7 @@ void ParticleBatchNode::draw(void)
|
||||||
_textureAtlas->getQuads(),
|
_textureAtlas->getQuads(),
|
||||||
_textureAtlas->getTotalQuads(),
|
_textureAtlas->getTotalQuads(),
|
||||||
mv);
|
mv);
|
||||||
Director::getInstance()->getRenderer()->addCommand(cmd);
|
Director::getInstance()->getRenderer()->addCommand(&_quadCommand);
|
||||||
CC_PROFILER_STOP("CCParticleBatchNode - draw");
|
CC_PROFILER_STOP("CCParticleBatchNode - draw");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
|
|
||||||
#include "CCNode.h"
|
#include "CCNode.h"
|
||||||
#include "CCProtocols.h"
|
#include "CCProtocols.h"
|
||||||
|
#include "renderer/CCQuadCommand.h"
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
|
@ -140,6 +141,8 @@ private:
|
||||||
private:
|
private:
|
||||||
/** the blend function used for drawing the quads */
|
/** the blend function used for drawing the quads */
|
||||||
BlendFunc _blendFunc;
|
BlendFunc _blendFunc;
|
||||||
|
// quad command
|
||||||
|
QuadCommand _quadCommand;
|
||||||
};
|
};
|
||||||
|
|
||||||
// end of particle_nodes group
|
// end of particle_nodes group
|
||||||
|
|
|
@ -39,7 +39,7 @@ THE SOFTWARE.
|
||||||
#include "CCEventType.h"
|
#include "CCEventType.h"
|
||||||
#include "CCConfiguration.h"
|
#include "CCConfiguration.h"
|
||||||
#include "CCRenderer.h"
|
#include "CCRenderer.h"
|
||||||
#include "CCQuadCommand.h"
|
#include "renderer/CCQuadCommand.h"
|
||||||
#include "CCCustomCommand.h"
|
#include "CCCustomCommand.h"
|
||||||
|
|
||||||
// extern
|
// extern
|
||||||
|
@ -443,9 +443,8 @@ void ParticleSystemQuad::draw()
|
||||||
|
|
||||||
auto shader = ShaderCache::getInstance()->getProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR_NO_MVP);
|
auto shader = ShaderCache::getInstance()->getProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR_NO_MVP);
|
||||||
|
|
||||||
QuadCommand* cmd = new QuadCommand();
|
_quadCommand.init(0, _vertexZ, _texture->getName(), shader, _blendFunc, _quads, _particleIdx, _modelViewTransform);
|
||||||
cmd->init(0, _vertexZ, _texture->getName(), shader, _blendFunc, _quads, _particleIdx, _modelViewTransform);
|
Director::getInstance()->getRenderer()->addCommand(&_quadCommand);
|
||||||
Director::getInstance()->getRenderer()->addCommand(cmd);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,6 +28,7 @@ THE SOFTWARE.
|
||||||
#define __CC_PARTICLE_SYSTEM_QUAD_H__
|
#define __CC_PARTICLE_SYSTEM_QUAD_H__
|
||||||
|
|
||||||
#include "CCParticleSystem.h"
|
#include "CCParticleSystem.h"
|
||||||
|
#include "renderer/CCQuadCommand.h"
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
|
@ -151,6 +152,8 @@ protected:
|
||||||
GLuint _buffersVBO[2]; //0: vertex 1: indices
|
GLuint _buffersVBO[2]; //0: vertex 1: indices
|
||||||
|
|
||||||
kmMat4 _transformMatrix;
|
kmMat4 _transformMatrix;
|
||||||
|
|
||||||
|
QuadCommand _quadCommand; // quad command
|
||||||
private:
|
private:
|
||||||
CC_DISALLOW_COPY_AND_ASSIGN(ParticleSystemQuad);
|
CC_DISALLOW_COPY_AND_ASSIGN(ParticleSystemQuad);
|
||||||
};
|
};
|
||||||
|
|
|
@ -45,7 +45,7 @@ THE SOFTWARE.
|
||||||
#include "TransformUtils.h"
|
#include "TransformUtils.h"
|
||||||
#include "CCProfiling.h"
|
#include "CCProfiling.h"
|
||||||
#include "CCRenderer.h"
|
#include "CCRenderer.h"
|
||||||
#include "CCQuadCommand.h"
|
#include "renderer/CCQuadCommand.h"
|
||||||
#include "CCFrustum.h"
|
#include "CCFrustum.h"
|
||||||
|
|
||||||
// external
|
// external
|
||||||
|
@ -671,8 +671,7 @@ void Sprite::updateTransform(void)
|
||||||
void Sprite::draw(void)
|
void Sprite::draw(void)
|
||||||
{
|
{
|
||||||
//TODO implement z order
|
//TODO implement z order
|
||||||
QuadCommand* renderCommand = new QuadCommand();
|
_quadCommand.init(0, _vertexZ, _texture->getName(), _shaderProgram, _blendFunc, &_quad, 1, _modelViewTransform);
|
||||||
renderCommand->init(0, _vertexZ, _texture->getName(), _shaderProgram, _blendFunc, &_quad, 1, _modelViewTransform);
|
|
||||||
|
|
||||||
// if(!culling())
|
// if(!culling())
|
||||||
// {
|
// {
|
||||||
|
@ -680,7 +679,7 @@ void Sprite::draw(void)
|
||||||
// }
|
// }
|
||||||
// else
|
// else
|
||||||
{
|
{
|
||||||
Director::getInstance()->getRenderer()->addCommand(renderCommand);
|
Director::getInstance()->getRenderer()->addCommand(&_quadCommand);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,6 +37,7 @@ THE SOFTWARE.
|
||||||
#include "CCGLBufferedNode.h"
|
#include "CCGLBufferedNode.h"
|
||||||
#endif // EMSCRIPTEN
|
#endif // EMSCRIPTEN
|
||||||
#include "CCPhysicsBody.h"
|
#include "CCPhysicsBody.h"
|
||||||
|
#include "renderer/CCQuadCommand.h"
|
||||||
#include "kazmath/kazmath.h"
|
#include "kazmath/kazmath.h"
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
@ -545,6 +546,7 @@ protected:
|
||||||
//
|
//
|
||||||
BlendFunc _blendFunc; /// It's required for TextureProtocol inheritance
|
BlendFunc _blendFunc; /// It's required for TextureProtocol inheritance
|
||||||
Texture2D* _texture; /// Texture2D object that is used to render the sprite
|
Texture2D* _texture; /// Texture2D object that is used to render the sprite
|
||||||
|
QuadCommand _quadCommand; /// quad command
|
||||||
|
|
||||||
//
|
//
|
||||||
// Shared data
|
// Shared data
|
||||||
|
|
|
@ -43,7 +43,7 @@ THE SOFTWARE.
|
||||||
#include "CCLayer.h"
|
#include "CCLayer.h"
|
||||||
#include "CCScene.h"
|
#include "CCScene.h"
|
||||||
#include "CCRenderer.h"
|
#include "CCRenderer.h"
|
||||||
#include "CCQuadCommand.h"
|
#include "renderer/CCQuadCommand.h"
|
||||||
// external
|
// external
|
||||||
#include "kazmath/GL/matrix.h"
|
#include "kazmath/GL/matrix.h"
|
||||||
|
|
||||||
|
@ -360,8 +360,7 @@ void SpriteBatchNode::draw()
|
||||||
kmMat4 mv;
|
kmMat4 mv;
|
||||||
kmGLGetMatrix(KM_GL_MODELVIEW, &mv);
|
kmGLGetMatrix(KM_GL_MODELVIEW, &mv);
|
||||||
|
|
||||||
QuadCommand* cmd = new QuadCommand();
|
_quadCommand.init(0,
|
||||||
cmd->init(0,
|
|
||||||
_vertexZ,
|
_vertexZ,
|
||||||
_textureAtlas->getTexture()->getName(),
|
_textureAtlas->getTexture()->getName(),
|
||||||
shader,
|
shader,
|
||||||
|
@ -369,7 +368,7 @@ void SpriteBatchNode::draw()
|
||||||
_textureAtlas->getQuads(),
|
_textureAtlas->getQuads(),
|
||||||
_textureAtlas->getTotalQuads(),
|
_textureAtlas->getTotalQuads(),
|
||||||
mv);
|
mv);
|
||||||
Director::getInstance()->getRenderer()->addCommand(cmd);
|
Director::getInstance()->getRenderer()->addCommand(&_quadCommand);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpriteBatchNode::increaseAtlasCapacity(void)
|
void SpriteBatchNode::increaseAtlasCapacity(void)
|
||||||
|
|
|
@ -34,6 +34,7 @@ THE SOFTWARE.
|
||||||
#include "CCProtocols.h"
|
#include "CCProtocols.h"
|
||||||
#include "CCTextureAtlas.h"
|
#include "CCTextureAtlas.h"
|
||||||
#include "ccMacros.h"
|
#include "ccMacros.h"
|
||||||
|
#include "renderer/CCQuadCommand.h"
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
|
@ -187,6 +188,7 @@ protected:
|
||||||
|
|
||||||
TextureAtlas *_textureAtlas;
|
TextureAtlas *_textureAtlas;
|
||||||
BlendFunc _blendFunc;
|
BlendFunc _blendFunc;
|
||||||
|
QuadCommand _quadCommand; // quad command
|
||||||
|
|
||||||
// all descendants: children, grand children, etc...
|
// all descendants: children, grand children, etc...
|
||||||
// There is not need to retain/release these objects, since they are already retained by _children
|
// There is not need to retain/release these objects, since they are already retained by _children
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
#include "CCQuadCommand.h"
|
#include "renderer/CCQuadCommand.h"
|
||||||
#include "ccGLStateCache.h"
|
#include "ccGLStateCache.h"
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
|
@ -108,7 +108,6 @@ public:
|
||||||
|
|
||||||
void pushBackCommand(QuadCommand* ptr)
|
void pushBackCommand(QuadCommand* ptr)
|
||||||
{
|
{
|
||||||
delete ptr;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
#include "CCShaderCache.h"
|
#include "CCShaderCache.h"
|
||||||
#include "ccGLStateCache.h"
|
#include "ccGLStateCache.h"
|
||||||
#include "CCCustomCommand.h"
|
#include "CCCustomCommand.h"
|
||||||
#include "CCQuadCommand.h"
|
#include "renderer/CCQuadCommand.h"
|
||||||
#include "CCGroupCommand.h"
|
#include "CCGroupCommand.h"
|
||||||
#include "CCConfiguration.h"
|
#include "CCConfiguration.h"
|
||||||
#include "CCNotificationCenter.h"
|
#include "CCNotificationCenter.h"
|
||||||
|
|
|
@ -28,7 +28,7 @@ THE SOFTWARE.
|
||||||
#include "cocostudio/CCDataReaderHelper.h"
|
#include "cocostudio/CCDataReaderHelper.h"
|
||||||
#include "cocostudio/CCDatas.h"
|
#include "cocostudio/CCDatas.h"
|
||||||
#include "cocostudio/CCSkin.h"
|
#include "cocostudio/CCSkin.h"
|
||||||
#include "CCQuadCommand.h"
|
#include "renderer/CCQuadCommand.h"
|
||||||
#include "CCRenderer.h"
|
#include "CCRenderer.h"
|
||||||
#include "CCGroupCommand.h"
|
#include "CCGroupCommand.h"
|
||||||
|
|
||||||
|
|
|
@ -219,9 +219,8 @@ void Skin::draw()
|
||||||
kmGLGetMatrix(KM_GL_MODELVIEW, &mv);
|
kmGLGetMatrix(KM_GL_MODELVIEW, &mv);
|
||||||
|
|
||||||
//TODO implement z order
|
//TODO implement z order
|
||||||
QuadCommand* renderCommand = new QuadCommand();
|
_quadCommand.init(0, _vertexZ, _texture->getName(), _shaderProgram, _blendFunc, &_quad, 1, mv);
|
||||||
renderCommand->init(0, _vertexZ, _texture->getName(), _shaderProgram, _blendFunc, &_quad, 1, mv);
|
Director::getInstance()->getRenderer()->addCommand(&_quadCommand);
|
||||||
Director::getInstance()->getRenderer()->addCommand(renderCommand);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Skin::setBone(Bone *bone)
|
void Skin::setBone(Bone *bone)
|
||||||
|
|
|
@ -27,6 +27,7 @@ THE SOFTWARE.
|
||||||
|
|
||||||
#include "cocostudio/CCArmatureDefine.h"
|
#include "cocostudio/CCArmatureDefine.h"
|
||||||
#include "cocostudio/CCBone.h"
|
#include "cocostudio/CCBone.h"
|
||||||
|
#include "renderer/CCQuadCommand.h"
|
||||||
|
|
||||||
namespace cocostudio {
|
namespace cocostudio {
|
||||||
|
|
||||||
|
@ -74,6 +75,7 @@ protected:
|
||||||
Armature *_armature;
|
Armature *_armature;
|
||||||
kmMat4 _skinTransform;
|
kmMat4 _skinTransform;
|
||||||
std::string _displayName;
|
std::string _displayName;
|
||||||
|
cocos2d::QuadCommand _quadCommand; // quad command
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue