mirror of https://github.com/axmolengine/axmol.git
closed #3991, Remove the method CCTextureCache::updateTexture().
This commit is contained in:
parent
ed97658549
commit
56a46892fe
|
@ -34,7 +34,6 @@ THE SOFTWARE.
|
|||
#include "CCTexture2D.h"
|
||||
#include "ccMacros.h"
|
||||
#include "CCDirector.h"
|
||||
#include "CCSprite.h"
|
||||
#include "platform/CCFileUtils.h"
|
||||
#include "ccUtils.h"
|
||||
#include "CCScheduler.h"
|
||||
|
@ -409,33 +408,6 @@ bool TextureCache::reloadTexture(const std::string& fileName)
|
|||
return ret;
|
||||
}
|
||||
|
||||
void TextureCache::updateTexture(Node* node, Texture2D* texture)
|
||||
{
|
||||
if (nullptr == node || nullptr == texture) {
|
||||
return;
|
||||
}
|
||||
|
||||
// update self
|
||||
auto sprite = dynamic_cast<Sprite*>(node);
|
||||
if (nullptr != sprite && sprite->getTexture() == texture) {
|
||||
auto size = texture->getContentSize();
|
||||
sprite->setTextureRect(Rect(0, 0, size.width, size.height));
|
||||
}
|
||||
|
||||
// update children
|
||||
auto children = node->getChildren();
|
||||
if (children.size() > 0)
|
||||
{
|
||||
for (auto obj : children)
|
||||
{
|
||||
auto childNode = dynamic_cast<Node*>(obj);
|
||||
if (nullptr != childNode) {
|
||||
updateTexture(childNode, texture);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TextureCache - Remove
|
||||
|
||||
void TextureCache::removeAllTextures()
|
||||
|
|
|
@ -141,12 +141,6 @@ public:
|
|||
* Return true if the reloading is succeed, otherwise return false.
|
||||
*/
|
||||
bool reloadTexture(const std::string& fileName);
|
||||
|
||||
/** Update the nodes & it's children which used texture
|
||||
* The "node" parameter is the root node will be updated
|
||||
* The "texture" parameter is the texture which was updated
|
||||
*/
|
||||
void updateTexture(Node* node, Texture2D* texture);
|
||||
|
||||
/** Purges the dictionary of loaded textures.
|
||||
* Call this method if you receive the "Memory Warning"
|
||||
|
|
Loading…
Reference in New Issue