diff --git a/jsb/jsb-tex-sprite-frame.js b/jsb/jsb-tex-sprite-frame.js index 4ca18cb1c5..8a64472cbd 100644 --- a/jsb/jsb-tex-sprite-frame.js +++ b/jsb/jsb-tex-sprite-frame.js @@ -197,7 +197,6 @@ cc.Class._fastDefine('cc.SpriteFrame', cc.SpriteFrame, []); cc.SpriteFrame.$super = cc.Asset; prototype = cc.SpriteFrame.prototype; -prototype._setTexture = prototype.setTexture; cc.js.mixin(prototype, cc.EventTarget.prototype); @@ -213,6 +212,18 @@ prototype._ctor = function (filename, rect, rotated, offset, originalSize) { } }; +prototype._getTexture = prototype.getTexture; +prototype.getTexture = function () { + var tex = this._getTexture(); + this._texture = tex; + return tex; +}; +prototype.__setTexture = prototype.setTexture; +prototype._setTexture = function (tex) { + this.__setTexture(tex); + this._texture = tex; +}; + prototype.textureLoaded = function () { return this.getTexture() !== null; }; @@ -333,13 +344,6 @@ prototype._checkRect = function (texture) { } }; -prototype._getTexture = prototype.getTexture; -prototype.getTexture = function () { - var tex = this._getTexture(); - this._texture = tex; - return tex; -}; - prototype._clone = prototype.clone; prototype.clone = function () { var cloned = this._clone();