diff --git a/cocos/3d/CCSprite3D.h b/cocos/3d/CCSprite3D.h index c9f729d70f..48d8452c5a 100644 --- a/cocos/3d/CCSprite3D.h +++ b/cocos/3d/CCSprite3D.h @@ -200,7 +200,7 @@ public: */ void setForce2DQueue(bool force2D); - Vector& getMeshes() { return _meshes; } + const Vector& getMeshes() const { return _meshes; } const AABB& getAABB(bool world) const; CC_CONSTRUCTOR_ACCESS: diff --git a/cocos/renderer/CCTextureCache.cpp b/cocos/renderer/CCTextureCache.cpp index 1430ae5891..89c70188ba 100644 --- a/cocos/renderer/CCTextureCache.cpp +++ b/cocos/renderer/CCTextureCache.cpp @@ -600,7 +600,7 @@ std::string TextureCache::getCachedTextureInfo() const return buffer; } -void TextureCache::renameTextureWithKey(std::string srcName, std::string dstName) +void TextureCache::renameTextureWithKey(const std::string srcName, const std::string dstName) { std::string key = srcName; auto it = _textures.find(key); diff --git a/cocos/renderer/CCTextureCache.h b/cocos/renderer/CCTextureCache.h index 5b769491ba..730f3ea3fa 100644 --- a/cocos/renderer/CCTextureCache.h +++ b/cocos/renderer/CCTextureCache.h @@ -207,7 +207,7 @@ public: void setDirty(bool dirty) { _dirty = dirty; } bool isDirty() const { return _dirty; } - void renameTextureWithKey(std::string srcName, std::string dstName); + void renameTextureWithKey(const std::string srcName, const std::string dstName); private: