From ad69ed003a6fff84fea8f63c1fa31d1d1913f0d2 Mon Sep 17 00:00:00 2001 From: halx99 Date: Mon, 26 Sep 2022 23:20:54 +0800 Subject: [PATCH] Remove unnecessary APIs --- core/2d/CCDrawNode.cpp | 5 -- core/2d/CCDrawNode.h | 1 - core/2d/CCLabel.cpp | 6 --- core/2d/CCLabel.h | 1 - core/2d/CCSprite.cpp | 5 -- core/2d/CCSprite.h | 2 - core/2d/CCSpriteBatchNode.cpp | 6 --- core/2d/CCSpriteBatchNode.h | 1 - .../lua-bindings/auto/axlua_base_auto.cpp | 48 ------------------- 9 files changed, 75 deletions(-) diff --git a/core/2d/CCDrawNode.cpp b/core/2d/CCDrawNode.cpp index 6c7c57f00d..243ec25311 100644 --- a/core/2d/CCDrawNode.cpp +++ b/core/2d/CCDrawNode.cpp @@ -170,7 +170,6 @@ void DrawNode::updateShaderInternal(CustomCommand& cmd, auto program = backend::Program::getBuiltinProgram(programType); pipelinePS = new backend::ProgramState(program); - setVertexLayout(cmd); cmd.setPrimitiveType(primitiveType); cmd.setDrawType(drawType); } @@ -181,10 +180,6 @@ void DrawNode::freeShaderInternal(CustomCommand& cmd) AX_SAFE_RELEASE_NULL(pipelinePS); } -void DrawNode::setVertexLayout(CustomCommand& cmd) -{ -} - void DrawNode::updateBlendState(CustomCommand& cmd) { backend::BlendDescriptor& blendDescriptor = cmd.getPipelineDescriptor().blendDescriptor; diff --git a/core/2d/CCDrawNode.h b/core/2d/CCDrawNode.h index 0279432514..1826cc206c 100644 --- a/core/2d/CCDrawNode.h +++ b/core/2d/CCDrawNode.h @@ -378,7 +378,6 @@ protected: CustomCommand::PrimitiveType primitiveType); void freeShaderInternal(CustomCommand& cmd); - void setVertexLayout(CustomCommand& cmd); void updateBlendState(CustomCommand& cmd); void updateUniforms(const Mat4& transform, CustomCommand& cmd); diff --git a/core/2d/CCLabel.cpp b/core/2d/CCLabel.cpp index 860246d8e3..218a9e4565 100644 --- a/core/2d/CCLabel.cpp +++ b/core/2d/CCLabel.cpp @@ -674,10 +674,6 @@ static Texture2D* _getTexture(Label* label) return texture; } -void Label::setVertexLayout() -{ -} - bool Label::setProgramState(backend::ProgramState* programState, bool needsRetain) { if (Node::setProgramState(programState, needsRetain)) @@ -689,7 +685,6 @@ bool Label::setProgramState(backend::ProgramState* programState, bool needsRetai } auto& quadPipeline = _quadCommand.getPipelineDescriptor(); - setVertexLayout(); quadPipeline.programState = _programState; return true; } @@ -758,7 +753,6 @@ void Label::updateShaderProgram() } auto& quadPipeline = _quadCommand.getPipelineDescriptor(); - setVertexLayout(); quadPipeline.programState = _programState; } diff --git a/core/2d/CCLabel.h b/core/2d/CCLabel.h index a840090d6d..3d97071ad7 100644 --- a/core/2d/CCLabel.h +++ b/core/2d/CCLabel.h @@ -801,7 +801,6 @@ protected: virtual void updateColor() override; void updateUniformLocations(); - void setVertexLayout(); void updateBlendState(); void updateEffectUniforms(BatchCommand& batch, TextureAtlas* textureAtlas, diff --git a/core/2d/CCSprite.cpp b/core/2d/CCSprite.cpp index 11472c7dad..7b97608441 100644 --- a/core/2d/CCSprite.cpp +++ b/core/2d/CCSprite.cpp @@ -355,10 +355,6 @@ void Sprite::setTexture(std::string_view filename) setTextureRect(rect); } -void Sprite::setVertexLayout() -{ -} - void Sprite::setProgramState(uint32_t type) { setProgramStateWithRegistry(type, _texture); @@ -374,7 +370,6 @@ bool Sprite::setProgramState(backend::ProgramState* programState, bool needsReta _mvpMatrixLocation = _programState->getUniformLocation(backend::Uniform::MVP_MATRIX); - setVertexLayout(); updateProgramStateTexture(_texture); setMVPMatrixUniform(); return true; diff --git a/core/2d/CCSprite.h b/core/2d/CCSprite.h index 7364670f18..f2362ed37d 100644 --- a/core/2d/CCSprite.h +++ b/core/2d/CCSprite.h @@ -620,8 +620,6 @@ public: */ virtual bool initWithFile(std::string_view filename, const Rect& rect); - virtual void setVertexLayout(); - void setProgramState(uint32_t type) override; protected: diff --git a/core/2d/CCSpriteBatchNode.cpp b/core/2d/CCSpriteBatchNode.cpp index 834b3d63f0..8478c926c7 100644 --- a/core/2d/CCSpriteBatchNode.cpp +++ b/core/2d/CCSpriteBatchNode.cpp @@ -121,11 +121,6 @@ void SpriteBatchNode::setUniformLocation() _textureLocation = _programState->getUniformLocation("u_tex0"); } -void SpriteBatchNode::setVertexLayout() -{ - AXASSERT(_programState, "programState should not be nullptr"); -} - bool SpriteBatchNode::setProgramState(backend::ProgramState* programState, bool needsRetain) { AXASSERT(programState, "programState should not be nullptr"); @@ -134,7 +129,6 @@ bool SpriteBatchNode::setProgramState(backend::ProgramState* programState, bool auto& pipelineDescriptor = _quadCommand.getPipelineDescriptor(); pipelineDescriptor.programState = _programState; - setVertexLayout(); updateProgramStateTexture(_textureAtlas->getTexture()); setUniformLocation(); return true; diff --git a/core/2d/CCSpriteBatchNode.h b/core/2d/CCSpriteBatchNode.h index a8ca08d3d8..1c3db302e3 100644 --- a/core/2d/CCSpriteBatchNode.h +++ b/core/2d/CCSpriteBatchNode.h @@ -263,7 +263,6 @@ protected: void updateAtlasIndex(Sprite* sprite, ssize_t* curIndex); void swap(ssize_t oldIndex, ssize_t newIndex); void updateBlendFunc(); - void setVertexLayout(); void setUniformLocation(); TextureAtlas* _textureAtlas = nullptr; diff --git a/extensions/scripting/lua-bindings/auto/axlua_base_auto.cpp b/extensions/scripting/lua-bindings/auto/axlua_base_auto.cpp index ea817cc473..e379c2aa62 100644 --- a/extensions/scripting/lua-bindings/auto/axlua_base_auto.cpp +++ b/extensions/scripting/lua-bindings/auto/axlua_base_auto.cpp @@ -58824,53 +58824,6 @@ int lua_ax_base_Sprite_getSpriteFrame(lua_State* tolua_S) 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 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,"setCenterRect",lua_ax_base_Sprite_setCenterRect); 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,"getResourceName",lua_ax_base_Sprite_getResourceName); tolua_function(tolua_S,"isDirty",lua_ax_base_Sprite_isDirty);