mirror of https://github.com/axmolengine/axmol.git
Fix merge error.
This commit is contained in:
parent
e647820c9c
commit
0caf671edd
|
@ -114,23 +114,6 @@ bool SpriteBatchNode::initWithTexture(Texture2D *tex, ssize_t capacity/* = DEFAU
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpriteBatchNode::setProgramState(backend::ProgramState* programState)
|
|
||||||
{
|
|
||||||
auto& pipelineDescriptor = _quadCommand.getPipelineDescriptor();
|
|
||||||
if (_programState != programState)
|
|
||||||
{
|
|
||||||
CC_SAFE_RELEASE(_programState);
|
|
||||||
_programState = programState;
|
|
||||||
CC_SAFE_RETAIN(programState);
|
|
||||||
}
|
|
||||||
pipelineDescriptor.programState = _programState;
|
|
||||||
|
|
||||||
CC_SAFE_RELEASE(program);
|
|
||||||
|
|
||||||
setVertexLayout();
|
|
||||||
setUniformLocation();
|
|
||||||
}
|
|
||||||
|
|
||||||
void SpriteBatchNode::setUniformLocation()
|
void SpriteBatchNode::setUniformLocation()
|
||||||
{
|
{
|
||||||
CCASSERT(_programState, "programState should not be nullptr");
|
CCASSERT(_programState, "programState should not be nullptr");
|
||||||
|
@ -717,7 +700,7 @@ Texture2D* SpriteBatchNode::getTexture() const
|
||||||
void SpriteBatchNode::setTexture(Texture2D *texture)
|
void SpriteBatchNode::setTexture(Texture2D *texture)
|
||||||
{
|
{
|
||||||
_textureAtlas->setTexture(texture);
|
_textureAtlas->setTexture(texture);
|
||||||
|
setProgramStateWithRegistry(backend::ProgramType::POSITION_TEXTURE_COLOR, texture);
|
||||||
updateProgramStateTexture(texture);
|
updateProgramStateTexture(texture);
|
||||||
updateBlendFunc();
|
updateBlendFunc();
|
||||||
}
|
}
|
||||||
|
|
|
@ -266,8 +266,6 @@ protected:
|
||||||
void updateBlendFunc();
|
void updateBlendFunc();
|
||||||
void setVertexLayout();
|
void setVertexLayout();
|
||||||
void setUniformLocation();
|
void setUniformLocation();
|
||||||
|
|
||||||
void setProgramState(backend::ProgramState* programState) override;
|
|
||||||
|
|
||||||
TextureAtlas *_textureAtlas = nullptr;
|
TextureAtlas *_textureAtlas = nullptr;
|
||||||
BlendFunc _blendFunc;
|
BlendFunc _blendFunc;
|
||||||
|
|
Loading…
Reference in New Issue