diff --git a/cocos2d/core/CCScheduler.js b/cocos2d/core/CCScheduler.js index 9c3ec89076..f0985028d7 100644 --- a/cocos2d/core/CCScheduler.js +++ b/cocos2d/core/CCScheduler.js @@ -33,46 +33,35 @@ var MAX_POOL_SIZE = 20; /* * A list double-linked list used for "updates with priority" * @class ListEntry - * @param {ListEntry} prev - * @param {ListEntry} next - * @param {function} callback * @param {Object} target not retained (retained by hashUpdateEntry) * @param {Number} priority * @param {Boolean} paused * @param {Boolean} markedForDeletion selector will no longer be called and entry will be removed at end of the next tick */ -var ListEntry = function (prev, next, callback, target, priority, paused, markedForDeletion) { - this.prev = prev; - this.next = next; - this.callback = callback; +var ListEntry = function (target, priority, paused, markedForDeletion) { this.target = target; this.priority = priority; this.paused = paused; this.markedForDeletion = markedForDeletion; - this.isUpdate = !callback; }; var _listEntries = []; -ListEntry.get = function (prev, next, callback, target, priority, paused, markedForDeletion) { +ListEntry.get = function (target, priority, paused, markedForDeletion) { var result = _listEntries.pop(); if (result) { - result.prev = prev; - result.next = next; - result.callback = callback; result.target = target; result.priority = priority; result.paused = paused; result.markedForDeletion = markedForDeletion; - result.isUpdate = !callback; } else { - result = new ListEntry(prev, next, callback, target, priority, paused, markedForDeletion); + result = new ListEntry(target, priority, paused, markedForDeletion); } return result; }; ListEntry.put = function (entry) { if (_listEntries.length < MAX_POOL_SIZE) { - entry.prev = entry.next = entry.callback = entry.target = null; + entry.target = null; _listEntries.push(entry); } }; @@ -402,19 +391,19 @@ cc.Scheduler = cc._Class.extend({ for(i=0,list=this._updatesNegList, len = list.length; i -1) //this mistake like MIUI, so use of MIUI treatment method - __BrowserGetter.adaptationType = cc.sys.BROWSER_TYPE_MIUI; - if (cc.sys.os === cc.sys.OS_IOS) // All browsers are WebView __BrowserGetter.adaptationType = cc.sys.BROWSER_TYPE_SAFARI; @@ -89,20 +86,6 @@ switch (__BrowserGetter.adaptationType) { return frame.clientHeight; }; break; - case cc.sys.BROWSER_TYPE_MIUI: - __BrowserGetter.init = function(view){ - if(view.__resizeWithBrowserSize) return; - var resize = function(){ - view.setDesignResolutionSize( - view._designResolutionSize.width, - view._designResolutionSize.height, - view._resolutionPolicy - ); - window.removeEventListener("resize", resize, false); - }; - window.addEventListener("resize", resize, false); - }; - break; case cc.sys.BROWSER_TYPE_WECHAT_GAME: __BrowserGetter.availWidth = function(){ return window.innerWidth;