mirror of https://github.com/axmolengine/axmol.git
BatchCommand API fixes
don't pass Texture Id. Instead fetch it from the `TextureAtlas`
This commit is contained in:
parent
eeeae56684
commit
e402f35e7f
|
@ -384,7 +384,6 @@ void ParticleBatchNode::draw(void)
|
|||
|
||||
_batchCommand.init(
|
||||
_globalZOrder,
|
||||
_textureAtlas->getTexture()->getName(),
|
||||
_shaderProgram,
|
||||
_blendFunc,
|
||||
_textureAtlas,
|
||||
|
|
|
@ -358,7 +358,6 @@ void SpriteBatchNode::draw()
|
|||
|
||||
_batchCommand.init(
|
||||
_globalZOrder,
|
||||
_textureAtlas->getTexture()->getName(),
|
||||
_shaderProgram,
|
||||
_blendFunc,
|
||||
_textureAtlas,
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include "renderer/CCBatchCommand.h"
|
||||
#include "ccGLStateCache.h"
|
||||
#include "CCTextureAtlas.h"
|
||||
#include "CCTexture2D.h"
|
||||
|
||||
NS_CC_BEGIN
|
||||
|
||||
|
@ -38,10 +39,13 @@ BatchCommand::BatchCommand()
|
|||
_shader = nullptr;
|
||||
}
|
||||
|
||||
void BatchCommand::init(float globalOrder, GLuint textureID, GLProgram* shader, BlendFunc blendType, TextureAtlas *textureAtlas, const kmMat4& modelViewTransform)
|
||||
void BatchCommand::init(float globalOrder, GLProgram* shader, BlendFunc blendType, TextureAtlas *textureAtlas, const kmMat4& modelViewTransform)
|
||||
{
|
||||
CCASSERT(shader, "shader cannot be nill");
|
||||
CCASSERT(textureAtlas, "textureAtlas cannot be nill");
|
||||
|
||||
_globalOrder = globalOrder;
|
||||
_textureID = textureID;
|
||||
_textureID = textureAtlas->getTexture()->getName();
|
||||
_blendType = blendType;
|
||||
_shader = shader;
|
||||
|
||||
|
|
|
@ -43,19 +43,15 @@ public:
|
|||
BatchCommand();
|
||||
~BatchCommand();
|
||||
|
||||
void init(float depth, GLuint texutreID, GLProgram* shader, BlendFunc blendType, TextureAtlas *textureAtlas, const kmMat4& modelViewTransform);
|
||||
void init(float depth, GLProgram* shader, BlendFunc blendType, TextureAtlas *textureAtlas, const kmMat4& modelViewTransform);
|
||||
|
||||
void execute();
|
||||
|
||||
protected:
|
||||
//Material
|
||||
int32_t _materialID;
|
||||
|
||||
//Maternal
|
||||
GLuint _textureID;
|
||||
|
||||
GLProgram* _shader;
|
||||
// GLuint _shaderID;
|
||||
|
||||
BlendFunc _blendType;
|
||||
|
||||
TextureAtlas *_textureAtlas;
|
||||
|
|
Loading…
Reference in New Issue