mirror of https://github.com/axmolengine/axmol.git
Remove unnecessary APIs
This commit is contained in:
parent
32a6a2b1ac
commit
ad69ed003a
|
@ -170,7 +170,6 @@ void DrawNode::updateShaderInternal(CustomCommand& cmd,
|
||||||
|
|
||||||
auto program = backend::Program::getBuiltinProgram(programType);
|
auto program = backend::Program::getBuiltinProgram(programType);
|
||||||
pipelinePS = new backend::ProgramState(program);
|
pipelinePS = new backend::ProgramState(program);
|
||||||
setVertexLayout(cmd);
|
|
||||||
cmd.setPrimitiveType(primitiveType);
|
cmd.setPrimitiveType(primitiveType);
|
||||||
cmd.setDrawType(drawType);
|
cmd.setDrawType(drawType);
|
||||||
}
|
}
|
||||||
|
@ -181,10 +180,6 @@ void DrawNode::freeShaderInternal(CustomCommand& cmd)
|
||||||
AX_SAFE_RELEASE_NULL(pipelinePS);
|
AX_SAFE_RELEASE_NULL(pipelinePS);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrawNode::setVertexLayout(CustomCommand& cmd)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void DrawNode::updateBlendState(CustomCommand& cmd)
|
void DrawNode::updateBlendState(CustomCommand& cmd)
|
||||||
{
|
{
|
||||||
backend::BlendDescriptor& blendDescriptor = cmd.getPipelineDescriptor().blendDescriptor;
|
backend::BlendDescriptor& blendDescriptor = cmd.getPipelineDescriptor().blendDescriptor;
|
||||||
|
|
|
@ -378,7 +378,6 @@ protected:
|
||||||
CustomCommand::PrimitiveType primitiveType);
|
CustomCommand::PrimitiveType primitiveType);
|
||||||
void freeShaderInternal(CustomCommand& cmd);
|
void freeShaderInternal(CustomCommand& cmd);
|
||||||
|
|
||||||
void setVertexLayout(CustomCommand& cmd);
|
|
||||||
void updateBlendState(CustomCommand& cmd);
|
void updateBlendState(CustomCommand& cmd);
|
||||||
void updateUniforms(const Mat4& transform, CustomCommand& cmd);
|
void updateUniforms(const Mat4& transform, CustomCommand& cmd);
|
||||||
|
|
||||||
|
|
|
@ -674,10 +674,6 @@ static Texture2D* _getTexture(Label* label)
|
||||||
return texture;
|
return texture;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Label::setVertexLayout()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Label::setProgramState(backend::ProgramState* programState, bool needsRetain)
|
bool Label::setProgramState(backend::ProgramState* programState, bool needsRetain)
|
||||||
{
|
{
|
||||||
if (Node::setProgramState(programState, needsRetain))
|
if (Node::setProgramState(programState, needsRetain))
|
||||||
|
@ -689,7 +685,6 @@ bool Label::setProgramState(backend::ProgramState* programState, bool needsRetai
|
||||||
}
|
}
|
||||||
|
|
||||||
auto& quadPipeline = _quadCommand.getPipelineDescriptor();
|
auto& quadPipeline = _quadCommand.getPipelineDescriptor();
|
||||||
setVertexLayout();
|
|
||||||
quadPipeline.programState = _programState;
|
quadPipeline.programState = _programState;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -758,7 +753,6 @@ void Label::updateShaderProgram()
|
||||||
}
|
}
|
||||||
|
|
||||||
auto& quadPipeline = _quadCommand.getPipelineDescriptor();
|
auto& quadPipeline = _quadCommand.getPipelineDescriptor();
|
||||||
setVertexLayout();
|
|
||||||
quadPipeline.programState = _programState;
|
quadPipeline.programState = _programState;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -801,7 +801,6 @@ protected:
|
||||||
virtual void updateColor() override;
|
virtual void updateColor() override;
|
||||||
|
|
||||||
void updateUniformLocations();
|
void updateUniformLocations();
|
||||||
void setVertexLayout();
|
|
||||||
void updateBlendState();
|
void updateBlendState();
|
||||||
void updateEffectUniforms(BatchCommand& batch,
|
void updateEffectUniforms(BatchCommand& batch,
|
||||||
TextureAtlas* textureAtlas,
|
TextureAtlas* textureAtlas,
|
||||||
|
|
|
@ -355,10 +355,6 @@ void Sprite::setTexture(std::string_view filename)
|
||||||
setTextureRect(rect);
|
setTextureRect(rect);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Sprite::setVertexLayout()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void Sprite::setProgramState(uint32_t type)
|
void Sprite::setProgramState(uint32_t type)
|
||||||
{
|
{
|
||||||
setProgramStateWithRegistry(type, _texture);
|
setProgramStateWithRegistry(type, _texture);
|
||||||
|
@ -374,7 +370,6 @@ bool Sprite::setProgramState(backend::ProgramState* programState, bool needsReta
|
||||||
|
|
||||||
_mvpMatrixLocation = _programState->getUniformLocation(backend::Uniform::MVP_MATRIX);
|
_mvpMatrixLocation = _programState->getUniformLocation(backend::Uniform::MVP_MATRIX);
|
||||||
|
|
||||||
setVertexLayout();
|
|
||||||
updateProgramStateTexture(_texture);
|
updateProgramStateTexture(_texture);
|
||||||
setMVPMatrixUniform();
|
setMVPMatrixUniform();
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -620,8 +620,6 @@ public:
|
||||||
*/
|
*/
|
||||||
virtual bool initWithFile(std::string_view filename, const Rect& rect);
|
virtual bool initWithFile(std::string_view filename, const Rect& rect);
|
||||||
|
|
||||||
virtual void setVertexLayout();
|
|
||||||
|
|
||||||
void setProgramState(uint32_t type) override;
|
void setProgramState(uint32_t type) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -121,11 +121,6 @@ void SpriteBatchNode::setUniformLocation()
|
||||||
_textureLocation = _programState->getUniformLocation("u_tex0");
|
_textureLocation = _programState->getUniformLocation("u_tex0");
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpriteBatchNode::setVertexLayout()
|
|
||||||
{
|
|
||||||
AXASSERT(_programState, "programState should not be nullptr");
|
|
||||||
}
|
|
||||||
|
|
||||||
bool SpriteBatchNode::setProgramState(backend::ProgramState* programState, bool needsRetain)
|
bool SpriteBatchNode::setProgramState(backend::ProgramState* programState, bool needsRetain)
|
||||||
{
|
{
|
||||||
AXASSERT(programState, "programState should not be nullptr");
|
AXASSERT(programState, "programState should not be nullptr");
|
||||||
|
@ -134,7 +129,6 @@ bool SpriteBatchNode::setProgramState(backend::ProgramState* programState, bool
|
||||||
auto& pipelineDescriptor = _quadCommand.getPipelineDescriptor();
|
auto& pipelineDescriptor = _quadCommand.getPipelineDescriptor();
|
||||||
pipelineDescriptor.programState = _programState;
|
pipelineDescriptor.programState = _programState;
|
||||||
|
|
||||||
setVertexLayout();
|
|
||||||
updateProgramStateTexture(_textureAtlas->getTexture());
|
updateProgramStateTexture(_textureAtlas->getTexture());
|
||||||
setUniformLocation();
|
setUniformLocation();
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -263,7 +263,6 @@ protected:
|
||||||
void updateAtlasIndex(Sprite* sprite, ssize_t* curIndex);
|
void updateAtlasIndex(Sprite* sprite, ssize_t* curIndex);
|
||||||
void swap(ssize_t oldIndex, ssize_t newIndex);
|
void swap(ssize_t oldIndex, ssize_t newIndex);
|
||||||
void updateBlendFunc();
|
void updateBlendFunc();
|
||||||
void setVertexLayout();
|
|
||||||
void setUniformLocation();
|
void setUniformLocation();
|
||||||
|
|
||||||
TextureAtlas* _textureAtlas = nullptr;
|
TextureAtlas* _textureAtlas = nullptr;
|
||||||
|
|
|
@ -58824,53 +58824,6 @@ int lua_ax_base_Sprite_getSpriteFrame(lua_State* tolua_S)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
int lua_ax_base_Sprite_setVertexLayout(lua_State* tolua_S)
|
|
||||||
{
|
|
||||||
int argc = 0;
|
|
||||||
ax::Sprite* cobj = nullptr;
|
|
||||||
bool ok = true;
|
|
||||||
|
|
||||||
#if _AX_DEBUG >= 1
|
|
||||||
tolua_Error tolua_err;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#if _AX_DEBUG >= 1
|
|
||||||
if (!tolua_isusertype(tolua_S,1,"ax.Sprite",0,&tolua_err)) goto tolua_lerror;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
cobj = (ax::Sprite*)tolua_tousertype(tolua_S,1,0);
|
|
||||||
|
|
||||||
#if _AX_DEBUG >= 1
|
|
||||||
if (!cobj)
|
|
||||||
{
|
|
||||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_ax_base_Sprite_setVertexLayout'", nullptr);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
argc = lua_gettop(tolua_S)-1;
|
|
||||||
if (argc == 0)
|
|
||||||
{
|
|
||||||
if(!ok)
|
|
||||||
{
|
|
||||||
tolua_error(tolua_S,"invalid arguments in function 'lua_ax_base_Sprite_setVertexLayout'", nullptr);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
cobj->setVertexLayout();
|
|
||||||
lua_settop(tolua_S, 1);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ax.Sprite:setVertexLayout",argc, 0);
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
#if _AX_DEBUG >= 1
|
|
||||||
tolua_lerror:
|
|
||||||
tolua_error(tolua_S,"#ferror in function 'lua_ax_base_Sprite_setVertexLayout'.",&tolua_err);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
int lua_ax_base_Sprite_removeAllChildrenWithCleanup(lua_State* tolua_S)
|
int lua_ax_base_Sprite_removeAllChildrenWithCleanup(lua_State* tolua_S)
|
||||||
{
|
{
|
||||||
int argc = 0;
|
int argc = 0;
|
||||||
|
@ -59915,7 +59868,6 @@ int lua_register_ax_base_Sprite(lua_State* tolua_S)
|
||||||
tolua_function(tolua_S,"getBlendFunc",lua_ax_base_Sprite_getBlendFunc);
|
tolua_function(tolua_S,"getBlendFunc",lua_ax_base_Sprite_getBlendFunc);
|
||||||
tolua_function(tolua_S,"setCenterRect",lua_ax_base_Sprite_setCenterRect);
|
tolua_function(tolua_S,"setCenterRect",lua_ax_base_Sprite_setCenterRect);
|
||||||
tolua_function(tolua_S,"getSpriteFrame",lua_ax_base_Sprite_getSpriteFrame);
|
tolua_function(tolua_S,"getSpriteFrame",lua_ax_base_Sprite_getSpriteFrame);
|
||||||
tolua_function(tolua_S,"setVertexLayout",lua_ax_base_Sprite_setVertexLayout);
|
|
||||||
tolua_function(tolua_S,"removeAllChildrenWithCleanup",lua_ax_base_Sprite_removeAllChildrenWithCleanup);
|
tolua_function(tolua_S,"removeAllChildrenWithCleanup",lua_ax_base_Sprite_removeAllChildrenWithCleanup);
|
||||||
tolua_function(tolua_S,"getResourceName",lua_ax_base_Sprite_getResourceName);
|
tolua_function(tolua_S,"getResourceName",lua_ax_base_Sprite_getResourceName);
|
||||||
tolua_function(tolua_S,"isDirty",lua_ax_base_Sprite_isDirty);
|
tolua_function(tolua_S,"isDirty",lua_ax_base_Sprite_isDirty);
|
||||||
|
|
Loading…
Reference in New Issue