From e406b12eaaa23c620bd08ecd455115654f329886 Mon Sep 17 00:00:00 2001 From: linshun Date: Mon, 18 Nov 2013 17:02:43 +0800 Subject: [PATCH 01/15] fixed typo --- CHANGELOG.txt | 8 ++++---- cocos2d/base_nodes/CCNode.js | 32 ++++++++++++++++---------------- cocos2d/textures/CCTexture2D.js | 2 +- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 0baacb6775..2c54396c06 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,13 +1,13 @@ Cocos2d-html5-v2.2.1 @ Nov.19, 2013 * CocoStudio is now supported on Cocos2d-html5. The GUI, scene and component modules have been added to it. * cc.EGLView and most render classes have been re-written to adapt multiple resolution resources in-order to optimize performance on mobile browsers. -* Refactored cc.LabelTTF, now it's contentSize and position is correct for labels which has defined stroke and shadow. +* Refactored cc.LabelTTF, now its contentSize and position is correct for labels which has defined stroke and shadow. * Corrected the behavior of "CascadeColorEnabled" and "CascadeOpacityEnabled" for cc.NodeRGBA and cc.LayerRGBA. * All cc.Assert has being replaced, and more arguments checking and log information have added to engine's function. -* Add cc.Screen to engine, it uses to enter/exit fullscreen mode. -* Add cc.VisibleRect to engine, it provides nine points of game view for positioning. +* Added cc.Screen to engine, it uses to enter/exit FullScreen mode. +* Added cc.VisibleRect to engine, it provides nine points of game view for positioning. * cc.WebAudioEngine now works perfectly on chrome. -* CocoStudio's namespace changes to CCS now, and the other module's namespace will be renamed in next version. +* CocoStudio's namespace changes to 'ccs' now, and the other module's namespace will be renamed and support NPM in next version. * cc.rect now accepts more types of parameters on JSB and HTML5 now, for example: cc.rect(1,1,1,1) and cc.rect(aRect), and cc.rect(cc.p(1,1),cc.size(10,10)); * Optimized cc.Node's getBoundingBoxToWorld for better Performance. * Modified the _sequenceCompleted method in CCBAnimation, it can set the next sequence in callback now. diff --git a/cocos2d/base_nodes/CCNode.js b/cocos2d/base_nodes/CCNode.js index e27bb08966..c40eb59756 100644 --- a/cocos2d/base_nodes/CCNode.js +++ b/cocos2d/base_nodes/CCNode.js @@ -331,8 +331,8 @@ cc.Node = cc.Class.extend(/** @lends cc.Node# */{ *
* This is an internal method. Don't call it outside the framework.
* The difference between setZOrder(int) and _setOrder(int) is:
- * - _setZOrder(int) is a pure setter for m_nZOrder memeber variable
- * - setZOrder(int) firstly changes m_nZOrder, then recorder this node in its parent's chilren array. + * - _setZOrder(int) is a pure setter for m_nZOrder member variable
+ * - setZOrder(int) firstly changes m_nZOrder, then recorder this node in its parent's children array. *

* @param {Number} z * @private @@ -596,7 +596,7 @@ cc.Node = cc.Class.extend(/** @lends cc.Node# */{ * Composing a "tree" structure is a very important feature of CCNode * @return {Array} An array of children * @example - * //This sample code traverses all children nodes, and set theie position to (0,0) + * //This sample code traverses all children nodes, and set their position to (0,0) * var allChildren = parent.getChildren(); * for(var i = 0; i< allChildren.length; i++) { * allChildren[i].setPosition(0,0); @@ -718,7 +718,7 @@ cc.Node = cc.Class.extend(/** @lends cc.Node# */{ /** * Returns a pointer to the parent node - * @return {cc.Node} A pointer to the parnet node + * @return {cc.Node} A pointer to the parent node */ getParent:function () { return this._parent; @@ -726,7 +726,7 @@ cc.Node = cc.Class.extend(/** @lends cc.Node# */{ /** * Sets the parent node - * @param {cc.Node} Var A pointer to the parnet node + * @param {cc.Node} Var A pointer to the parent node */ setParent:function (Var) { this._parent = Var; @@ -760,7 +760,7 @@ cc.Node = cc.Class.extend(/** @lends cc.Node# */{ /** * Returns a tag that is used to identify the node easily. * - * @return {Number} A interger that identifies the node. + * @return {Number} An integer that identifies the node. * @example * //You can set tags to node then identify them easily. * // set tags @@ -812,7 +812,7 @@ cc.Node = cc.Class.extend(/** @lends cc.Node# */{ * Sets a custom user data pointer
* You can set everything in UserData pointer, a data block, a structure or an object, etc. *

- * @warning Don't forget to relfease the memroy manually,especially before you change this data pointer, and before this node is autoreleased. + * @warning Don't forget to release the memory manually,especially before you change this data pointer, and before this node is autoreleased. * @param {object} Var A custom user data */ setUserData:function (Var) { @@ -832,8 +832,8 @@ cc.Node = cc.Class.extend(/** @lends cc.Node# */{ *

* Returns a user assigned CCObject
* Similar to UserData, but instead of holding a void* it holds an object.
- * The UserObject will be retained once in this method, and the previous UserObject (if existed) will be relese.
- * The UserObject will be released in CCNode's destructure. + * The UserObject will be retained once in this method, and the previous UserObject (if existed) will be release.
+ * The UserObject will be released in CCNode's destruction. *

* @param {object} newValue A user assigned CCObject */ @@ -845,7 +845,7 @@ cc.Node = cc.Class.extend(/** @lends cc.Node# */{ /** - * Returns the arrival order, indecates which children is added previously. + * Returns the arrival order, indicates which children is added previously. * @return {Number} The arrival order. */ getOrderOfArrival:function () { @@ -910,7 +910,7 @@ cc.Node = cc.Class.extend(/** @lends cc.Node# */{ * Sets a CCScheduler object that is used to schedule all "updates" and timers.
*

* @warning If you set a new CCScheduler, then previously created timers/update are going to be removed. - * @param scheduler A cc.Shdeduler object that is used to schedule all "update" and timers. + * @param scheduler A cc.Scheduler object that is used to schedule all "update" and timers. */ setScheduler:function (scheduler) { if (this._scheduler != scheduler) { @@ -922,7 +922,7 @@ cc.Node = cc.Class.extend(/** @lends cc.Node# */{ /** * Returns a "local" axis aligned bounding box of the node.
* The returned box is relative only to its parent. - * @note This method returns a temporaty variable, so it can't returns const CCRect& + * @note This method returns a temporary variable, so it can't returns const CCRect& * @const * @return {cc.Rect} */ @@ -1085,7 +1085,7 @@ cc.Node = cc.Class.extend(/** @lends cc.Node# */{ /** * Removes all children from the container and do a cleanup all running actions depending on the cleanup parameter.
* If the cleanup parameter is not passed, it will force a cleanup.
- * @param {Boolean | null } cleanup true if all running actions on all children nodes should be cleanup, false oterwise. + * @param {Boolean | null } cleanup true if all running actions on all children nodes should be cleanup, false otherwise. */ removeAllChildren:function (cleanup) { // not using detachChild improves speed here @@ -1166,7 +1166,7 @@ cc.Node = cc.Class.extend(/** @lends cc.Node# */{ /** *

* Sorts the children array once before drawing, instead of every time when a child is added or reordered.
- * This appraoch can improves the performance massively. + * This approach can improves the performance massively. *

* @note Don't call this manually unless a child added needs to be removed in the same frame */ @@ -1474,7 +1474,7 @@ cc.Node = cc.Class.extend(/** @lends cc.Node# */{ * // Gets the spriteA's transform. * var t = spriteA.nodeToParentTransform(); * - * // Sets the additional transform to spriteB, spriteB's postion will based on its pseudo parent i.e. spriteA. + * // Sets the additional transform to spriteB, spriteB's position will based on its pseudo parent i.e. spriteA. * spriteB.setAdditionalTransform(t); * * //scale @@ -1624,7 +1624,7 @@ cc.Node = cc.Class.extend(/** @lends cc.Node# */{ }, /** - * Currently JavaScript Bindigns (JSB), in some cases, needs to use retain and release. This is a bug in JSB, + * Currently JavaScript Bindings (JSB), in some cases, needs to use retain and release. This is a bug in JSB, * and the ugly workaround is to use retain/release. So, these 2 methods were added to be compatible with JSB. * This is a hack, and should be removed once JSB fixes the retain/release bug */ diff --git a/cocos2d/textures/CCTexture2D.js b/cocos2d/textures/CCTexture2D.js index 127881dcbd..91be5ac05a 100644 --- a/cocos2d/textures/CCTexture2D.js +++ b/cocos2d/textures/CCTexture2D.js @@ -1015,7 +1015,7 @@ cc.Texture2DCanvas = cc.Class.extend(/** @lends cc.Texture2D# */{ }, /** - * Intializes with a texture2d with data + * Initializes with a texture2d with data * @param {Array} data * @param {Number} pixelFormat * @param {Number} pixelsWide From 63735d3e602f12d7cc9b1af63416e337c42b2610 Mon Sep 17 00:00:00 2001 From: linshun Date: Mon, 18 Nov 2013 17:03:26 +0800 Subject: [PATCH 02/15] Removed three games and added Simulator link to index page. --- index.html | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/index.html b/index.html index 80b0b618c2..b5ac4f320c 100644 --- a/index.html +++ b/index.html @@ -56,9 +56,7 @@

  • Template - Cocos2d-html5 Template
  • MoonWarriors - Game
  • Fruit Attack - Game
  • -
  • Watermelon with Me - Game
  • -
  • CocosDragon - Game
  • -
  • Crystal Craze - Game
  • +
  • MoonWarriors Simulator - Game runs on simulator

  • Note

    From 3c6508fb830d67ddf890099cd88c4a3624c45843 Mon Sep 17 00:00:00 2001 From: xingsenma Date: Wed, 18 Dec 2013 15:17:25 +0800 Subject: [PATCH 03/15] issue #3419 add play several movement for armature --- .../Armature/animation/CCArmatureAnimation.js | 131 +++++++++++++----- .../Armature/animation/CCProcessBase.js | 27 +--- .../CocoStudio/Armature/animation/CCTween.js | 28 +--- 3 files changed, 106 insertions(+), 80 deletions(-) diff --git a/extensions/CocoStudio/Armature/animation/CCArmatureAnimation.js b/extensions/CocoStudio/Armature/animation/CCArmatureAnimation.js index 188d96fda9..e0d8be0ff3 100644 --- a/extensions/CocoStudio/Armature/animation/CCArmatureAnimation.js +++ b/extensions/CocoStudio/Armature/animation/CCArmatureAnimation.js @@ -81,8 +81,12 @@ ccs.ArmatureAnimation = ccs.ProcessBase.extend(/** @lends ccs.ArmatureAnimation# _movementEvent:null, _speedScale:1, _ignoreFrameEvent:false, - _frameEventQueue:[], + _frameEventQueue:null, _userObject:null, + _movementList: null, + _onMovementList: false, + _movementListLoop: false, + _movementIndex: 0, ctor:function () { ccs.ProcessBase.prototype.ctor.call(this); this._animationData = null; @@ -98,6 +102,10 @@ ccs.ArmatureAnimation = ccs.ProcessBase.extend(/** @lends ccs.ArmatureAnimation# this._ignoreFrameEvent = false; this._frameEventQueue = []; this._userObject = null; + this._movementList = []; + this._onMovementList = false; + this._movementListLoop = false; + this._movementIndex = 0; }, /** @@ -180,27 +188,25 @@ ccs.ArmatureAnimation = ccs.ProcessBase.extend(/** @lends ccs.ArmatureAnimation# /** * play animation by animation name. - * @param {Number} animationName The animation name you want to play + * @param {String||Array} animationName The animation name you want to play * @param {Number} durationTo * he frames between two animation changing-over.It's meaning is changing to this animation need how many frames * -1 : use the value from CCMovementData get from flash design panel - * @param {Number} durationTween he - * frame count you want to play in the game.if _durationTween is 80, then the animation will played 80 frames in a loop - * -1 : use the value from CCMovementData get from flash design panel * @param {Number} loop * Whether the animation is loop. * loop < 0 : use the value from CCMovementData get from flash design panel * loop = 0 : this animation is not loop * loop > 0 : this animation is loop - * @param {Number} tweenEasing - * CCTween easing is used for calculate easing effect - * TWEEN_EASING_MAX : use the value from CCMovementData get from flash design panel - * -1 : fade out - * 0 : line - * 1 : fade in - * 2 : fade in and out */ - play:function (animationName, durationTo, durationTween, loop, tweenEasing) { + play:function (animationName, durationTo, loop) { + if(typeof animationName == "string"){ + this._playByName(animationName, durationTo, loop); + } else if(animationName instanceof Array){ + this._playByNames(animationName, durationTo, loop); + } + }, + + _playByName:function(animationName, durationTo, loop){ if (this._animationData == null) { cc.log("this._animationData can not be null"); return; @@ -213,15 +219,11 @@ ccs.ArmatureAnimation = ccs.ProcessBase.extend(/** @lends ccs.ArmatureAnimation# if (typeof durationTo == "undefined") { durationTo = -1; } - if (typeof durationTween == "undefined") { - durationTween = -1; - } + if (typeof loop == "undefined") { loop = -1; } - if (typeof tweenEasing == "undefined") { - tweenEasing = ccs.TweenType.tweenEasingMax; - } + var locMovementData = this._movementData; //Get key frame count this._rawDuration = locMovementData.duration; @@ -229,12 +231,18 @@ ccs.ArmatureAnimation = ccs.ProcessBase.extend(/** @lends ccs.ArmatureAnimation# this._processScale = this._speedScale * locMovementData.scale; //Further processing parameters durationTo = (durationTo == -1) ? locMovementData.durationTo : durationTo; - durationTween = (durationTween == -1) ? locMovementData.durationTween : durationTween; + var durationTween = locMovementData.durationTween; durationTween = (durationTween == 0) ? locMovementData.duration : durationTween;//todo - tweenEasing = (tweenEasing == ccs.TweenType.tweenEasingMax) ? locMovementData.tweenEasing : tweenEasing; - loop = (loop < 0) ? locMovementData.loop : loop; + var tweenEasing = locMovementData.tweenEasing; - ccs.ProcessBase.prototype.play.call(this, durationTo, durationTween, loop, tweenEasing); + if (loop < 0) { + loop = locMovementData.loop; + } else { + loop = Boolean(loop); + } + + this._onMovementList = false; + ccs.ProcessBase.prototype.play.call(this, durationTo, tweenEasing); if (this._rawDuration == 0) { this._loopType = CC_ANIMATION_TYPE_SINGLE_FRAME; @@ -279,6 +287,43 @@ ccs.ArmatureAnimation = ccs.ProcessBase.extend(/** @lends ccs.ArmatureAnimation# this._armature.update(0); }, + _playByNames: function (movementNames,durationTo, loop) { + this._movementList = []; + this._movementListLoop = loop; + this._onMovementList = true; + this._movementIndex = 0; + + for (var i = 0; i < movementNames.length; i++) { + this._movementList.push({name:movementNames[i],durationTo:durationTo}); + } + + this.updateMovementList(); + }, + + updateMovementList: function () { + if (this._onMovementList) { + if (this._movementListLoop) { + var movementObj = this._movementList[this._movementIndex]; + this.play(movementObj.name, movementObj.durationTo,0); + this._movementIndex++; + if (this._movementIndex >= this._movementList.length) { + this._movementIndex = 0; + } + } + else { + if (this._movementIndex < this._movementList.length) { + var movementObj = this._movementList[this._movementIndex]; + this.play(movementObj.name, movementObj.durationTo,0); + this._movementIndex++; + } + else { + this._onMovementList = false; + } + } + this._onMovementList = true; + } + }, + /** * Go to specified frame and play current movement. * You need first switch to the movement you want to play, then call this function. @@ -324,31 +369,46 @@ ccs.ArmatureAnimation = ccs.ProcessBase.extend(/** @lends ccs.ArmatureAnimation# /** * Play animation by index, the other param is the same to play. - * @param {Number} animationIndex + * @param {Number||Array} animationIndex * @param {Number} durationTo - * @param {Number} durationTween * @param {Number} loop - * @param {Number} tweenEasing */ - playByIndex:function (animationIndex, durationTo, durationTween, loop, tweenEasing) { + playByIndex:function (animationIndex, durationTo, loop) { + if(typeof animationIndex =="number"){ + this._playByIndex(animationIndex, durationTo, loop); + } else if(animationIndex instanceof Array){ + this._playByIndexs(animationIndex, durationTo, loop); + } + + }, + _playByIndex:function (animationIndex, durationTo, loop) { if (typeof durationTo == "undefined") { durationTo = -1; } - if (typeof durationTween == "undefined") { - durationTween = -1; - } if (typeof loop == "undefined") { loop = -1; } - if (typeof tweenEasing == "undefined") { - tweenEasing = 10000; - } var moveNames = this._animationData.movementNames; if (animationIndex < -1 || animationIndex >= moveNames.length) { return; } var animationName = moveNames[animationIndex]; - this.play(animationName, durationTo, durationTween, loop, tweenEasing); + this.play(animationName, durationTo, loop); + }, + _playByIndexs: function (movementIndexes,durationTo, loop) { + this._movementList = []; + this._movementListLoop = loop; + this._onMovementList = true; + this._movementIndex = 0; + + var movName = this._animationData.movementNames; + + for (var i = 0; i < movementIndexes.length; i++) { + var name = movName[movementIndexes[i]]; + this._movementList.push({name:name,durationTo:durationTo}); + } + + this.updateMovementList(); }, /** @@ -398,6 +458,7 @@ ccs.ArmatureAnimation = ccs.ProcessBase.extend(/** @lends ccs.ArmatureAnimation# this._isComplete = true; this._isPlaying = false; this.callMovementEvent([this._armature, ccs.MovementEventType.complete, this._movementID]); + this.updateMovementList(); break; case CC_ANIMATION_TYPE_TO_LOOP_FRONT: this._loopType = CC_ANIMATION_TYPE_LOOP_FRONT; @@ -501,7 +562,7 @@ ccs.ArmatureAnimation = ccs.ProcessBase.extend(/** @lends ccs.ArmatureAnimation# }, /** * userObject setter - * @param {Object} aniData + * @param {Object} userObject */ setUserObject:function (userObject) { this._userObject = userObject; diff --git a/extensions/CocoStudio/Armature/animation/CCProcessBase.js b/extensions/CocoStudio/Armature/animation/CCProcessBase.js index 083c3bb368..84f1d86633 100644 --- a/extensions/CocoStudio/Armature/animation/CCProcessBase.js +++ b/extensions/CocoStudio/Armature/animation/CCProcessBase.js @@ -131,36 +131,15 @@ ccs.ProcessBase = ccs.Class.extend(/** @lends ccs.ProcessBase# */{ }, /** - * play animation by animation name. + * Play the Process * @param {Number} durationTo - * he frames between two animation changing-over.It's meaning is changing to this animation need how many frames - * -1 : use the value from CCMovementData get from flash design panel - * @param {Number} durationTween he - * frame count you want to play in the game.if _durationTween is 80, then the animation will played 80 frames in a loop - * -1 : use the value from CCMovementData get from flash design panel - * @param {Number} loop - * Whether the animation is loop. - * loop < 0 : use the value from CCMovementData get from flash design panel - * loop = 0 : this animation is not loop - * loop > 0 : this animation is loop - * @param {Number} tweenEasing - * CCTween easing is used for calculate easing effect - * TWEEN_EASING_MAX : use the value from CCMovementData get from flash design panel - * -1 : fade out - * 0 : line - * 1 : fade in - * 2 : fade in and out + * @param {ccs.TweenType} tweenEasing */ - play:function (durationTo, durationTween, loop, tweenEasing) { + play:function (durationTo, tweenEasing) { this._isComplete = false; this._isPause = false; this._isPlaying = true; this._currentFrame = 0; - - /* - * Set this._nextFrameIndex to durationTo, it is used for change tween between two animation. - * When changing end, this._nextFrameIndex will be setted to _durationTween - */ this._nextFrameIndex = durationTo; this._tweenEasing = tweenEasing; }, diff --git a/extensions/CocoStudio/Armature/animation/CCTween.js b/extensions/CocoStudio/Armature/animation/CCTween.js index 0fd8be5d88..cc821cd709 100644 --- a/extensions/CocoStudio/Armature/animation/CCTween.js +++ b/extensions/CocoStudio/Armature/animation/CCTween.js @@ -74,29 +74,15 @@ ccs.Tween = ccs.ProcessBase.extend(/** @lends ccs.Tween# */{ }, /** - * play animation by animation name. - * @param {Number} animationName The animation name you want to play + * Start the Process + * @param {ccs.MovementBoneData} movementBoneData * @param {Number} durationTo - * he frames between two animation changing-over.It's meaning is changing to this animation need how many frames - * -1 : use the value from CCMovementData get from flash design panel - * @param {Number} durationTween he - * frame count you want to play in the game.if _durationTween is 80, then the animation will played 80 frames in a loop - * -1 : use the value from CCMovementData get from flash design panel - * @param {Number} loop - * Whether the animation is loop. - * loop < 0 : use the value from CCMovementData get from flash design panel - * loop = 0 : this animation is not loop - * loop > 0 : this animation is loop - * @param {Number} tweenEasing - * CCTween easing is used for calculate easing effect - * TWEEN_EASING_MAX : use the value from CCMovementData get from flash design panel - * -1 : fade out - * 0 : line - * 1 : fade in - * 2 : fade in and out + * @param {Number} durationTween + * @param {Boolean} loop + * @param {ccs.TweenType} tweenEasing */ play:function (movementBoneData, durationTo, durationTween, loop, tweenEasing) { - ccs.ProcessBase.prototype.play.call(this, durationTo, durationTween, loop, tweenEasing); + ccs.ProcessBase.prototype.play.call(this, durationTo, tweenEasing); if(loop){ this._loopType = CC_ANIMATION_TYPE_TO_LOOP_FRONT; @@ -241,6 +227,7 @@ ccs.Tween = ccs.ProcessBase.extend(/** @lends ccs.Tween# */{ * Calculate the between value of _from and _to, and give it to between frame data * @param {ccs.FrameData} from * @param {ccs.FrameData} to + * @param {Boolean} limit */ setBetween:function (from, to, limit) { if (typeof limit == "undefined") { @@ -335,7 +322,6 @@ ccs.Tween = ccs.ProcessBase.extend(/** @lends ccs.Tween# */{ /** * Calculate which frame arrived, and if current frame have event, then call the event listener * @param {Number} currentPercent - * @param {Boolean} activeFrame * @return {Number} */ updateFrameData:function (currentPercent) { From d0025556523edce4108753b853e778d62652ff78 Mon Sep 17 00:00:00 2001 From: xingsenma Date: Wed, 18 Dec 2013 16:06:42 +0800 Subject: [PATCH 04/15] issue #3419 add changeDisplayByName for bone --- extensions/CocoStudio/Armature/CCBone.js | 9 +++ .../CocoStudio/Armature/datas/CCDatas.js | 55 ++++--------------- .../Armature/display/CCDisplayFactory.js | 2 +- .../Armature/display/CCDisplayManager.js | 12 ++++ .../Armature/utils/CCDataReaderHelper.js | 2 +- 5 files changed, 33 insertions(+), 47 deletions(-) diff --git a/extensions/CocoStudio/Armature/CCBone.js b/extensions/CocoStudio/Armature/CCBone.js index 8d2308c4ef..0b9fbe604d 100644 --- a/extensions/CocoStudio/Armature/CCBone.js +++ b/extensions/CocoStudio/Armature/CCBone.js @@ -493,6 +493,15 @@ ccs.Bone = ccs.NodeRGBA.extend(/** @lends ccs.Bone# */{ this._displayManager.changeDisplayByIndex(index, force); }, + /** + * change display by name + * @param {String} name + * @param {Boolean} force + */ + changeDisplayByName:function (name, force) { + this._displayManager.changeDisplayByName(name, force); + }, + /** * get the collider body list in this bone. * @returns {*} diff --git a/extensions/CocoStudio/Armature/datas/CCDatas.js b/extensions/CocoStudio/Armature/datas/CCDatas.js index 21505a66e0..237d99d9ae 100644 --- a/extensions/CocoStudio/Armature/datas/CCDatas.js +++ b/extensions/CocoStudio/Armature/datas/CCDatas.js @@ -180,6 +180,7 @@ ccs.BaseData = ccs.Class.extend(/** @lends ccs.BaseData# */{ */ ccs.DisplayData = ccs.Class.extend(/** @lends ccs.DisplayData# */{ displayType:ccs.DisplayType.max, + displayName:"", ctor:function () { this.displayType = ccs.DisplayType.max; }, @@ -197,6 +198,14 @@ ccs.DisplayData = ccs.Class.extend(/** @lends ccs.DisplayData# */{ textureName = textureName.substring(0, startPos); } return textureName; + }, + /** + * copy data + * @param {ccs.DisplayData} displayData + */ + copy:function (displayData) { + this.displayName = displayData.displayName; + this.displayType = displayData.displayType; } }); @@ -206,27 +215,17 @@ ccs.DisplayData = ccs.Class.extend(/** @lends ccs.DisplayData# */{ * @extends ccs.DisplayData */ ccs.SpriteDisplayData = ccs.DisplayData.extend(/** @lends ccs.SpriteDisplayData# */{ - displayName:"", skinData:null, ctor:function () { - this.displayName = ""; this.skinData = new ccs.BaseData(); this.displayType = ccs.DisplayType.sprite; }, - /** - * set display name - * @param {String} displayName - */ - setParam:function (displayName) { - this.displayName = displayName; - }, /** * copy data * @param {ccs.SpriteDisplayData} displayData */ copy:function (displayData) { - this.displayName = displayData.displayName; - this.displayType = displayData.displayType; + ccs.DisplayData.prototype.copy.call(this,displayData); this.skinData = displayData.skinData; } }); @@ -241,22 +240,6 @@ ccs.ArmatureDisplayData = ccs.DisplayData.extend(/** @lends ccs.ArmatureDisplayD ctor:function () { this.displayName = ""; this.displayType = ccs.DisplayType.armature; - - }, - /** - * set display name - * @param {String} displayName - */ - setParam:function (displayName) { - this.displayName = displayName; - }, - /** - * copy data - * @param {ccs.ArmatureDisplayData} displayData - */ - copy:function (displayData) { - this.displayName = displayData.displayName; - this.displayType = displayData.displayType; } }); @@ -266,26 +249,8 @@ ccs.ArmatureDisplayData = ccs.DisplayData.extend(/** @lends ccs.ArmatureDisplayD * @extends ccs.DisplayData */ ccs.ParticleDisplayData = ccs.DisplayData.extend(/** @lends ccs.ParticleDisplayData# */{ - plist:"", ctor:function () { - this.plist = ""; this.displayType = ccs.DisplayType.particle; - - }, - /** - * set plist value - * @param {String} plist - */ - setParam:function (plist) { - this.plist = plist; - }, - /** - * copy data - * @param {ccs.ParticleDisplayData} displayData - */ - copy:function (displayData) { - this.plist = displayData.plist; - this.displayType = displayData.displayType; } }); diff --git a/extensions/CocoStudio/Armature/display/CCDisplayFactory.js b/extensions/CocoStudio/Armature/display/CCDisplayFactory.js index 7ac88ab1f2..f9d5a9e615 100644 --- a/extensions/CocoStudio/Armature/display/CCDisplayFactory.js +++ b/extensions/CocoStudio/Armature/display/CCDisplayFactory.js @@ -184,7 +184,7 @@ ccs.DisplayFactory.addParticleDisplay = function (bone, decoDisplay, displayData }; ccs.DisplayFactory.createParticleDisplay = function (bone, decoDisplay) { var displayData = decoDisplay.getDisplayData(); - var system = cc.ParticleSystem.create(displayData.plist); + var system = cc.ParticleSystem.create(displayData.displayName); var armature = bone.getArmature(); if (armature) { system.setParent(bone.getArmature()); diff --git a/extensions/CocoStudio/Armature/display/CCDisplayManager.js b/extensions/CocoStudio/Armature/display/CCDisplayManager.js index 488802d635..972f60264b 100644 --- a/extensions/CocoStudio/Armature/display/CCDisplayManager.js +++ b/extensions/CocoStudio/Armature/display/CCDisplayManager.js @@ -77,6 +77,7 @@ ccs.DisplayManager = ccs.Class.extend({ var skin = display; skin.setBone(this._bone); displayData = new ccs.SpriteDisplayData(); + displayData.displayName = skin.getDisplayName(); ccs.DisplayFactory.initSpriteDisplay(this._bone, decoDisplay, skin.getDisplayName(), skin); var spriteDisplayData = decoDisplay.getDisplayData(); if (spriteDisplayData instanceof ccs.SpriteDisplayData) @@ -86,9 +87,11 @@ ccs.DisplayManager = ccs.Class.extend({ } else if (display instanceof cc.ParticleSystem){ displayData = new ccs.ParticleDisplayData(); + displayData.displayName = display._plistFile; } else if (display instanceof ccs.Armature){ displayData = new ccs.ArmatureDisplayData(); + displayData.displayName = display.getName(); display.setParentBone(this._bone); } else { @@ -141,6 +144,15 @@ ccs.DisplayManager = ccs.Class.extend({ this.setCurrentDecorativeDisplay(decoDisplay); }, + changeDisplayByName: function (name, force) { + for (var i = 0; i < this._decoDisplayList.length; i++) { + if (this._decoDisplayList[i].getDisplayData().displayName == name) { + this.changeDisplayByIndex(i, force); + break; + } + } + }, + setCurrentDecorativeDisplay:function (decoDisplay) { var locCurrentDecoDisplay = this._currentDecoDisplay; if (ccs.ENABLE_PHYSICS_CHIPMUNK_DETECT) { diff --git a/extensions/CocoStudio/Armature/utils/CCDataReaderHelper.js b/extensions/CocoStudio/Armature/utils/CCDataReaderHelper.js index 73c03f673e..38a9ecc232 100644 --- a/extensions/CocoStudio/Armature/utils/CCDataReaderHelper.js +++ b/extensions/CocoStudio/Armature/utils/CCDataReaderHelper.js @@ -738,7 +738,7 @@ ccs.DataReaderHelper.decodeBoneDisplayFromJson = function (json, dataInfo) { break; case ccs.DisplayType.particle: displayData = new ccs.ParticleDisplayData(); - displayData.plist = dataInfo.basefilePath + json[ccs.CONST_A_PLIST] || ""; + displayData.displayName = dataInfo.basefilePath + json[ccs.CONST_A_PLIST] || ""; break; default: displayData = new ccs.SpriteDisplayData(); From e75d965e07c94706c09c10568e2aac5b6ca6de1d Mon Sep 17 00:00:00 2001 From: xingsenma Date: Wed, 18 Dec 2013 17:30:18 +0800 Subject: [PATCH 05/15] issue #3419 refactor callMovementEvent --- .../Armature/animation/CCArmatureAnimation.js | 51 ++++++++++++++----- 1 file changed, 38 insertions(+), 13 deletions(-) diff --git a/extensions/CocoStudio/Armature/animation/CCArmatureAnimation.js b/extensions/CocoStudio/Armature/animation/CCArmatureAnimation.js index e0d8be0ff3..98a7551f8f 100644 --- a/extensions/CocoStudio/Armature/animation/CCArmatureAnimation.js +++ b/extensions/CocoStudio/Armature/animation/CCArmatureAnimation.js @@ -54,6 +54,15 @@ ccs.AnimationEvent = ccs.Class.extend({ this._arguments = args; } }); +/** + * movement event + * @constructor + */ +ccs.MovementEvent = function () { + this.armature = null; + this.movementType = ""; + this.movementID = ""; +}; /** * frame event * @constructor @@ -82,6 +91,7 @@ ccs.ArmatureAnimation = ccs.ProcessBase.extend(/** @lends ccs.ArmatureAnimation# _speedScale:1, _ignoreFrameEvent:false, _frameEventQueue:null, + _movementEventQueue:null, _userObject:null, _movementList: null, _onMovementList: false, @@ -101,6 +111,7 @@ ccs.ArmatureAnimation = ccs.ProcessBase.extend(/** @lends ccs.ArmatureAnimation# this._speedScale = 1; this._ignoreFrameEvent = false; this._frameEventQueue = []; + this._movementEventQueue = []; this._userObject = null; this._movementList = []; this._onMovementList = false; @@ -253,7 +264,6 @@ ccs.ArmatureAnimation = ccs.ProcessBase.extend(/** @lends ccs.ArmatureAnimation# } else { this._loopType = CC_ANIMATION_TYPE_NO_LOOP; - this._rawDuration--; } this._durationTween = durationTween; } @@ -425,14 +435,19 @@ ccs.ArmatureAnimation = ccs.ProcessBase.extend(/** @lends ccs.ArmatureAnimation# this._tweenList[i].update(dt); } } - if (this._frameEventQueue.length > 0) { - for (var i = 0; i < this._frameEventQueue.length; i++) { - var frameEvent = this._frameEventQueue[i]; - this._ignoreFrameEvent = true; - this.callFrameEvent([frameEvent.bone, frameEvent.frameEventName, frameEvent.originFrameIndex, frameEvent.currentFrameIndex]); - this._ignoreFrameEvent = false; - } - this._frameEventQueue = []; + + var frameEvents = this._frameEventQueue; + while (frameEvents.length > 0) { + var frameEvent = frameEvents.shift(); + this._ignoreFrameEvent = true; + this.callFrameEvent([frameEvent.bone, frameEvent.frameEventName, frameEvent.originFrameIndex, frameEvent.currentFrameIndex]); + this._ignoreFrameEvent = false; + } + + var movementEvents = this._movementEventQueue; + while (movementEvents.length > 0) { + var movEvent = movementEvents.shift(); + this.callMovementEvent([movEvent.armature, movEvent.movementType, movEvent.movementID]); } }, @@ -449,7 +464,7 @@ ccs.ArmatureAnimation = ccs.ProcessBase.extend(/** @lends ccs.ArmatureAnimation# locCurrentPercent = this._currentFrame / this._durationTween; if (locCurrentPercent < 1.0) { this._nextFrameIndex = this._durationTween; - this.callMovementEvent([this._armature, ccs.MovementEventType.start, this._movementID]); + this.movementEvent(this._armature, ccs.MovementEventType.start, this._movementID); break; } case CC_ANIMATION_TYPE_MAX: @@ -457,7 +472,7 @@ ccs.ArmatureAnimation = ccs.ProcessBase.extend(/** @lends ccs.ArmatureAnimation# locCurrentPercent = 1; this._isComplete = true; this._isPlaying = false; - this.callMovementEvent([this._armature, ccs.MovementEventType.complete, this._movementID]); + this.movementEvent(this._armature, ccs.MovementEventType.complete, this._movementID); this.updateMovementList(); break; case CC_ANIMATION_TYPE_TO_LOOP_FRONT: @@ -465,13 +480,13 @@ ccs.ArmatureAnimation = ccs.ProcessBase.extend(/** @lends ccs.ArmatureAnimation# locCurrentPercent = ccs.fmodf(locCurrentPercent, 1); this._currentFrame = this._nextFrameIndex == 0 ? 0 : ccs.fmodf(this._currentFrame, this._nextFrameIndex); this._nextFrameIndex = this._durationTween > 0 ? this._durationTween : 1; - this.callMovementEvent([this, ccs.MovementEventType.start, this._movementID]); + this.movementEvent(this, ccs.MovementEventType.start, this._movementID); break; default: //locCurrentPercent = ccs.fmodf(locCurrentPercent, 1); this._currentFrame = ccs.fmodf(this._currentFrame, this._nextFrameIndex); this._toIndex = 0; - this.callMovementEvent([this._armature, ccs.MovementEventType.loopComplete, this._movementID]); + this.movementEvent(this._armature, ccs.MovementEventType.loopComplete, this._movementID); break; } this._currentPercent = locCurrentPercent; @@ -528,6 +543,16 @@ ccs.ArmatureAnimation = ccs.ProcessBase.extend(/** @lends ccs.ArmatureAnimation# } }, + movementEvent:function(armature, movementType, movementID){ + if (this._movementEvent) { + var event = new ccs.MovementEvent(); + event.armature = armature; + event.movementType = movementType; + event.movementID = movementID; + this._movementEventQueue.push(event); + } + }, + /** * @param {ccs.Bone} bone * @param {String} frameEventName From 2dc0e3913d47f55bf89443de193a8b381055ecae Mon Sep 17 00:00:00 2001 From: xingsenma Date: Thu, 19 Dec 2013 13:59:45 +0800 Subject: [PATCH 06/15] issue #3419 change update blendType --- extensions/CocoStudio/Armature/CCArmature.js | 29 ------------ extensions/CocoStudio/Armature/CCBone.js | 31 +++++++++---- .../Armature/animation/CCProcessBase.js | 4 +- .../CocoStudio/Armature/animation/CCTween.js | 8 ++-- .../CocoStudio/Armature/datas/CCDatas.js | 6 +-- .../Armature/display/CCDisplayFactory.js | 46 +++++++++---------- .../Armature/utils/CCArmatureDefine.js | 2 +- .../Armature/utils/CCDataReaderHelper.js | 36 +++++++++++++-- 8 files changed, 86 insertions(+), 76 deletions(-) diff --git a/extensions/CocoStudio/Armature/CCArmature.js b/extensions/CocoStudio/Armature/CCArmature.js index e17f2fb187..b3c9aba42c 100644 --- a/extensions/CocoStudio/Armature/CCArmature.js +++ b/extensions/CocoStudio/Armature/CCArmature.js @@ -441,35 +441,6 @@ ccs.Armature = ccs.NodeRGBA.extend(/** @lends ccs.Armature# */{ //cc.g_NumberOfDraws++; }, - /** - * update blendType - * @param {ccs.BlendType} blendType - */ - updateBlendType: function (blendType) { - var blendFunc = new cc.BlendFunc(cc.BLEND_SRC, cc.BLEND_DST); - switch (blendType) { - case ccs.BlendType.normal: - blendFunc.src = cc.BLEND_SRC; - blendFunc.dst = cc.BLEND_DST; - break; - case ccs.BlendType.add: - blendFunc.src = gl.SRC_ALPHA; - blendFunc.dst = gl.ONE; - break; - case ccs.BlendType.multiply: - blendFunc.src = gl.ONE_MINUS_SRC_ALPHA; - blendFunc.dst = gl.ONE_MINUS_DST_COLOR; - break; - case ccs.BlendType.screen: - blendFunc.src = gl.ONE; - blendFunc.dst = gl.ONE_MINUS_DST_COLOR; - break; - default: - break; - } - this.setBlendFunc(blendFunc.src, blendFunc.dst); - }, - /** * conforms to cc.TextureProtocol protocol * @param {cc.BlendFunc} blendFunc diff --git a/extensions/CocoStudio/Armature/CCBone.js b/extensions/CocoStudio/Armature/CCBone.js index 0b9fbe604d..52a60ffad9 100644 --- a/extensions/CocoStudio/Armature/CCBone.js +++ b/extensions/CocoStudio/Armature/CCBone.js @@ -40,7 +40,8 @@ ccs.Bone = ccs.NodeRGBA.extend(/** @lends ccs.Bone# */{ _parentBone:null, _boneTransformDirty:false, _worldTransform:null, - _blendType:0, + _blendFunc:0, + _blendDirty:false, _worldInfo:null, _armatureParentBone:null, _dataVersion:0, @@ -58,7 +59,8 @@ ccs.Bone = ccs.NodeRGBA.extend(/** @lends ccs.Bone# */{ this._parentBone = null; this._boneTransformDirty = true; this._worldTransform = cc.AffineTransformMake(1, 0, 0, 1, 0, 0); - this._blendType=ccs.BlendType.normal; + this._blendFunc = new cc.BlendFunc(cc.BLEND_SRC, cc.BLEND_DST); + this._blendDirty = false; }, /** @@ -606,19 +608,30 @@ ccs.Bone = ccs.NodeRGBA.extend(/** @lends ccs.Bone# */{ }, /** - * blendType setter - * @param {ccs.BlendType} blendType + * BlendFunc setter + * @param {cc.BlendFunc} blendFunc */ - setBlendType:function (blendType) { - this._blendType = blendType; + setBlendFunc:function (blendFunc) { + if (this._blendFunc.src != blendFunc.src || this._blendFunc.dst != blendFunc.dst) { + this._blendFunc = blendFunc; + this._blendDirty = true; + } }, /** * blendType getter - * @return {ccs.BlendType} + * @return {cc.BlendFunc} */ - getBlendType:function () { - return this._blendType; + getBlendFunc:function () { + return this._blendFunc; + }, + + setBlendDirty:function(dirty){ + this._blendDirty = dirty; + }, + + isBlendDirty:function(){ + return this._blendDirty; } }); diff --git a/extensions/CocoStudio/Armature/animation/CCProcessBase.js b/extensions/CocoStudio/Armature/animation/CCProcessBase.js index 84f1d86633..737f590e16 100644 --- a/extensions/CocoStudio/Armature/animation/CCProcessBase.js +++ b/extensions/CocoStudio/Armature/animation/CCProcessBase.js @@ -126,8 +126,6 @@ ccs.ProcessBase = ccs.Class.extend(/** @lends ccs.ProcessBase# */{ stop:function () { this._isComplete = true; this._isPlaying = false; - this._currentFrame = 0; - this._currentPercent = 0; }, /** @@ -206,7 +204,7 @@ ccs.ProcessBase = ccs.Class.extend(/** @lends ccs.ProcessBase# */{ * @return {Number} */ getCurrentFrameIndex:function () { - this._curFrameIndex = this._rawDuration * this._currentPercent; + this._curFrameIndex = (this._rawDuration-1) * this._currentPercent; return this._curFrameIndex; }, diff --git a/extensions/CocoStudio/Armature/animation/CCTween.js b/extensions/CocoStudio/Armature/animation/CCTween.js index cc821cd709..77aa69b05a 100644 --- a/extensions/CocoStudio/Armature/animation/CCTween.js +++ b/extensions/CocoStudio/Armature/animation/CCTween.js @@ -137,7 +137,7 @@ ccs.Tween = ccs.ProcessBase.extend(/** @lends ccs.Tween# */{ this._fromIndex = this._toIndex = 0; this._isPlaying = true; this._isComplete = this._isPause = false; - this._currentPercent = this._curFrameIndex / this._rawDuration; + this._currentPercent = this._curFrameIndex / (this._rawDuration-1); this._currentFrame = this._nextFrameIndex * this._currentPercent; }, @@ -270,7 +270,7 @@ ccs.Tween = ccs.ProcessBase.extend(/** @lends ccs.Tween# */{ } this._tweenData.zOrder = keyFrameData.zOrder; locBone.updateZOrder(); - locBone.setBlendType(keyFrameData.blendType); + locBone.setBlendFunc(keyFrameData.blendFunc); var childAramture = locBone.getChildArmature(); if (childAramture) { if (keyFrameData.movement != "") { @@ -328,7 +328,7 @@ ccs.Tween = ccs.ProcessBase.extend(/** @lends ccs.Tween# */{ if (currentPercent > 1 && this._movementBoneData.delay != 0) { currentPercent = ccs.fmodf(currentPercent,1); } - var playedTime = this._rawDuration * currentPercent; + var playedTime = (this._rawDuration-1) * currentPercent; var from, to; var locTotalDuration = this._totalDuration,locBetweenDuration = this._betweenDuration, locToIndex = this._toIndex; // if play to current frame's front or back, then find current frame again @@ -390,7 +390,7 @@ ccs.Tween = ccs.ProcessBase.extend(/** @lends ccs.Tween# */{ * if frame tween easing equal to TWEEN_EASING_MAX, then it will not do tween. */ var tweenType = (this._frameTweenEasing != ccs.TweenType.linear) ? this._frameTweenEasing : this._tweenEasing; - if (tweenType != ccs.TweenType.tweenEasingMax&&tweenType != ccs.TweenType.linear) { + if (tweenType != ccs.TweenType.tweenEasingMax&&tweenType != ccs.TweenType.linear&& !this._passLastFrame) { currentPercent = ccs.TweenFunction.tweenTo(0, 1, currentPercent, 1, tweenType); } return currentPercent; diff --git a/extensions/CocoStudio/Armature/datas/CCDatas.js b/extensions/CocoStudio/Armature/datas/CCDatas.js index 237d99d9ae..32d2da28c6 100644 --- a/extensions/CocoStudio/Armature/datas/CCDatas.js +++ b/extensions/CocoStudio/Armature/datas/CCDatas.js @@ -346,7 +346,7 @@ ccs.FrameData = ccs.BaseData.extend(/** @lends ccs.FrameData# */{ event:"", sound:"", soundEffect:"", - blendType:0, + blendFunc:0, frameID:0, isTween:true, ctor:function () { @@ -358,7 +358,7 @@ ccs.FrameData = ccs.BaseData.extend(/** @lends ccs.FrameData# */{ this.event = ""; this.sound = ""; this.soundEffect = ""; - this.blendType = ccs.BlendType.normal; + this.blendFunc = new cc.BlendFunc(cc.BLEND_SRC, cc.BLEND_DST); this.frameID = 0; this.isTween = true; }, @@ -376,7 +376,7 @@ ccs.FrameData = ccs.BaseData.extend(/** @lends ccs.FrameData# */{ this.event = frameData.event; this.sound = frameData.sound; this.soundEffect = frameData.soundEffect; - this.blendType = frameData.blendType; + this.blendFunc = frameData.blendFunc; this.isTween = frameData.isTween; } } diff --git a/extensions/CocoStudio/Armature/display/CCDisplayFactory.js b/extensions/CocoStudio/Armature/display/CCDisplayFactory.js index f9d5a9e615..da222ad2f2 100644 --- a/extensions/CocoStudio/Armature/display/CCDisplayFactory.js +++ b/extensions/CocoStudio/Armature/display/CCDisplayFactory.js @@ -59,26 +59,13 @@ ccs.DisplayFactory.updateDisplay = function (bone,dt, dirty) { if(!display) return; - if (ccs.ENABLE_PHYSICS_CHIPMUNK_DETECT) { - if (dirty) { - var decoDisplay = bone.getDisplayManager().getCurrentDecorativeDisplay(); - var detector = decoDisplay.getColliderDetector(); - if (detector&&detector.getBody()) { - var node = decoDisplay.getDisplay(); - var displayTransform = node.nodeToParentTransform(); - var anchorPoint = node.getAnchorPointInPoints(); - anchorPoint = cc.PointApplyAffineTransform(anchorPoint, displayTransform); - displayTransform.tx = anchorPoint.x; - displayTransform.ty = anchorPoint.y; - var t = cc.AffineTransformConcat(displayTransform, bone.getArmature().nodeToParentTransform()); - detector.updateTransform(t); - } - } - } switch (bone.getDisplayRenderNodeType()) { case ccs.DisplayType.sprite: if (dirty){ - display.updateBlendType(bone.getBlendType()); + if(bone.isBlendDirty()){ + display.setBlendFunc(bone.getBlendFunc()); + bone.setBlendDirty(false); + } display.updateArmatureTransform(); } break; @@ -92,6 +79,24 @@ ccs.DisplayFactory.updateDisplay = function (bone,dt, dirty) { display.setAdditionalTransform(bone.nodeToArmatureTransform()); break; } + + if (ccs.ENABLE_PHYSICS_CHIPMUNK_DETECT) { + if (dirty) { + var decoDisplay = bone.getDisplayManager().getCurrentDecorativeDisplay(); + var detector = decoDisplay.getColliderDetector(); + if (detector&&detector.getBody()) { + var node = decoDisplay.getDisplay(); + var displayTransform = node.nodeToParentTransform(); + var anchorPoint = node.getAnchorPointInPoints(); + anchorPoint = cc.PointApplyAffineTransform(anchorPoint, displayTransform); + displayTransform.tx = anchorPoint.x; + displayTransform.ty = anchorPoint.y; + var t = cc.AffineTransformConcat(displayTransform, bone.getArmature().nodeToParentTransform()); + detector.updateTransform(t); + } + } + } + }; ccs.DisplayFactory.addSpriteDisplay = function (bone, decoDisplay, displayData) { var sdp = new ccs.SpriteDisplayData(); @@ -148,13 +153,6 @@ ccs.DisplayFactory.initSpriteDisplay = function(bone, decoDisplay, displayName, decoDisplay.setColliderDetector(colliderDetector); } } -}, - -ccs.DisplayFactory.updateSpriteDisplay = function (bone, skin, dt, dirty) { - if(!dirty) - return; - skin.updateBlendType(bone.getBlendType()); - skin.updateArmatureTransform(); }; ccs.DisplayFactory.addArmatureDisplay = function (bone, decoDisplay, displayData) { diff --git a/extensions/CocoStudio/Armature/utils/CCArmatureDefine.js b/extensions/CocoStudio/Armature/utils/CCArmatureDefine.js index 84fcc71f4e..2329ecf93b 100644 --- a/extensions/CocoStudio/Armature/utils/CCArmatureDefine.js +++ b/extensions/CocoStudio/Armature/utils/CCArmatureDefine.js @@ -33,7 +33,7 @@ ccs.ENABLE_PHYSICS_CHIPMUNK_DETECT = true; ccs.ENABLE_PHYSICS_SAVE_CALCULATED_VERTEX = false; ccs.armatureVersion = function(){ - return "v1.0.0.0"; + return "v1.1.0.0"; }; cc.RESOURCE_TYPE["TEXT"].push("ExportJson"); \ No newline at end of file diff --git a/extensions/CocoStudio/Armature/utils/CCDataReaderHelper.js b/extensions/CocoStudio/Armature/utils/CCDataReaderHelper.js index 38a9ecc232..ae37a1f0c9 100644 --- a/extensions/CocoStudio/Armature/utils/CCDataReaderHelper.js +++ b/extensions/CocoStudio/Armature/utils/CCDataReaderHelper.js @@ -69,6 +69,8 @@ ccs.CONST_A_IS_ARMATURE = "isArmature"; ccs.CONST_A_DISPLAY_TYPE = "displayType"; ccs.CONST_A_MOVEMENT = "mov"; ccs.CONST_A_BLEND_TYPE = "bd"; +ccs.CONST_A_BLEND_SRC = "bd_src"; +ccs.CONST_A_BLEND_DST = "bd_dst"; ccs.CONST_A_X = "x"; ccs.CONST_A_Y = "y"; @@ -492,6 +494,29 @@ ccs.DataReaderHelper.decodeFrame = function (frameXML, parentFrameXml, boneData, frameData.movement = frameXML.getAttribute(ccs.CONST_A_MOVEMENT) || ""; frameData.event = frameXML.getAttribute(ccs.CONST_A_EVENT) || ""; frameData.blendType = parseInt(frameXML.getAttribute(ccs.CONST_A_BLEND_TYPE)) || ccs.BlendType.normal; + + var blendFunc = frameData.blendFunc; + switch (frameData.blendType) { + case ccs.BlendType.normal: + blendFunc.src = cc.BLEND_SRC; + blendFunc.dst = cc.BLEND_DST; + break; + case ccs.BlendType.add: + blendFunc.src = gl.SRC_ALPHA; + blendFunc.dst = gl.ONE; + break; + case ccs.BlendType.multiply: + blendFunc.src = gl.ONE_MINUS_SRC_ALPHA; + blendFunc.dst = gl.ONE_MINUS_DST_COLOR; + break; + case ccs.BlendType.screen: + blendFunc.src = gl.ONE; + blendFunc.dst = gl.ONE_MINUS_DST_COLOR; + break; + default: + break; + } + frameData.sound = frameXML.getAttribute(ccs.CONST_A_SOUND) || ""; frameData.soundEffect = frameXML.getAttribute(ccs.CONST_A_SOUND_EFFECT) || ""; @@ -837,7 +862,12 @@ ccs.DataReaderHelper.decodeFrameFromJson = function (json, dataInfo) { frameData.duration = json[ccs.CONST_A_DURATION] || 0; frameData.tweenEasing = json[ccs.CONST_A_TWEEN_EASING] || ccs.TweenType.linear; frameData.displayIndex = json[ccs.CONST_A_DISPLAY_INDEX] || 0; - frameData.blendType = json[ccs.CONST_A_BLEND_TYPE] || 0; + + var bd_src = json[ccs.CONST_A_BLEND_SRC] || cc.BLEND_SRC; + var bd_dst = json[ccs.CONST_A_BLEND_DST] || cc.BLEND_DST; + frameData.blendFunc.src = bd_src; + frameData.blendFunc.dst = bd_dst; + frameData.event = json[ccs.CONST_A_EVENT] || null; if(json.hasOwnProperty(ccs.CONST_A_TWEEN_FRAME)){ frameData.isTween = json[ccs.CONST_A_TWEEN_FRAME] @@ -879,8 +909,8 @@ ccs.DataReaderHelper.decodeContourFromJson = function (json) { }; ccs.DataReaderHelper.decodeNodeFromJson = function (node, json, dataInfo) { - node.x = (json[ccs.CONST_A_X] || 0) * this._positionReadScale; - node.y = (json[ccs.CONST_A_Y] || 0) * this._positionReadScale; + node.x = json[ccs.CONST_A_X] || 0 ; + node.y = json[ccs.CONST_A_Y] || 0; node.x *= dataInfo.contentScale; node.y *= dataInfo.contentScale; From 0214360509c4dde321ce5fbdcf88e029237cbb36 Mon Sep 17 00:00:00 2001 From: xingsenma Date: Thu, 19 Dec 2013 17:22:30 +0800 Subject: [PATCH 07/15] issue #3419 add calculated vertex --- extensions/CocoStudio/Armature/CCArmature.js | 17 +++++++++++ extensions/CocoStudio/Armature/CCBone.js | 2 +- .../Armature/display/CCDisplayFactory.js | 6 ++-- .../Armature/display/CCDisplayManager.js | 4 +-- .../Armature/physics/CCColliderDetector.js | 28 +++++++++++-------- .../Armature/utils/CCArmatureDefine.js | 2 +- 6 files changed, 40 insertions(+), 19 deletions(-) diff --git a/extensions/CocoStudio/Armature/CCArmature.js b/extensions/CocoStudio/Armature/CCArmature.js index b3c9aba42c..f24fe2f1a2 100644 --- a/extensions/CocoStudio/Armature/CCArmature.js +++ b/extensions/CocoStudio/Armature/CCArmature.js @@ -534,6 +534,23 @@ ccs.Armature = ccs.NodeRGBA.extend(/** @lends ccs.Armature# */{ } }, + /** + * draw contour + */ + drawContour: function () { + cc.drawingUtil.setDrawColor4B(255, 255, 255, 255); + cc.drawingUtil.setLineWidth(1); + for (var key in this._boneDic) { + var bone = this._boneDic[key]; + var bodyList = bone.getColliderBodyList(); + for (var i = 0; i < bodyList.length; i++) { + var body = bodyList[i]; + var vertexList = body.getCalculatedVertexList(); + cc.drawingUtil.drawPoly(vertexList, vertexList.length, true); + } + } + }, + /** * return parent bone * @returns {ccs.Bone} diff --git a/extensions/CocoStudio/Armature/CCBone.js b/extensions/CocoStudio/Armature/CCBone.js index 52a60ffad9..e0bcafaefe 100644 --- a/extensions/CocoStudio/Armature/CCBone.js +++ b/extensions/CocoStudio/Armature/CCBone.js @@ -516,7 +516,7 @@ ccs.Bone = ccs.NodeRGBA.extend(/** @lends ccs.Bone# */{ return detector.getColliderBodyList(); } } - return null; + return []; }, /** diff --git a/extensions/CocoStudio/Armature/display/CCDisplayFactory.js b/extensions/CocoStudio/Armature/display/CCDisplayFactory.js index da222ad2f2..a5a5803441 100644 --- a/extensions/CocoStudio/Armature/display/CCDisplayFactory.js +++ b/extensions/CocoStudio/Armature/display/CCDisplayFactory.js @@ -80,11 +80,11 @@ ccs.DisplayFactory.updateDisplay = function (bone,dt, dirty) { break; } - if (ccs.ENABLE_PHYSICS_CHIPMUNK_DETECT) { + if (ccs.ENABLE_PHYSICS_CHIPMUNK_DETECT || ccs.ENABLE_PHYSICS_SAVE_CALCULATED_VERTEX) { if (dirty) { var decoDisplay = bone.getDisplayManager().getCurrentDecorativeDisplay(); var detector = decoDisplay.getColliderDetector(); - if (detector&&detector.getBody()) { + if (detector) { var node = decoDisplay.getDisplay(); var displayTransform = node.nodeToParentTransform(); var anchorPoint = node.getAnchorPointInPoints(); @@ -146,7 +146,7 @@ ccs.DisplayFactory.initSpriteDisplay = function(bone, decoDisplay, displayName, //! Init display anchorPoint, every Texture have a anchor point skin.setAnchorPoint(cc.p(textureData.pivotX, textureData.pivotY)); } - if (ccs.ENABLE_PHYSICS_CHIPMUNK_DETECT) { + if (ccs.ENABLE_PHYSICS_CHIPMUNK_DETECT || ccs.ENABLE_PHYSICS_SAVE_CALCULATED_VERTEX) { if (textureData && textureData.contourDataList.length > 0) { var colliderDetector = ccs.ColliderDetector.create(bone); colliderDetector.addContourDataList(textureData.contourDataList); diff --git a/extensions/CocoStudio/Armature/display/CCDisplayManager.js b/extensions/CocoStudio/Armature/display/CCDisplayManager.js index 972f60264b..bbecf3e9f1 100644 --- a/extensions/CocoStudio/Armature/display/CCDisplayManager.js +++ b/extensions/CocoStudio/Armature/display/CCDisplayManager.js @@ -155,7 +155,7 @@ ccs.DisplayManager = ccs.Class.extend({ setCurrentDecorativeDisplay:function (decoDisplay) { var locCurrentDecoDisplay = this._currentDecoDisplay; - if (ccs.ENABLE_PHYSICS_CHIPMUNK_DETECT) { + if (ccs.ENABLE_PHYSICS_CHIPMUNK_DETECT || ccs.ENABLE_PHYSICS_SAVE_CALCULATED_VERTEX) { if (locCurrentDecoDisplay && locCurrentDecoDisplay.getColliderDetector()) { locCurrentDecoDisplay.getColliderDetector().setActive(false); } @@ -163,7 +163,7 @@ ccs.DisplayManager = ccs.Class.extend({ this._currentDecoDisplay = decoDisplay; locCurrentDecoDisplay = this._currentDecoDisplay; - if (ccs.ENABLE_PHYSICS_CHIPMUNK_DETECT) { + if (ccs.ENABLE_PHYSICS_CHIPMUNK_DETECT || ccs.ENABLE_PHYSICS_SAVE_CALCULATED_VERTEX) { if (locCurrentDecoDisplay && locCurrentDecoDisplay.getColliderDetector()) { locCurrentDecoDisplay.getColliderDetector().setActive(true); } diff --git a/extensions/CocoStudio/Armature/physics/CCColliderDetector.js b/extensions/CocoStudio/Armature/physics/CCColliderDetector.js index d707d671d5..024baa4ebf 100644 --- a/extensions/CocoStudio/Armature/physics/CCColliderDetector.js +++ b/extensions/CocoStudio/Armature/physics/CCColliderDetector.js @@ -261,18 +261,22 @@ ccs.ColliderDetector = ccs.Class.extend(/** @lends ccs.ColliderDetector# */{ locBody.p.x = t.tx; locBody.p.y = t.ty; locBody.p.a = t.a; - var vs = contourData.vertexList; - for (var i = 0; i < vs.length; i++) { - locHelpPoint.x = vs[i].x; - locHelpPoint.y = vs[i].y; - locHelpPoint = cc.PointApplyAffineTransform(locHelpPoint, t); - if (shape) { - var v = new cp.Vect(0, 0); - v.x = locHelpPoint.x; - v.y = locHelpPoint.y; - shape.verts[i * 2] = locHelpPoint.x - t.tx; - shape.verts[i * 2 + 1] = locHelpPoint.y - t.ty; - } + } + var vs = contourData.vertexList; + var cvs = colliderBody.getCalculatedVertexList(); + for (var i = 0; i < vs.length; i++) { + locHelpPoint.x = vs[i].x; + locHelpPoint.y = vs[i].y; + locHelpPoint = cc.PointApplyAffineTransform(locHelpPoint, t); + if (shape) { + shape.verts[i * 2] = locHelpPoint.x - t.tx; + shape.verts[i * 2 + 1] = locHelpPoint.y - t.ty; + } + if (ccs.ENABLE_PHYSICS_SAVE_CALCULATED_VERTEX) { + var v = new cp.Vect(0, 0); + v.x = locHelpPoint.x; + v.y = locHelpPoint.y; + cvs[i] = v; } } } diff --git a/extensions/CocoStudio/Armature/utils/CCArmatureDefine.js b/extensions/CocoStudio/Armature/utils/CCArmatureDefine.js index 2329ecf93b..2ec2a2538e 100644 --- a/extensions/CocoStudio/Armature/utils/CCArmatureDefine.js +++ b/extensions/CocoStudio/Armature/utils/CCArmatureDefine.js @@ -29,7 +29,7 @@ ccs.ARMATURE_MAX_CHILD = 50.0; ccs.ARMATURE_MAX_ZORDER = 100; ccs.ARMATURE_MAX_COUNT = ((ccs.MAX_VERTEXZ_VALUE) / (ccs.ARMATURE_MAX_CHILD) / ccs.ARMATURE_MAX_ZORDER); ccs.AUTO_ADD_SPRITE_FRAME_NAME_PREFIX = false; -ccs.ENABLE_PHYSICS_CHIPMUNK_DETECT = true; +ccs.ENABLE_PHYSICS_CHIPMUNK_DETECT = false; ccs.ENABLE_PHYSICS_SAVE_CALCULATED_VERTEX = false; ccs.armatureVersion = function(){ From 2272ccae90a5faac081d742da718572033692745 Mon Sep 17 00:00:00 2001 From: linshun Date: Thu, 19 Dec 2013 19:51:27 +0800 Subject: [PATCH 08/15] issue #1758: changed editbox to new folder structure --- HelloHTML5World/build.xml | 2 +- cocos2d/build.xml | 2 +- cocos2d/platform/jsloader.js | 2 +- extensions/{ => CCEditBox}/CCEditBox.js | 0 template/build.xml | 2 +- 5 files changed, 4 insertions(+), 4 deletions(-) rename extensions/{ => CCEditBox}/CCEditBox.js (100%) diff --git a/HelloHTML5World/build.xml b/HelloHTML5World/build.xml index 1fca17e336..baa2a8b220 100644 --- a/HelloHTML5World/build.xml +++ b/HelloHTML5World/build.xml @@ -159,7 +159,7 @@ - + diff --git a/cocos2d/build.xml b/cocos2d/build.xml index 813968f104..f5694f0a30 100644 --- a/cocos2d/build.xml +++ b/cocos2d/build.xml @@ -160,7 +160,7 @@ - + diff --git a/cocos2d/platform/jsloader.js b/cocos2d/platform/jsloader.js index 6a26fbe522..a4f0d87a67 100644 --- a/cocos2d/platform/jsloader.js +++ b/cocos2d/platform/jsloader.js @@ -173,7 +173,7 @@ '../extensions/CCBReader/CCBSequence.js', '../extensions/CCBReader/CCBRelativePositioning.js', '../extensions/CCBReader/CCBAnimationManager.js', - '../extensions/CCEditBox.js', + '../extensions/CCEditBox/CCEditBox.js', '../extensions/CocoStudio/CocoStudio.js', // CocoStudio Armature diff --git a/extensions/CCEditBox.js b/extensions/CCEditBox/CCEditBox.js similarity index 100% rename from extensions/CCEditBox.js rename to extensions/CCEditBox/CCEditBox.js diff --git a/template/build.xml b/template/build.xml index e6483204d9..3357e63c45 100644 --- a/template/build.xml +++ b/template/build.xml @@ -159,7 +159,7 @@ - + From 68015a3f94a9bfad466066f682a3bef1a8467d66 Mon Sep 17 00:00:00 2001 From: xingsenma Date: Thu, 19 Dec 2013 21:34:48 +0800 Subject: [PATCH 09/15] issue #3419 change tween function --- .../Armature/animation/CCArmatureAnimation.js | 20 +- .../Armature/animation/CCProcessBase.js | 2 +- .../CocoStudio/Armature/animation/CCTween.js | 2 +- .../CocoStudio/Armature/datas/CCDatas.js | 12 + .../Armature/display/CCDisplayManager.js | 18 +- .../Armature/utils/CCDataReaderHelper.js | 12 + .../Armature/utils/CCTweenFunction.js | 549 ++++++++++-------- 7 files changed, 361 insertions(+), 254 deletions(-) diff --git a/extensions/CocoStudio/Armature/animation/CCArmatureAnimation.js b/extensions/CocoStudio/Armature/animation/CCArmatureAnimation.js index 98a7551f8f..2c47fd9114 100644 --- a/extensions/CocoStudio/Armature/animation/CCArmatureAnimation.js +++ b/extensions/CocoStudio/Armature/animation/CCArmatureAnimation.js @@ -181,22 +181,6 @@ ccs.ArmatureAnimation = ccs.ProcessBase.extend(/** @lends ccs.ArmatureAnimation# return this.setSpeedScale(animationScale); }, - setAnimationInternal:function (animationInternal) { - if (animationInternal == this._animationInternal) { - return; - } - this._animationInternal = animationInternal; - - var dict = this._armature.getBoneDic(); - for (var key in dict) { - var bone = dict[key]; - bone.getTween().setAnimationInternal(this._animationInternal); - if (bone.getChildArmature()) { - bone.getChildArmature().getAnimation().setAnimationInternal(this._animationInternal); - } - } - }, - /** * play animation by animation name. * @param {String||Array} animationName The animation name you want to play @@ -282,10 +266,8 @@ ccs.ArmatureAnimation = ccs.ProcessBase.extend(/** @lends ccs.ArmatureAnimation# tween.play(movementBoneData, durationTo, durationTween, loop, tweenEasing); tween.setProcessScale(this._processScale); - tween.setAnimationInternal(this._animationInternal); if (bone.getChildArmature()) { bone.getChildArmature().getAnimation().setProcessScale(this._processScale); - bone.getChildArmature().getAnimation().setAnimationInternal(this._animationInternal); } } else { if (!bone.getIgnoreMovementBoneData()) { @@ -357,7 +339,7 @@ ccs.ArmatureAnimation = ccs.ProcessBase.extend(/** @lends ccs.ArmatureAnimation# this._isComplete = this._isPause = false; ccs.ProcessBase.prototype.gotoFrame.call(this, frameIndex); - this._currentPercent = this._curFrameIndex / this._movementData.duration; + this._currentPercent = this._curFrameIndex / (this._movementData.duration - 1); this._currentFrame = this._nextFrameIndex * this._currentPercent; for (var i = 0; i < this._tweenList.length; i++) { diff --git a/extensions/CocoStudio/Armature/animation/CCProcessBase.js b/extensions/CocoStudio/Armature/animation/CCProcessBase.js index 737f590e16..929ed6760e 100644 --- a/extensions/CocoStudio/Armature/animation/CCProcessBase.js +++ b/extensions/CocoStudio/Armature/animation/CCProcessBase.js @@ -98,7 +98,7 @@ ccs.ProcessBase = ccs.Class.extend(/** @lends ccs.ProcessBase# */{ this._rawDuration = 0; this._loopType = CC_ANIMATION_TYPE_LOOP_BACK; this._tweenEasing = ccs.TweenType.linear; - this._animationInternal = cc.Director.getInstance().getAnimationInterval(); + this._animationInternal = 1/60; this._curFrameIndex = 0; this._durationTween = 0; this._isLoopBack = false; diff --git a/extensions/CocoStudio/Armature/animation/CCTween.js b/extensions/CocoStudio/Armature/animation/CCTween.js index 77aa69b05a..dade6dda20 100644 --- a/extensions/CocoStudio/Armature/animation/CCTween.js +++ b/extensions/CocoStudio/Armature/animation/CCTween.js @@ -391,7 +391,7 @@ ccs.Tween = ccs.ProcessBase.extend(/** @lends ccs.Tween# */{ */ var tweenType = (this._frameTweenEasing != ccs.TweenType.linear) ? this._frameTweenEasing : this._tweenEasing; if (tweenType != ccs.TweenType.tweenEasingMax&&tweenType != ccs.TweenType.linear&& !this._passLastFrame) { - currentPercent = ccs.TweenFunction.tweenTo(0, 1, currentPercent, 1, tweenType); + currentPercent = ccs.TweenFunction.tweenTo(currentPercent, tweenType, this._from.easingParams); } return currentPercent; }, diff --git a/extensions/CocoStudio/Armature/datas/CCDatas.js b/extensions/CocoStudio/Armature/datas/CCDatas.js index 32d2da28c6..81097c1da8 100644 --- a/extensions/CocoStudio/Armature/datas/CCDatas.js +++ b/extensions/CocoStudio/Armature/datas/CCDatas.js @@ -341,6 +341,8 @@ ccs.ArmatureData = ccs.Class.extend(/** @lends ccs.ArmatureData# */{ ccs.FrameData = ccs.BaseData.extend(/** @lends ccs.FrameData# */{ duration:0, tweenEasing:0, + easingParamNumber: 0, + easingParams: null, displayIndex:-1, movement:"", event:"", @@ -353,6 +355,8 @@ ccs.FrameData = ccs.BaseData.extend(/** @lends ccs.FrameData# */{ ccs.BaseData.prototype.ctor.call(this); this.duration = 1; this.tweenEasing = ccs.TweenType.linear; + this.easingParamNumber = 0; + this.easingParams = []; this.displayIndex = 0; this.movement = ""; this.event = ""; @@ -378,6 +382,14 @@ ccs.FrameData = ccs.BaseData.extend(/** @lends ccs.FrameData# */{ this.soundEffect = frameData.soundEffect; this.blendFunc = frameData.blendFunc; this.isTween = frameData.isTween; + + this.easingParamNumber = frameData.easingParamNumber; + this.easingParams = []; + if (this.easingParamNumber != 0) { + for (var i = 0; i= 0; i--) { + var dd = this._decoDisplayList[i]; + var sdd = dd.getDisplayData(); + if (sdd) { + find = true; + skin.setSkinData(sdd.skinData); + displayData.skinData = sdd.skinData; + break; + } + } + if (!find) { + skin.setSkinData(new ccs.BaseData()); + } skin.setSkinData(new ccs.BaseData()); + } + } else if (display instanceof cc.ParticleSystem){ displayData = new ccs.ParticleDisplayData(); diff --git a/extensions/CocoStudio/Armature/utils/CCDataReaderHelper.js b/extensions/CocoStudio/Armature/utils/CCDataReaderHelper.js index ae37a1f0c9..9785a09178 100644 --- a/extensions/CocoStudio/Armature/utils/CCDataReaderHelper.js +++ b/extensions/CocoStudio/Armature/utils/CCDataReaderHelper.js @@ -65,6 +65,7 @@ ccs.CONST_A_SOUND = "sd"; ccs.CONST_A_SOUND_EFFECT = "sdE"; ccs.CONST_A_TWEEN_EASING = "twE"; ccs.CONST_A_TWEEN_ROTATE = "twR"; +ccs.CONST_A_EASING_PARAM = "twEP"; ccs.CONST_A_IS_ARMATURE = "isArmature"; ccs.CONST_A_DISPLAY_TYPE = "displayType"; ccs.CONST_A_MOVEMENT = "mov"; @@ -520,6 +521,10 @@ ccs.DataReaderHelper.decodeFrame = function (frameXML, parentFrameXml, boneData, frameData.sound = frameXML.getAttribute(ccs.CONST_A_SOUND) || ""; frameData.soundEffect = frameXML.getAttribute(ccs.CONST_A_SOUND_EFFECT) || ""; + var isTween = false; + isTween = frameXML.getAttribute(ccs.CONST_A_TWEEN_FRAME) || false; + frameData.isTween = Boolean(isTween); + if (dataInfo.flashToolVersion >= ccs.CONST_VERSION_2_0) { frameData.x = parseFloat(frameXML.getAttribute(ccs.CONST_A_COCOS2DX_X)) || 0; frameData.y = -parseFloat(frameXML.getAttribute(ccs.CONST_A_COCOS2DX_Y)) || 0; @@ -876,6 +881,13 @@ ccs.DataReaderHelper.decodeFrameFromJson = function (json, dataInfo) { frameData.duration = json[ccs.CONST_A_DURATION] || 0; else frameData.frameID = json[ccs.CONST_A_FRAME_INDEX] || 0; + + var twEPs = json[ccs.CONST_A_EASING_PARAM] || []; + for (var i = 0; i < twEPs.length; i++) { + var twEP = twEPs[i]; + frameData.easingParams[i] = twEP; + } + return frameData; }; diff --git a/extensions/CocoStudio/Armature/utils/CCTweenFunction.js b/extensions/CocoStudio/Armature/utils/CCTweenFunction.js index d8a6e42fac..15a71cc16f 100644 --- a/extensions/CocoStudio/Armature/utils/CCTweenFunction.js +++ b/extensions/CocoStudio/Armature/utils/CCTweenFunction.js @@ -27,350 +27,435 @@ * @type Object */ ccs.TweenType = { - tweenEasingMin:-1, - linear:0, + customEasing: -1, + linear: 0, - sineEaseIn:1, - sineEaseOut:2, - sineEaseInOut:3, + sineEaseIn: 1, + sineEaseOut: 2, + sineEaseInOut: 3, - quadEaseIn:4, - quadEaseOut:5, - quadEaseInOut:6, + quadEaseIn: 4, + quadEaseOut: 5, + quadEaseInOut: 6, - cubicEaseIn:7, - cubicEaseOut:8, - cubicEaseInOut:9, + cubicEaseIn: 7, + cubicEaseOut: 8, + cubicEaseInOut: 9, - quartEaseIn:10, - quartEaseOut:11, - quartEaseInOut:12, + quartEaseIn: 10, + quartEaseOut: 11, + quartEaseInOut: 12, - quintEaseIn:13, - quintEaseOut:14, - quintEaseInOut:15, + quintEaseIn: 13, + quintEaseOut: 14, + quintEaseInOut: 15, - expoEaseIn:16, - expoEaseOut:17, - expoEaseInOut:18, + expoEaseIn: 16, + expoEaseOut: 17, + expoEaseInOut: 18, - circEaseIn:19, - eircEaseOut:20, - circEaseInOut:21, + circEaseIn: 19, + eircEaseOut: 20, + circEaseInOut: 21, - elasticEaseIn:22, - elasticEaseOut:23, - elasticEaseInOut:24, + elasticEaseIn: 22, + elasticEaseOut: 23, + elasticEaseInOut: 24, - backEaseIn:25, - backEaseOut:26, - backEaseInOut:27, + backEaseIn: 25, + backEaseOut: 26, + backEaseInOut: 27, - bounceEaseIn:28, - bounceEaseOut:29, - bounceEaseInOut:30, + bounceEaseIn: 28, + bounceEaseOut: 29, + bounceEaseInOut: 30, - tweenEasingMax:10000 + tweenEasingMax: 10000 }; ccs.TweenFunction = ccs.TweenFunction || ccs.Class.extend({}); -ccs.TweenFunction.tweenTo = function (from, change, time, duration, tweenType) { +ccs.M_PI_X_2 = Math.PI * 2; +ccs.M_PI_2 = Math.PI / 2; +ccs.M_PI = Math.PI; + +ccs.TweenFunction.tweenTo = function (time, type, easingParam) { var delta = 0; - switch (tweenType) { + switch (type) { + case ccs.TweenType.customEasing: + delta = this.customEase(time, easingParam); + break; case ccs.TweenType.linear: - delta = this.linear(time, 0, 1, duration); + delta = this.linear(time); break; - case ccs.TweenType.sineEaseIn: - delta = this.sineEaseIn(time, 0, 1, duration); + delta = this.sineEaseIn(time); break; case ccs.TweenType.sineEaseOut: - delta = this.sineEaseOut(time, 0, 1, duration); + delta = this.sineEaseOut(time); break; case ccs.TweenType.sineEaseInOut: - delta = this.sineEaseInOut(time, 0, 1, duration); + delta = this.sineEaseInOut(time); break; case ccs.TweenType.quadEaseIn: - delta = this.quadEaseIn(time, 0, 1, duration); + delta = this.quadEaseIn(time); break; case ccs.TweenType.quadEaseOut: - delta = this.quadEaseOut(time, 0, 1, duration); + delta = this.quadEaseOut(time); break; case ccs.TweenType.quadEaseInOut: - delta = this.quadEaseInOut(time, 0, 1, duration); + delta = this.quadEaseInOut(time); break; case ccs.TweenType.cubicEaseIn: - delta = this.cubicEaseIn(time, 0, 1, duration); + delta = this.cubicEaseIn(time); break; case ccs.TweenType.cubicEaseOut: - delta = this.cubicEaseOut(time, 0, 1, duration); + delta = this.cubicEaseOut(time); break; case ccs.TweenType.cubicEaseInOut: - delta = this.cubicEaseInOut(time, 0, 1, duration); + delta = this.cubicEaseInOut(time); break; case ccs.TweenType.quartEaseIn: - delta = this.quartEaseIn(time, 0, 1, duration); + delta = this.quartEaseIn(time); break; case ccs.TweenType.quartEaseOut: - delta = this.quartEaseOut(time, 0, 1, duration); + delta = this.quartEaseOut(time); break; case ccs.TweenType.quartEaseInOut: - delta = this.quartEaseInOut(time, 0, 1, duration); + delta = this.quartEaseInOut(time); break; case ccs.TweenType.quintEaseIn: - delta = this.quintEaseIn(time, 0, 1, duration); + delta = this.quintEaseIn(time); break; case ccs.TweenType.quintEaseOut: - delta = this.quintEaseOut(time, 0, 1, duration); + delta = this.quintEaseOut(time); break; case ccs.TweenType.quintEaseInOut: - delta = this.quintEaseInOut(time, 0, 1, duration); + delta = this.quintEaseInOut(time); break; case ccs.TweenType.expoEaseIn: - delta = this.expoEaseIn(time, 0, 1, duration); + delta = this.expoEaseIn(time); break; case ccs.TweenType.expoEaseOut: - delta = this.expoEaseOut(time, 0, 1, duration); + delta = this.expoEaseOut(time); break; case ccs.TweenType.expoEaseInOut: - delta = this.expoEaseInOut(time, 0, 1, duration); + delta = this.expoEaseInOut(time); break; case ccs.TweenType.circEaseIn: - delta = this.circEaseIn(time, 0, 1, duration); + delta = this.circEaseIn(time); break; case ccs.TweenType.eircEaseOut: - delta = this.circEaseOut(time, 0, 1, duration); + delta = this.circEaseOut(time); break; case ccs.TweenType.circEaseInOut: - delta = this.circEaseInOut(time, 0, 1, duration); + delta = this.circEaseInOut(time); break; case ccs.TweenType.elasticEaseIn: - delta = this.elasticEaseIn(time, 0, 1, duration); + delta = this.elasticEaseIn(time, easingParam); break; case ccs.TweenType.elasticEaseOut: - delta = this.elasticEaseOut(time, 0, 1, duration); + delta = this.elasticEaseOut(time, easingParam); break; case ccs.TweenType.elasticEaseInOut: - delta = this.elasticEaseInOut(time, 0, 1, duration); + delta = this.elasticEaseInOut(time, easingParam); break; + case ccs.TweenType.backEaseIn: - delta = this.backEaseIn(time, 0, 1, duration); + delta = this.backEaseIn(time); break; case ccs.TweenType.backEaseOut: - delta = this.backEaseOut(time, 0, 1, duration); + delta = this.backEaseOut(time); break; case ccs.TweenType.backEaseInOut: - delta = this.backEaseInOut(time, 0, 1, duration); + delta = this.backEaseInOut(time); break; case ccs.TweenType.bounceEaseIn: - delta = this.bounceEaseIn(time, 0, 1, duration); + delta = this.bounceEaseIn(time); break; case ccs.TweenType.bounceEaseOut: - delta = this.bounceEaseOut(time, 0, 1, duration); + delta = this.bounceEaseOut(time); break; case ccs.TweenType.bounceEaseInOut: - delta = this.bounceEaseInOut(time, 0, 1, duration); + delta = this.bounceEaseInOut(time); break; default: - delta = this.sineEaseInOut(time, 0, 1, duration); + delta = this.sineEaseInOut(time); break; } return delta; }; -ccs.TweenFunction.linear = function (t, b, c, d) { - return c * t / d + b; + +// Linear +ccs.TweenFunction.linear = function (time) { + return time; +}; + + +// Sine Ease +ccs.TweenFunction.sineEaseIn = function (time) { + return -1 * Math.cos(time * ccs.M_PI_2) + 1; +}; +ccs.TweenFunction.sineEaseOut = function (time) { + return Math.sin(time * ccs.M_PI_2); +}; +ccs.TweenFunction.sineEaseInOut = function (time) { + return -0.5 * (Math.cos(ccs.M_PI * time) - 1); +}; + + +// Quad Ease +ccs.TweenFunction.quadEaseIn = function (time) { + return time * time; +}; +ccs.TweenFunction.quadEaseOut = function (time) { + return -1 * time * (time - 2); +}; +ccs.TweenFunction.quadEaseInOut = function (time) { + time = time * 2; + if (time < 1) + return 0.5 * time * time; + --time; + return -0.5 * (time * (time - 2) - 1); +}; + + +// Cubic Ease +ccs.TweenFunction.cubicEaseIn = function (time) { + return time * time * time; +}; +ccs.TweenFunction.cubicEaseOut = function (time) { + time -= 1; + return (time * time * time + 1); +}; +ccs.TweenFunction.cubicEaseInOut = function (time) { + time = time * 2; + if (time < 1) + return 0.5 * time * time * time; + time -= 2; + return 0.5 * (time * time * time + 2); +}; + + +// Quart Ease +ccs.TweenFunction.quartEaseIn = function (time) { + return time * time * time * time; +}; +ccs.TweenFunction.quartEaseOut = function (time) { + time -= 1; + return -(time * time * time * time - 1); +}; +ccs.TweenFunction.quartEaseInOut = function (time) { + time = time * 2; + if (time < 1) + return 0.5 * time * time * time * time; + time -= 2; + return -0.5 * (time * time * time * time - 2); +}; + + +// Quint Ease +ccs.TweenFunction.quintEaseIn = function (time) { + return time * time * time * time * time; +}; +ccs.TweenFunction.quintEaseOut = function (time) { + time -= 1; + return (time * time * time * time * time + 1); +}; +ccs.TweenFunction.quintEaseInOut = function (time) { + time = time * 2; + if (time < 1) + return 0.5 * time * time * time * time * time; + time -= 2; + return 0.5 * (time * time * time * time * time + 2); +}; + + +// Expo Ease +ccs.TweenFunction.expoEaseIn = function (time) { + return time == 0 ? 0 : Math.pow(2, 10 * (time - 1)) - 0.001; +}; +ccs.TweenFunction.expoEaseOut = function (time) { + return time == 1 ? 1 : (-Math.pow(2, -10 * time) + 1); +}; +ccs.TweenFunction.expoEaseInOut = function (time) { + time /= 0.5; + if (time < 1) { + time = 0.5 * Math.pow(2, 10 * (time - 1)); + } + else { + time = 0.5 * (-Math.pow(2, -10 * (time - 1)) + 2); + } + + return time; }; -ccs.TweenFunction.quadEaseIn = function (t, b, c, d) { - return c * (t /= d) * t + b; + +// Circ Ease +ccs.TweenFunction.circEaseIn = function (time) { + return -1 * (Math.sqrt(1 - time * time) - 1); }; -ccs.TweenFunction.quadEaseOut = function (t, b, c, d) { - return -c * (t /= d) * (t - 2) + b; +ccs.TweenFunction.circEaseOut = function (time) { + time = time - 1; + return Math.sqrt(1 - time * time); }; -ccs.TweenFunction.quadEaseInOut = function (t, b, c, d) { - t = t/d*2; - if (t < 1) - return c / 2 * t * t + b; - return -c / 2 * ((--t) * (t - 2) - 1) + b; +ccs.TweenFunction.circEaseInOut = function (time) { + time = time * 2; + if (time < 1) + return -0.5 * (Math.sqrt(1 - time * time) - 1); + time -= 2; + return 0.5 * (Math.sqrt(1 - time * time) + 1); +}; + + +// Elastic Ease +ccs.TweenFunction.elasticEaseIn = function (time, easingParam) { + var period = 0.3; + + if (easingParam.length > 0) { + period = easingParam[0]; + } + + var newT = 0; + if (time == 0 || time == 1) { + newT = time; + } + else { + var s = period / 4; + time = time - 1; + newT = -Math.pow(2, 10 * time) * Math.sin((time - s) * ccs.M_PI_X_2 / period); + } + + return newT; }; +ccs.TweenFunction.elasticEaseOut = function (time, easingParam) { + var period = 0.3; + + if (easingParam.length > 0) { + period = easingParam[0]; + } -ccs.TweenFunction.cubicEaseIn = function (t, b, c, d) { - return c * (t /= d) * t * t + b; + var newT = 0; + if (time == 0 || time == 1) { + newT = time; + } + else { + var s = period / 4; + newT = Math.pow(2, -10 * time) * Math.sin((time - s) * ccs.M_PI_X_2 / period) + 1; + } + + return newT; }; -ccs.TweenFunction.cubicEaseOut = function (t, b, c, d) { - return c * (( t = t / d - 1) * t * t + 1) + b; +ccs.TweenFunction.elasticEaseInOut = function (time, easingParam) { + var period = 0.3; + + if (easingParam.length > 0) { + period = easingParam[0]; + } + + var newT = 0; + if (time == 0 || time == 1) { + newT = time; + } + else { + time = time * 2; + if (!period) { + period = 0.3 * 1.5; + } + + var s = period / 4; + + time = time - 1; + if (time < 0) { + newT = -0.5 * Math.pow(2, 10 * time) * Math.sin((time - s) * ccs.M_PI_X_2 / period); + } + else { + newT = Math.pow(2, -10 * time) * Math.sin((time - s) * ccs.M_PI_X_2 / period) * 0.5 + 1; + } + } + return newT; }; -ccs.TweenFunction.cubicEaseInOut = function (t, b, c, d) { - t = t/d*2; - if (t < 1) - return c / 2 * t * t * t + b; - return c / 2 * ((t -= 2) * t * t + 2) + b; + + +// Back Ease +ccs.TweenFunction.backEaseIn = function (time) { + var overshoot = 1.70158; + return time * time * ((overshoot + 1) * time - overshoot); }; +ccs.TweenFunction.backEaseOut = function (time) { + var overshoot = 1.70158; -ccs.TweenFunction.quartEaseIn = function (t, b, c, d) { - return c * (t /= d) * t * t * t + b; + time = time - 1; + return time * time * ((overshoot + 1) * time + overshoot) + 1; }; -ccs.TweenFunction.quartEaseOut = function (t, b, c, d) { - return -c * (( t = t / d - 1) * t * t * t - 1) + b; +ccs.TweenFunction.backEaseInOut = function (time) { + var overshoot = 1.70158 * 1.525; + + time = time * 2; + if (time < 1) { + return (time * time * ((overshoot + 1) * time - overshoot)) / 2; + } + else { + time = time - 2; + return (time * time * ((overshoot + 1) * time + overshoot)) / 2 + 1; + } }; -ccs.TweenFunction.quartEaseInOut = function (t, b, c, d) { - t = t/d*2; - if (t < 1) - return c / 2 * t * t * t * t + b; - return -c / 2 * ((t -= 2) * t * t * t - 2) + b; -}; - -ccs.TweenFunction.quintEaseIn = function (t, b, c, d) { - return c * (t /= d) * t * t * t * t + b; -}; -ccs.TweenFunction.quintEaseOut = function (t, b, c, d) { - return c * (( t = t / d - 1) * t * t * t * t + 1) + b; + + +// Bounce Ease +ccs.bounceTime = function (time) { + if (time < 1 / 2.75) { + return 7.5625 * time * time; + } else if (time < 2 / 2.75) { + time -= 1.5 / 2.75; + return 7.5625 * time * time + 0.75; + } else if (time < 2.5 / 2.75) { + time -= 2.25 / 2.75; + return 7.5625 * time * time + 0.9375; + } + + time -= 2.625 / 2.75; + return 7.5625 * time * time + 0.984375; }; -ccs.TweenFunction.quintEaseInOut = function (t, b, c, d) { - t = t/d*2; - if (t < 1) - return c / 2 * t * t * t * t * t + b; - return c / 2 * ((t -= 2) * t * t * t * t + 2) + b; -}; - -ccs.TweenFunction.sineEaseIn = function (t, b, c, d) { - return -c * Math.cos(t / d * (cc.PI / 2)) + c + b; -}; -ccs.TweenFunction.sineEaseOut = function (t, b, c, d) { - return c * Math.sin(t / d * (cc.PI / 2)) + b; -}; -ccs.TweenFunction.sineEaseInOut = function (t, b, c, d) { - return -c / 2 * (Math.cos(cc.PI * t / d) - 1) + b; +ccs.TweenFunction.bounceEaseIn = function (time) { + return 1 - ccs.bounceTime(1 - time); }; -ccs.TweenFunction.expoEaseIn = function (t, b, c, d) { - return (t == 0) ? b : c * Math.pow(2, 10 * (t / d - 1)) + b; +ccs.TweenFunction.bounceEaseOut = function (time) { + return ccs.bounceTime(time); }; -ccs.TweenFunction.expoEaseOut = function (t, b, c, d) { - return (t == d) ? b + c : c * (-Math.pow(2, -10 * t / d) + 1) + b; -}; -ccs.TweenFunction.expoEaseInOut = function (t, b, c, d) { - if (t == 0) - return b; - if (t == d) - return b + c; - if ((t /= d / 2) < 1) - return c / 2 * Math.pow(2, 10 * (t - 1)) + b; - return c / 2 * (-Math.pow(2, -10 * --t) + 2) + b; -}; - -ccs.TweenFunction.circEaseIn = function (t, b, c, d) { - return -c * (Math.sqrt(1 - (t /= d) * t) - 1) + b; -}; -ccs.TweenFunction.circEaseOut = function (t, b, c, d) { - return c * Math.sqrt(1 - ( t = t / d - 1) * t) + b; -}; -ccs.TweenFunction.circEaseInOut = function (t, b, c, d) { - t = t / d * 2; - if (t < 1) - return -c / 2 * (Math.sqrt(1 - t * t) - 1) + b; - return c / 2 * (Math.sqrt(1 - (t -= 2) * t) + 1) + b; -}; - -ccs.TweenFunction.elasticEaseIn = function (t, b, c, d, a, p) { - var s = 0; - if (t == 0) - return b; - if ((t /= d) == 1) - return b + c; - if (!p) - p = d * .3; - if (!a || a < Math.abs(c)) { - a = c; - s = p / 4; - } else - s = p / (2 * cc.PI) * Math.asin(c / a); - return -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * cc.PI) / p)) + b; -}; -ccs.TweenFunction.elasticEaseOut = function (t, b, c, d, a, p) { - var s = 0; - if (t == 0) - return b; - if ((t /= d) == 1) - return b + c; - if (!p) - p = d * .3; - if (!a || a < Math.abs(c)) { - a = c; - s = p / 4; - } else - s = p / (2 * cc.PI) * Math.asin(c / a); - return (a * Math.pow(2, -10 * t) * Math.sin((t * d - s) * (2 * cc.PI) / p) + c + b); -}; -ccs.TweenFunction.elasticEaseInOut = function (t, b, c, d, a, p) { - var s = 0; - if (t == 0) - return b; - t = t / d * 2; - if (t == 2) - return b + c; - if (!p) - p = d * (.3 * 1.5); - if (!a || a < Math.abs(c)) { - a = c; - s = p / 4; - } else - s = p / (2 * cc.PI) * Math.asin(c / a); - if (t < 1) - return -.5 * (a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * cc.PI) / p)) + b; - return a * Math.pow(2, -10 * (t -= 1)) * Math.sin((t * d - s) * (2 * cc.PI) / p) * .5 + c + b; -}; - -ccs.TweenFunction.backEaseIn = function (t, b, c, d, s) { - if (s == 0) - s = 1.70158; - return c * (t /= d) * t * ((s + 1) * t - s) + b; -}; -ccs.TweenFunction.backEaseOut = function (t, b, c, d, s) { - if (s == 0) - s = 1.70158; - return c * (( t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b; -}; -ccs.TweenFunction.backEaseInOut = function (t, b, c, d, s) { - if (s == 0) - s = 1.70158; - if ((t /= d / 2) < 1) - return c / 2 * (t * t * (((s *= (1.525)) + 1) * t - s)) + b; - return c / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2) + b; -}; - -ccs.TweenFunction.bounceEaseIn = function (t, b, c, d) { - return c - this.bounceEaseOut(d - t, 0, c, d) + b; -}; - -ccs.TweenFunction.bounceEaseOut = function (t, b, c, d) { - if ((t /= d) < (1 / 2.75)) { - return c * (7.5625 * t * t) + b; - } else if (t < (2 / 2.75)) { - return c * (7.5625 * (t -= (1.5 / 2.75)) * t + .75) + b; - } else if (t < (2.5 / 2.75)) { - return c * (7.5625 * (t -= (2.25 / 2.75)) * t + .9375) + b; - } else { - return c * (7.5625 * (t -= (2.625 / 2.75)) * t + .984375) + b; + +ccs.TweenFunction.bounceEaseInOut = function (time) { + var newT = 0; + if (time < 0.5) { + time = time * 2; + newT = (1 - ccs.bounceTime(1 - time)) * 0.5; } + else { + newT = ccs.bounceTime(time * 2 - 1) * 0.5 + 0.5; + } + + return newT; }; -ccs.TweenFunction.bounceEaseInOut = function (t, b, c, d) { - if (t < d / 2) - return this.bounceEaseIn(t * 2, 0, c, d) * .5 + b; - else - return this.bounceEaseOut(t * 2 - d, 0, c, d) * .5 + c * .5 + b; + +// Custom Ease +ccs.TweenFunction.customEase = function (time, easingParam) { + if (easingParam.length > 0) { + var tt = 1 - time; + return easingParam[1] * tt * tt * tt + 3 * easingParam[3] * time * tt * tt + 3 * easingParam[5] * time * time * tt + easingParam[7] * time * time * time; + } + return time; }; \ No newline at end of file From 8a0f42bf922f27c838338148d7f5a2b5a1ac24ad Mon Sep 17 00:00:00 2001 From: xingsenma Date: Thu, 19 Dec 2013 21:59:03 +0800 Subject: [PATCH 10/15] issue #3419 set default value for isTween --- extensions/CocoStudio/Armature/utils/CCDataReaderHelper.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/extensions/CocoStudio/Armature/utils/CCDataReaderHelper.js b/extensions/CocoStudio/Armature/utils/CCDataReaderHelper.js index 9785a09178..6f4ae52194 100644 --- a/extensions/CocoStudio/Armature/utils/CCDataReaderHelper.js +++ b/extensions/CocoStudio/Armature/utils/CCDataReaderHelper.js @@ -521,8 +521,7 @@ ccs.DataReaderHelper.decodeFrame = function (frameXML, parentFrameXml, boneData, frameData.sound = frameXML.getAttribute(ccs.CONST_A_SOUND) || ""; frameData.soundEffect = frameXML.getAttribute(ccs.CONST_A_SOUND_EFFECT) || ""; - var isTween = false; - isTween = frameXML.getAttribute(ccs.CONST_A_TWEEN_FRAME) || false; + var isTween = frameXML.getAttribute(ccs.CONST_A_TWEEN_FRAME) || true; frameData.isTween = Boolean(isTween); if (dataInfo.flashToolVersion >= ccs.CONST_VERSION_2_0) { From 28af3ded4b23a726df221e2950bc5be3f65a5967 Mon Sep 17 00:00:00 2001 From: linshun Date: Fri, 20 Dec 2013 09:19:32 +0800 Subject: [PATCH 11/15] issue #1758: Adjusted folder structure for NPM. --- .../{actions => actions3d}/CCActionGrid.js | 0 .../{actions => actions3d}/CCActionGrid3D.js | 0 .../CCActionPageTurn3D.js | 0 .../CCActionTiledGrid.js | 0 cocos2d/{ => cocos}/CCCamera.js | 0 cocos2d/{ => cocos}/CCConfiguration.js | 0 cocos2d/{ => cocos}/CCDirector.js | 0 cocos2d/{ => cocos}/CCLoader.js | 0 cocos2d/{ => cocos}/CCScheduler.js | 0 cocos2d/{ => cocos}/base_nodes/CCAtlasNode.js | 0 cocos2d/{ => cocos}/base_nodes/CCNode.js | 0 cocos2d/{ => cocos}/base_nodes/CCdomNode.js | 0 .../{ => cocos}/cocoa/CCAffineTransform.js | 0 cocos2d/{ => cocos}/cocoa/CCGeometry.js | 0 cocos2d/{ => cocos}/cocoa/CCNS.js | 0 .../layers_nodes}/CCLayer.js | 0 cocos2d/{ => cocos}/platform/AppControl.js | 0 .../{ => cocos}/platform/CCAccelerometer.js | 0 cocos2d/{ => cocos}/platform/CCApplication.js | 0 cocos2d/{ => cocos}/platform/CCClass.js | 0 cocos2d/{ => cocos}/platform/CCCommon.js | 0 cocos2d/{ => cocos}/platform/CCConfig.js | 0 cocos2d/{ => cocos}/platform/CCEGLView.js | 0 cocos2d/{ => cocos}/platform/CCFileUtils.js | 0 cocos2d/{ => cocos}/platform/CCImage.js | 0 cocos2d/{ => cocos}/platform/CCMacro.js | 0 cocos2d/{ => cocos}/platform/CCSAXParser.js | 0 cocos2d/{ => cocos}/platform/CCScreen.js | 0 cocos2d/{ => cocos}/platform/CCTypes.js | 0 cocos2d/{ => cocos}/platform/CCVisibleRect.js | 0 cocos2d/{ => cocos}/platform/Sys.js | 0 cocos2d/{ => cocos}/platform/ZipUtils.js | 0 cocos2d/{ => cocos}/platform/base64.js | 0 cocos2d/{ => cocos}/platform/gzip.js | 0 cocos2d/{ => cocos}/platform/miniFramework.js | 0 cocos2d/{ => cocos}/platform/zlib.min.js | 0 .../scenes_nodes}/CCScene.js | 0 .../{ => cocos}/sprite_nodes/CCAnimation.js | 0 .../sprite_nodes/CCAnimationCache.js | 0 cocos2d/{ => cocos}/sprite_nodes/CCSprite.js | 0 .../sprite_nodes/CCSpriteBatchNode.js | 0 .../{ => cocos}/sprite_nodes/CCSpriteFrame.js | 0 .../sprite_nodes/CCSpriteFrameCache.js | 0 .../support/CCNotificationCenter.js | 0 cocos2d/{ => cocos}/support/CCPNGReader.js | 0 .../{ => cocos}/support/CCPointExtension.js | 0 cocos2d/{ => cocos}/support/CCTGAlib.js | 0 cocos2d/{ => cocos}/support/CCTIFFReader.js | 0 cocos2d/{ => cocos}/support/CCUserDefault.js | 0 cocos2d/{ => cocos}/support/CCVertex.js | 0 cocos2d/{ => cocos}/support/TransformUtils.js | 0 .../support/component/CCComponent.js | 0 .../support/component/CCComponentContainer.js | 0 cocos2d/{ => cocos}/textures/CCTexture2D.js | 0 .../{ => cocos}/textures/CCTextureAtlas.js | 0 .../{ => cocos}/textures/CCTextureCache.js | 0 .../CCParallaxNode.js | 0 cocos2d/platform/jsloader.js | 342 ------------------ .../CCActionProgressTimer.js | 0 .../CCProgressTimer.js | 0 .../CCTMXLayer.js | 0 .../CCTMXObjectGroup.js | 0 .../CCTMXTiledMap.js | 0 .../CCTMXXMLParser.js | 0 .../CCTileMapAtlas.js | 0 .../CCTransition.js | 0 .../CCTransitionPageTurn.js | 0 .../CCTransitionProgress.js | 0 68 files changed, 342 deletions(-) rename cocos2d/{actions => actions3d}/CCActionGrid.js (100%) rename cocos2d/{actions => actions3d}/CCActionGrid3D.js (100%) rename cocos2d/{actions => actions3d}/CCActionPageTurn3D.js (100%) rename cocos2d/{actions => actions3d}/CCActionTiledGrid.js (100%) rename cocos2d/{ => cocos}/CCCamera.js (100%) rename cocos2d/{ => cocos}/CCConfiguration.js (100%) rename cocos2d/{ => cocos}/CCDirector.js (100%) rename cocos2d/{ => cocos}/CCLoader.js (100%) rename cocos2d/{ => cocos}/CCScheduler.js (100%) rename cocos2d/{ => cocos}/base_nodes/CCAtlasNode.js (100%) rename cocos2d/{ => cocos}/base_nodes/CCNode.js (100%) rename cocos2d/{ => cocos}/base_nodes/CCdomNode.js (100%) rename cocos2d/{ => cocos}/cocoa/CCAffineTransform.js (100%) rename cocos2d/{ => cocos}/cocoa/CCGeometry.js (100%) rename cocos2d/{ => cocos}/cocoa/CCNS.js (100%) rename cocos2d/{layers_scenes_transitions_nodes => cocos/layers_nodes}/CCLayer.js (100%) rename cocos2d/{ => cocos}/platform/AppControl.js (100%) rename cocos2d/{ => cocos}/platform/CCAccelerometer.js (100%) rename cocos2d/{ => cocos}/platform/CCApplication.js (100%) rename cocos2d/{ => cocos}/platform/CCClass.js (100%) rename cocos2d/{ => cocos}/platform/CCCommon.js (100%) rename cocos2d/{ => cocos}/platform/CCConfig.js (100%) rename cocos2d/{ => cocos}/platform/CCEGLView.js (100%) rename cocos2d/{ => cocos}/platform/CCFileUtils.js (100%) rename cocos2d/{ => cocos}/platform/CCImage.js (100%) rename cocos2d/{ => cocos}/platform/CCMacro.js (100%) rename cocos2d/{ => cocos}/platform/CCSAXParser.js (100%) rename cocos2d/{ => cocos}/platform/CCScreen.js (100%) rename cocos2d/{ => cocos}/platform/CCTypes.js (100%) rename cocos2d/{ => cocos}/platform/CCVisibleRect.js (100%) rename cocos2d/{ => cocos}/platform/Sys.js (100%) rename cocos2d/{ => cocos}/platform/ZipUtils.js (100%) rename cocos2d/{ => cocos}/platform/base64.js (100%) rename cocos2d/{ => cocos}/platform/gzip.js (100%) rename cocos2d/{ => cocos}/platform/miniFramework.js (100%) rename cocos2d/{ => cocos}/platform/zlib.min.js (100%) rename cocos2d/{layers_scenes_transitions_nodes => cocos/scenes_nodes}/CCScene.js (100%) rename cocos2d/{ => cocos}/sprite_nodes/CCAnimation.js (100%) rename cocos2d/{ => cocos}/sprite_nodes/CCAnimationCache.js (100%) rename cocos2d/{ => cocos}/sprite_nodes/CCSprite.js (100%) rename cocos2d/{ => cocos}/sprite_nodes/CCSpriteBatchNode.js (100%) rename cocos2d/{ => cocos}/sprite_nodes/CCSpriteFrame.js (100%) rename cocos2d/{ => cocos}/sprite_nodes/CCSpriteFrameCache.js (100%) rename cocos2d/{ => cocos}/support/CCNotificationCenter.js (100%) rename cocos2d/{ => cocos}/support/CCPNGReader.js (100%) rename cocos2d/{ => cocos}/support/CCPointExtension.js (100%) rename cocos2d/{ => cocos}/support/CCTGAlib.js (100%) rename cocos2d/{ => cocos}/support/CCTIFFReader.js (100%) rename cocos2d/{ => cocos}/support/CCUserDefault.js (100%) rename cocos2d/{ => cocos}/support/CCVertex.js (100%) rename cocos2d/{ => cocos}/support/TransformUtils.js (100%) rename cocos2d/{ => cocos}/support/component/CCComponent.js (100%) rename cocos2d/{ => cocos}/support/component/CCComponentContainer.js (100%) rename cocos2d/{ => cocos}/textures/CCTexture2D.js (100%) rename cocos2d/{ => cocos}/textures/CCTextureAtlas.js (100%) rename cocos2d/{ => cocos}/textures/CCTextureCache.js (100%) rename cocos2d/{tileMap_parallax_nodes => parallax_nodes}/CCParallaxNode.js (100%) delete mode 100644 cocos2d/platform/jsloader.js rename cocos2d/{actions => progress_timer}/CCActionProgressTimer.js (100%) rename cocos2d/{misc_nodes => progress_timer}/CCProgressTimer.js (100%) rename cocos2d/{tileMap_parallax_nodes => tileMap_nodes}/CCTMXLayer.js (100%) rename cocos2d/{tileMap_parallax_nodes => tileMap_nodes}/CCTMXObjectGroup.js (100%) rename cocos2d/{tileMap_parallax_nodes => tileMap_nodes}/CCTMXTiledMap.js (100%) rename cocos2d/{tileMap_parallax_nodes => tileMap_nodes}/CCTMXXMLParser.js (100%) rename cocos2d/{tileMap_parallax_nodes => tileMap_nodes}/CCTileMapAtlas.js (100%) rename cocos2d/{layers_scenes_transitions_nodes => transitions_nodes}/CCTransition.js (100%) rename cocos2d/{layers_scenes_transitions_nodes => transitions_nodes}/CCTransitionPageTurn.js (100%) rename cocos2d/{layers_scenes_transitions_nodes => transitions_nodes}/CCTransitionProgress.js (100%) diff --git a/cocos2d/actions/CCActionGrid.js b/cocos2d/actions3d/CCActionGrid.js similarity index 100% rename from cocos2d/actions/CCActionGrid.js rename to cocos2d/actions3d/CCActionGrid.js diff --git a/cocos2d/actions/CCActionGrid3D.js b/cocos2d/actions3d/CCActionGrid3D.js similarity index 100% rename from cocos2d/actions/CCActionGrid3D.js rename to cocos2d/actions3d/CCActionGrid3D.js diff --git a/cocos2d/actions/CCActionPageTurn3D.js b/cocos2d/actions3d/CCActionPageTurn3D.js similarity index 100% rename from cocos2d/actions/CCActionPageTurn3D.js rename to cocos2d/actions3d/CCActionPageTurn3D.js diff --git a/cocos2d/actions/CCActionTiledGrid.js b/cocos2d/actions3d/CCActionTiledGrid.js similarity index 100% rename from cocos2d/actions/CCActionTiledGrid.js rename to cocos2d/actions3d/CCActionTiledGrid.js diff --git a/cocos2d/CCCamera.js b/cocos2d/cocos/CCCamera.js similarity index 100% rename from cocos2d/CCCamera.js rename to cocos2d/cocos/CCCamera.js diff --git a/cocos2d/CCConfiguration.js b/cocos2d/cocos/CCConfiguration.js similarity index 100% rename from cocos2d/CCConfiguration.js rename to cocos2d/cocos/CCConfiguration.js diff --git a/cocos2d/CCDirector.js b/cocos2d/cocos/CCDirector.js similarity index 100% rename from cocos2d/CCDirector.js rename to cocos2d/cocos/CCDirector.js diff --git a/cocos2d/CCLoader.js b/cocos2d/cocos/CCLoader.js similarity index 100% rename from cocos2d/CCLoader.js rename to cocos2d/cocos/CCLoader.js diff --git a/cocos2d/CCScheduler.js b/cocos2d/cocos/CCScheduler.js similarity index 100% rename from cocos2d/CCScheduler.js rename to cocos2d/cocos/CCScheduler.js diff --git a/cocos2d/base_nodes/CCAtlasNode.js b/cocos2d/cocos/base_nodes/CCAtlasNode.js similarity index 100% rename from cocos2d/base_nodes/CCAtlasNode.js rename to cocos2d/cocos/base_nodes/CCAtlasNode.js diff --git a/cocos2d/base_nodes/CCNode.js b/cocos2d/cocos/base_nodes/CCNode.js similarity index 100% rename from cocos2d/base_nodes/CCNode.js rename to cocos2d/cocos/base_nodes/CCNode.js diff --git a/cocos2d/base_nodes/CCdomNode.js b/cocos2d/cocos/base_nodes/CCdomNode.js similarity index 100% rename from cocos2d/base_nodes/CCdomNode.js rename to cocos2d/cocos/base_nodes/CCdomNode.js diff --git a/cocos2d/cocoa/CCAffineTransform.js b/cocos2d/cocos/cocoa/CCAffineTransform.js similarity index 100% rename from cocos2d/cocoa/CCAffineTransform.js rename to cocos2d/cocos/cocoa/CCAffineTransform.js diff --git a/cocos2d/cocoa/CCGeometry.js b/cocos2d/cocos/cocoa/CCGeometry.js similarity index 100% rename from cocos2d/cocoa/CCGeometry.js rename to cocos2d/cocos/cocoa/CCGeometry.js diff --git a/cocos2d/cocoa/CCNS.js b/cocos2d/cocos/cocoa/CCNS.js similarity index 100% rename from cocos2d/cocoa/CCNS.js rename to cocos2d/cocos/cocoa/CCNS.js diff --git a/cocos2d/layers_scenes_transitions_nodes/CCLayer.js b/cocos2d/cocos/layers_nodes/CCLayer.js similarity index 100% rename from cocos2d/layers_scenes_transitions_nodes/CCLayer.js rename to cocos2d/cocos/layers_nodes/CCLayer.js diff --git a/cocos2d/platform/AppControl.js b/cocos2d/cocos/platform/AppControl.js similarity index 100% rename from cocos2d/platform/AppControl.js rename to cocos2d/cocos/platform/AppControl.js diff --git a/cocos2d/platform/CCAccelerometer.js b/cocos2d/cocos/platform/CCAccelerometer.js similarity index 100% rename from cocos2d/platform/CCAccelerometer.js rename to cocos2d/cocos/platform/CCAccelerometer.js diff --git a/cocos2d/platform/CCApplication.js b/cocos2d/cocos/platform/CCApplication.js similarity index 100% rename from cocos2d/platform/CCApplication.js rename to cocos2d/cocos/platform/CCApplication.js diff --git a/cocos2d/platform/CCClass.js b/cocos2d/cocos/platform/CCClass.js similarity index 100% rename from cocos2d/platform/CCClass.js rename to cocos2d/cocos/platform/CCClass.js diff --git a/cocos2d/platform/CCCommon.js b/cocos2d/cocos/platform/CCCommon.js similarity index 100% rename from cocos2d/platform/CCCommon.js rename to cocos2d/cocos/platform/CCCommon.js diff --git a/cocos2d/platform/CCConfig.js b/cocos2d/cocos/platform/CCConfig.js similarity index 100% rename from cocos2d/platform/CCConfig.js rename to cocos2d/cocos/platform/CCConfig.js diff --git a/cocos2d/platform/CCEGLView.js b/cocos2d/cocos/platform/CCEGLView.js similarity index 100% rename from cocos2d/platform/CCEGLView.js rename to cocos2d/cocos/platform/CCEGLView.js diff --git a/cocos2d/platform/CCFileUtils.js b/cocos2d/cocos/platform/CCFileUtils.js similarity index 100% rename from cocos2d/platform/CCFileUtils.js rename to cocos2d/cocos/platform/CCFileUtils.js diff --git a/cocos2d/platform/CCImage.js b/cocos2d/cocos/platform/CCImage.js similarity index 100% rename from cocos2d/platform/CCImage.js rename to cocos2d/cocos/platform/CCImage.js diff --git a/cocos2d/platform/CCMacro.js b/cocos2d/cocos/platform/CCMacro.js similarity index 100% rename from cocos2d/platform/CCMacro.js rename to cocos2d/cocos/platform/CCMacro.js diff --git a/cocos2d/platform/CCSAXParser.js b/cocos2d/cocos/platform/CCSAXParser.js similarity index 100% rename from cocos2d/platform/CCSAXParser.js rename to cocos2d/cocos/platform/CCSAXParser.js diff --git a/cocos2d/platform/CCScreen.js b/cocos2d/cocos/platform/CCScreen.js similarity index 100% rename from cocos2d/platform/CCScreen.js rename to cocos2d/cocos/platform/CCScreen.js diff --git a/cocos2d/platform/CCTypes.js b/cocos2d/cocos/platform/CCTypes.js similarity index 100% rename from cocos2d/platform/CCTypes.js rename to cocos2d/cocos/platform/CCTypes.js diff --git a/cocos2d/platform/CCVisibleRect.js b/cocos2d/cocos/platform/CCVisibleRect.js similarity index 100% rename from cocos2d/platform/CCVisibleRect.js rename to cocos2d/cocos/platform/CCVisibleRect.js diff --git a/cocos2d/platform/Sys.js b/cocos2d/cocos/platform/Sys.js similarity index 100% rename from cocos2d/platform/Sys.js rename to cocos2d/cocos/platform/Sys.js diff --git a/cocos2d/platform/ZipUtils.js b/cocos2d/cocos/platform/ZipUtils.js similarity index 100% rename from cocos2d/platform/ZipUtils.js rename to cocos2d/cocos/platform/ZipUtils.js diff --git a/cocos2d/platform/base64.js b/cocos2d/cocos/platform/base64.js similarity index 100% rename from cocos2d/platform/base64.js rename to cocos2d/cocos/platform/base64.js diff --git a/cocos2d/platform/gzip.js b/cocos2d/cocos/platform/gzip.js similarity index 100% rename from cocos2d/platform/gzip.js rename to cocos2d/cocos/platform/gzip.js diff --git a/cocos2d/platform/miniFramework.js b/cocos2d/cocos/platform/miniFramework.js similarity index 100% rename from cocos2d/platform/miniFramework.js rename to cocos2d/cocos/platform/miniFramework.js diff --git a/cocos2d/platform/zlib.min.js b/cocos2d/cocos/platform/zlib.min.js similarity index 100% rename from cocos2d/platform/zlib.min.js rename to cocos2d/cocos/platform/zlib.min.js diff --git a/cocos2d/layers_scenes_transitions_nodes/CCScene.js b/cocos2d/cocos/scenes_nodes/CCScene.js similarity index 100% rename from cocos2d/layers_scenes_transitions_nodes/CCScene.js rename to cocos2d/cocos/scenes_nodes/CCScene.js diff --git a/cocos2d/sprite_nodes/CCAnimation.js b/cocos2d/cocos/sprite_nodes/CCAnimation.js similarity index 100% rename from cocos2d/sprite_nodes/CCAnimation.js rename to cocos2d/cocos/sprite_nodes/CCAnimation.js diff --git a/cocos2d/sprite_nodes/CCAnimationCache.js b/cocos2d/cocos/sprite_nodes/CCAnimationCache.js similarity index 100% rename from cocos2d/sprite_nodes/CCAnimationCache.js rename to cocos2d/cocos/sprite_nodes/CCAnimationCache.js diff --git a/cocos2d/sprite_nodes/CCSprite.js b/cocos2d/cocos/sprite_nodes/CCSprite.js similarity index 100% rename from cocos2d/sprite_nodes/CCSprite.js rename to cocos2d/cocos/sprite_nodes/CCSprite.js diff --git a/cocos2d/sprite_nodes/CCSpriteBatchNode.js b/cocos2d/cocos/sprite_nodes/CCSpriteBatchNode.js similarity index 100% rename from cocos2d/sprite_nodes/CCSpriteBatchNode.js rename to cocos2d/cocos/sprite_nodes/CCSpriteBatchNode.js diff --git a/cocos2d/sprite_nodes/CCSpriteFrame.js b/cocos2d/cocos/sprite_nodes/CCSpriteFrame.js similarity index 100% rename from cocos2d/sprite_nodes/CCSpriteFrame.js rename to cocos2d/cocos/sprite_nodes/CCSpriteFrame.js diff --git a/cocos2d/sprite_nodes/CCSpriteFrameCache.js b/cocos2d/cocos/sprite_nodes/CCSpriteFrameCache.js similarity index 100% rename from cocos2d/sprite_nodes/CCSpriteFrameCache.js rename to cocos2d/cocos/sprite_nodes/CCSpriteFrameCache.js diff --git a/cocos2d/support/CCNotificationCenter.js b/cocos2d/cocos/support/CCNotificationCenter.js similarity index 100% rename from cocos2d/support/CCNotificationCenter.js rename to cocos2d/cocos/support/CCNotificationCenter.js diff --git a/cocos2d/support/CCPNGReader.js b/cocos2d/cocos/support/CCPNGReader.js similarity index 100% rename from cocos2d/support/CCPNGReader.js rename to cocos2d/cocos/support/CCPNGReader.js diff --git a/cocos2d/support/CCPointExtension.js b/cocos2d/cocos/support/CCPointExtension.js similarity index 100% rename from cocos2d/support/CCPointExtension.js rename to cocos2d/cocos/support/CCPointExtension.js diff --git a/cocos2d/support/CCTGAlib.js b/cocos2d/cocos/support/CCTGAlib.js similarity index 100% rename from cocos2d/support/CCTGAlib.js rename to cocos2d/cocos/support/CCTGAlib.js diff --git a/cocos2d/support/CCTIFFReader.js b/cocos2d/cocos/support/CCTIFFReader.js similarity index 100% rename from cocos2d/support/CCTIFFReader.js rename to cocos2d/cocos/support/CCTIFFReader.js diff --git a/cocos2d/support/CCUserDefault.js b/cocos2d/cocos/support/CCUserDefault.js similarity index 100% rename from cocos2d/support/CCUserDefault.js rename to cocos2d/cocos/support/CCUserDefault.js diff --git a/cocos2d/support/CCVertex.js b/cocos2d/cocos/support/CCVertex.js similarity index 100% rename from cocos2d/support/CCVertex.js rename to cocos2d/cocos/support/CCVertex.js diff --git a/cocos2d/support/TransformUtils.js b/cocos2d/cocos/support/TransformUtils.js similarity index 100% rename from cocos2d/support/TransformUtils.js rename to cocos2d/cocos/support/TransformUtils.js diff --git a/cocos2d/support/component/CCComponent.js b/cocos2d/cocos/support/component/CCComponent.js similarity index 100% rename from cocos2d/support/component/CCComponent.js rename to cocos2d/cocos/support/component/CCComponent.js diff --git a/cocos2d/support/component/CCComponentContainer.js b/cocos2d/cocos/support/component/CCComponentContainer.js similarity index 100% rename from cocos2d/support/component/CCComponentContainer.js rename to cocos2d/cocos/support/component/CCComponentContainer.js diff --git a/cocos2d/textures/CCTexture2D.js b/cocos2d/cocos/textures/CCTexture2D.js similarity index 100% rename from cocos2d/textures/CCTexture2D.js rename to cocos2d/cocos/textures/CCTexture2D.js diff --git a/cocos2d/textures/CCTextureAtlas.js b/cocos2d/cocos/textures/CCTextureAtlas.js similarity index 100% rename from cocos2d/textures/CCTextureAtlas.js rename to cocos2d/cocos/textures/CCTextureAtlas.js diff --git a/cocos2d/textures/CCTextureCache.js b/cocos2d/cocos/textures/CCTextureCache.js similarity index 100% rename from cocos2d/textures/CCTextureCache.js rename to cocos2d/cocos/textures/CCTextureCache.js diff --git a/cocos2d/tileMap_parallax_nodes/CCParallaxNode.js b/cocos2d/parallax_nodes/CCParallaxNode.js similarity index 100% rename from cocos2d/tileMap_parallax_nodes/CCParallaxNode.js rename to cocos2d/parallax_nodes/CCParallaxNode.js diff --git a/cocos2d/platform/jsloader.js b/cocos2d/platform/jsloader.js deleted file mode 100644 index a4f0d87a67..0000000000 --- a/cocos2d/platform/jsloader.js +++ /dev/null @@ -1,342 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010-2012 cocos2d-x.org - Copyright (c) 2008-2010 Ricardo Quesada - Copyright (c) 2011 Zynga Inc. - - http://www.cocos2d-x.org - - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ -(function () { - var engine = [ - 'platform/CCClass.js', - 'cocoa/CCGeometry.js', - 'platform/Sys.js', - 'platform/CCConfig.js', - 'platform/miniFramework.js', - 'platform/CCCommon.js', - 'platform/ZipUtils.js', - 'platform/base64.js', - 'platform/gzip.js', - 'platform/CCMacro.js', - 'platform/CCFileUtils.js', - 'platform/CCTypes.js', - 'platform/CCAccelerometer.js', - 'platform/zlib.min.js', - 'platform/CCEGLView.js', - 'platform/CCImage.js', - 'platform/CCScreen.js', - 'platform/CCVisibleRect.js', - 'kazmath/utility.js', - 'kazmath/vec2.js', - 'kazmath/vec3.js', - 'kazmath/vec4.js', - 'kazmath/ray2.js', - 'kazmath/mat3.js', - 'kazmath/mat4.js', - 'kazmath/plane.js', - 'kazmath/quaternion.js', - 'kazmath/aabb.js', - 'kazmath/GL/mat4stack.js', - 'kazmath/GL/matrix.js', - 'cocoa/CCNS.js', - 'cocoa/CCAffineTransform.js', - 'support/CCPointExtension.js', - 'support/CCUserDefault.js', - 'support/CCVertex.js', - 'support/TransformUtils.js', - 'support/CCTGAlib.js', - 'support/CCPNGReader.js', - 'support/CCTIFFReader.js', - 'support/component/CCComponent.js', - 'support/component/CCComponentContainer.js', - 'shaders/CCShaders.js', - 'shaders/CCShaderCache.js', - 'shaders/CCGLProgram.js', - 'shaders/CCGLStateCache.js', - 'base_nodes/CCNode.js', - 'base_nodes/CCAtlasNode.js', - 'textures/CCTexture2D.js', - 'textures/CCTextureCache.js', - 'textures/CCTextureAtlas.js', - 'misc_nodes/CCRenderTexture.js', - 'misc_nodes/CCProgressTimer.js', - 'misc_nodes/CCMotionStreak.js', - 'misc_nodes/CCClippingNode.js', - 'effects/CCGrid.js', - 'effects/CCGrabber.js', - 'draw_nodes/CCDrawNode.js', - 'actions/CCAction.js', - 'actions/CCActionInterval.js', - 'actions/CCActionInstant.js', - 'actions/CCActionManager.js', - 'actions/CCActionProgressTimer.js', - 'actions/CCActionCamera.js', - 'actions/CCActionEase.js', - 'actions/CCActionGrid.js', - 'actions/CCActionGrid3D.js', - 'actions/CCActionTiledGrid.js', - 'actions/CCActionCatmullRom.js', - 'actions/CCActionPageTurn3D.js', - 'actions/CCActionTween.js', - 'layers_scenes_transitions_nodes/CCScene.js', - 'layers_scenes_transitions_nodes/CCLayer.js', - 'layers_scenes_transitions_nodes/CCTransition.js', - 'layers_scenes_transitions_nodes/CCTransitionProgress.js', - 'layers_scenes_transitions_nodes/CCTransitionPageTurn.js', - 'sprite_nodes/CCSprite.js', - 'sprite_nodes/CCAnimation.js', - 'sprite_nodes/CCAnimationCache.js', - 'sprite_nodes/CCSpriteFrame.js', - 'sprite_nodes/CCSpriteFrameCache.js', - 'sprite_nodes/CCSpriteBatchNode.js', - 'label_nodes/CCLabelAtlas.js', - 'label_nodes/CCLabelTTF.js', - 'label_nodes/CCLabelBMFont.js', - 'particle_nodes/CCParticleSystem.js', - 'particle_nodes/CCParticleExamples.js', - 'particle_nodes/CCParticleBatchNode.js', - 'touch_dispatcher/CCTouchDelegateProtocol.js', - 'touch_dispatcher/CCTouchHandler.js', - 'touch_dispatcher/CCTouchDispatcher.js', - 'touch_dispatcher/CCMouseDispatcher.js', - 'keyboard_dispatcher/CCKeyboardDelegate.js', - 'keyboard_dispatcher/CCKeyboardDispatcher.js', - 'text_input_node/CCIMEDispatcher.js', - 'text_input_node/CCTextFieldTTF.js', - 'CCConfiguration.js', - 'CCDirector.js', - 'CCCamera.js', - 'CCScheduler.js', - 'CCLoader.js', - 'CCDrawingPrimitives.js', - 'platform/CCApplication.js', - 'platform/CCSAXParser.js', - 'platform/AppControl.js', - 'menu_nodes/CCMenuItem.js', - 'menu_nodes/CCMenu.js', - 'tileMap_parallax_nodes/CCTMXTiledMap.js', - 'tileMap_parallax_nodes/CCTMXXMLParser.js', - 'tileMap_parallax_nodes/CCTMXObjectGroup.js', - 'tileMap_parallax_nodes/CCTMXLayer.js', - 'tileMap_parallax_nodes/CCParallaxNode.js', - 'base_nodes/CCdomNode.js', - '../CocosDenshion/SimpleAudioEngine.js' - ]; - - var d = document; - var c = d["ccConfig"]; - - if (c.loadExtension != null && c.loadExtension == true) { - engine = engine.concat([ - '../extensions/GUI/CCControlExtension/CCControl.js', - '../extensions/GUI/CCControlExtension/CCControlButton.js', - '../extensions/GUI/CCControlExtension/CCControlUtils.js', - '../extensions/GUI/CCControlExtension/CCInvocation.js', - '../extensions/GUI/CCControlExtension/CCScale9Sprite.js', - '../extensions/GUI/CCControlExtension/CCMenuPassive.js', - '../extensions/GUI/CCControlExtension/CCControlSaturationBrightnessPicker.js', - '../extensions/GUI/CCControlExtension/CCControlHuePicker.js', - '../extensions/GUI/CCControlExtension/CCControlColourPicker.js', - '../extensions/GUI/CCControlExtension/CCControlSlider.js', - '../extensions/GUI/CCControlExtension/CCControlSwitch.js', - '../extensions/GUI/CCControlExtension/CCControlStepper.js', - '../extensions/GUI/CCControlExtension/CCControlPotentiometer.js', - '../extensions/GUI/CCScrollView/CCScrollView.js', - '../extensions/GUI/CCScrollView/CCSorting.js', - '../extensions/GUI/CCScrollView/CCTableView.js', - '../extensions/CCBReader/CCNodeLoader.js', - '../extensions/CCBReader/CCBReaderUtil.js', - '../extensions/CCBReader/CCControlLoader.js', - '../extensions/CCBReader/CCSpriteLoader.js', - '../extensions/CCBReader/CCNodeLoaderLibrary.js', - '../extensions/CCBReader/CCBReader.js', - '../extensions/CCBReader/CCBValue.js', - '../extensions/CCBReader/CCBKeyframe.js', - '../extensions/CCBReader/CCBSequence.js', - '../extensions/CCBReader/CCBRelativePositioning.js', - '../extensions/CCBReader/CCBAnimationManager.js', - '../extensions/CCEditBox/CCEditBox.js', - - '../extensions/CocoStudio/CocoStudio.js', - // CocoStudio Armature - '../extensions/CocoStudio/Armature/utils/CCArmatureDefine.js', - '../extensions/CocoStudio/Armature/utils/CCDataReaderHelper.js', - '../extensions/CocoStudio/Armature/utils/CCSpriteFrameCacheHelper.js', - '../extensions/CocoStudio/Armature/utils/CCTransformHelp.js', - '../extensions/CocoStudio/Armature/utils/CCTweenFunction.js', - '../extensions/CocoStudio/Armature/utils/CCUtilMath.js', - '../extensions/CocoStudio/Armature/utils/CCArmatureDataManager.js', - '../extensions/CocoStudio/Armature/datas/CCDatas.js', - '../extensions/CocoStudio/Armature/display/CCDecorativeDisplay.js', - '../extensions/CocoStudio/Armature/display/CCDisplayFactory.js', - '../extensions/CocoStudio/Armature/display/CCDisplayManager.js', - '../extensions/CocoStudio/Armature/display/CCSkin.js', - '../extensions/CocoStudio/Armature/animation/CCProcessBase.js', - '../extensions/CocoStudio/Armature/animation/CCArmatureAnimation.js', - '../extensions/CocoStudio/Armature/animation/CCTween.js', - '../extensions/CocoStudio/Armature/physics/CCColliderDetector.js', - '../extensions/CocoStudio/Armature/CCArmature.js', - '../extensions/CocoStudio/Armature/CCBone.js', - // CocoStudio Action - '../extensions/CocoStudio/Action/CCActionFrame.js', - '../extensions/CocoStudio/Action/CCActionManager.js', - '../extensions/CocoStudio/Action/CCActionNode.js', - '../extensions/CocoStudio/Action/CCActionObject.js', - // CocoStudio Components - '../extensions/CocoStudio/Components/CCComAttribute.js', - '../extensions/CocoStudio/Components/CCComAudio.js', - '../extensions/CocoStudio/Components/CCComController.js', - '../extensions/CocoStudio/Components/CCComRender.js', - // CocoStudio GUI - '../extensions/CocoStudio/GUI/BaseClasses/UIWidget.js', - '../extensions/CocoStudio/GUI/Layouts/UILayout.js', - '../extensions/CocoStudio/GUI/BaseClasses/UIRootWidget.js', - '../extensions/CocoStudio/GUI/Layouts/UILayoutParameter.js', - '../extensions/CocoStudio/GUI/Layouts/UILayoutDefine.js', - '../extensions/CocoStudio/GUI/System/CocosGUI.js', - '../extensions/CocoStudio/GUI/System/UIHelper.js', - '../extensions/CocoStudio/GUI/System/UIInputManager.js', - '../extensions/CocoStudio/GUI/System/UILayer.js', - '../extensions/CocoStudio/GUI/UIWidgets/UIButton.js', - '../extensions/CocoStudio/GUI/UIWidgets/UICheckBox.js', - '../extensions/CocoStudio/GUI/UIWidgets/UIImageView.js', - '../extensions/CocoStudio/GUI/UIWidgets/UILabel.js', - '../extensions/CocoStudio/GUI/UIWidgets/UILabelAtlas.js', - '../extensions/CocoStudio/GUI/UIWidgets/UILabelBMFont.js', - '../extensions/CocoStudio/GUI/UIWidgets/UILoadingBar.js', - '../extensions/CocoStudio/GUI/UIWidgets/UISlider.js', - '../extensions/CocoStudio/GUI/UIWidgets/UISwitch.js', - '../extensions/CocoStudio/GUI/UIWidgets/UITextField.js', - '../extensions/CocoStudio/GUI/UIWidgets/Compatible/CompatibleClasses.js', - '../extensions/CocoStudio/GUI/UIWidgets/ScrollWidget/UIScrollView.js', - '../extensions/CocoStudio/GUI/UIWidgets/ScrollWidget/UIListView.js', - '../extensions/CocoStudio/GUI/UIWidgets/ScrollWidget/UIPageView.js', - '../extensions/CocoStudio/GUI/UIWidgets/ScrollWidget/UIScrollInterface.js', - '../extensions/CocoStudio/Reader/GUIReader.js', - '../extensions/CocoStudio/Reader/SceneReader.js' - - ]); - } - - if (c.loadPluginx != null && c.loadPluginx == true) { - engine = engine.concat([ - //protocols - '../extensions/PluginX/protocols/Config.js', - '../extensions/PluginX/protocols/PluginUtils.js', - '../extensions/PluginX/protocols/PluginProtocol.js', - '../extensions/PluginX/protocols/ProtocolSocial.js', - //'../extensions/PluginX/protocols/ProtocolAds.js', - //'../extensions/PluginX/protocols/ProtocolAnalytics.js', - //'../extensions/PluginX/protocols/ProtocolIAP.js', - '../extensions/PluginX/protocols/PluginFactory.js', - '../extensions/PluginX/protocols/PluginManager.js', - - //plugins - '../extensions/PluginX/plugins/SocialWeibo.js', - '../extensions/PluginX/plugins/SocialQQWeibo.js', - '../extensions/PluginX/plugins/SocialQzone.js', - '../extensions/PluginX/plugins/SocialTwitter.js', - '../extensions/PluginX/plugins/SocialFacebook.js' - //'../extensions/PluginX/plugins/AdsGoogle.js' - ]); - } - - if (!c.engineDir) { - engine = []; - } - else { - if(c.box2d || c.chipmunk){ - engine.push('physics_nodes/CCPhysicsSprite.js'); - engine.push('physics_nodes/CCPhysicsDebugNode.js'); - if (c.box2d === true) - engine.push('../box2d/box2d.js'); - if (c.chipmunk === true) - engine.push('../chipmunk/chipmunk.js'); - } - engine.forEach(function (e, i) { - engine[i] = c.engineDir + e; - }); - } - if (typeof c.box2d === "string") { - engine.push(c.box2d); - } - if (typeof c.chipmunk === "string") { - engine.push(c.chipmunk); - } - - var loadJsImg = document.getElementById("cocos2d_loadJsImg"); - if(!loadJsImg){ - loadJsImg = document.createElement('img'); - loadJsImg.src = "data:image/gif;base64,R0lGODlhEAAQALMNAD8/P7+/vyoqKlVVVX9/fxUVFUBAQGBgYMDAwC8vL5CQkP///wAAAP///wAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQFAAANACwAAAAAEAAQAAAEO5DJSau9OOvNex0IMnDIsiCkiW6g6BmKYlBFkhSUEgQKlQCARG6nEBwOgl+QApMdCIRD7YZ5RjlGpCUCACH5BAUAAA0ALAAAAgAOAA4AAAQ6kLGB0JA4M7QW0hrngRllkYyhKAYqKUGguAws0ypLS8JxCLQDgXAIDg+FRKIA6v0SAECCBpXSkstMBAAh+QQFAAANACwAAAAACgAQAAAEOJDJORAac6K1kDSKYmydpASBUl0mqmRfaGTCcQgwcxDEke+9XO2WkxQSiUIuAQAkls0n7JgsWq8RACH5BAUAAA0ALAAAAAAOAA4AAAQ6kMlplDIzTxWC0oxwHALnDQgySAdBHNWFLAvCukc215JIZihVIZEogDIJACBxnCSXTcmwGK1ar1hrBAAh+QQFAAANACwAAAAAEAAKAAAEN5DJKc4RM+tDyNFTkSQF5xmKYmQJACTVpQSBwrpJNteZSGYoFWjIGCAQA2IGsVgglBOmEyoxIiMAIfkEBQAADQAsAgAAAA4ADgAABDmQSVZSKjPPBEDSGucJxyGA1XUQxAFma/tOpDlnhqIYN6MEAUXvF+zldrMBAjHoIRYLhBMqvSmZkggAIfkEBQAADQAsBgAAAAoAEAAABDeQyUmrnSWlYhMASfeFVbZdjHAcgnUQxOHCcqWylKEohqUEAYVkgEAMfkEJYrFA6HhKJsJCNFoiACH5BAUAAA0ALAIAAgAOAA4AAAQ3kMlJq704611SKloCAEk4lln3DQgyUMJxCBKyLAh1EMRR3wiDQmHY9SQslyIQUMRmlmVTIyRaIgA7"; - - var canvasNode = document.getElementById(c.tag); - canvasNode.style.backgroundColor = "black"; - canvasNode.parentNode.appendChild(loadJsImg); - - var canvasStyle = getComputedStyle?getComputedStyle(canvasNode):canvasNode.currentStyle; - loadJsImg.style.left = canvasNode.offsetLeft + (parseFloat(canvasStyle.width) - loadJsImg.width)/2 + "px"; - loadJsImg.style.top = canvasNode.offsetTop + (parseFloat(canvasStyle.height) - loadJsImg.height)/2 + "px"; - loadJsImg.style.position = "absolute"; - } - - var updateLoading = function(p){ - if(p>=1) { - loadJsImg.parentNode.removeChild(loadJsImg); - } - }; - - var loaded = 0; - var que = engine.concat(c.appFiles); - que.push('main.js'); - - if (navigator.userAgent.indexOf("Trident/5") > -1) { - //ie9 - var i = -1; - var loadNext = function () { - i++; - if (i < que.length) { - var f = d.createElement('script'); - f.src = que[i]; - f.addEventListener('load',function(){ - loadNext(); - updateLoading(loaded / que.length); - this.removeEventListener('load', arguments.callee, false); - },false); - d.body.appendChild(f); - } - updateLoading(i / (que.length - 1)); - }; - loadNext(); - } - else { - que.forEach(function (f, i) { - var s = d.createElement('script'); - s.async = false; - s.src = f; - s.addEventListener('load',function(){ - loaded++; - updateLoading(loaded / que.length); - this.removeEventListener('load', arguments.callee, false); - },false); - d.body.appendChild(s); - }); - } -})(); diff --git a/cocos2d/actions/CCActionProgressTimer.js b/cocos2d/progress_timer/CCActionProgressTimer.js similarity index 100% rename from cocos2d/actions/CCActionProgressTimer.js rename to cocos2d/progress_timer/CCActionProgressTimer.js diff --git a/cocos2d/misc_nodes/CCProgressTimer.js b/cocos2d/progress_timer/CCProgressTimer.js similarity index 100% rename from cocos2d/misc_nodes/CCProgressTimer.js rename to cocos2d/progress_timer/CCProgressTimer.js diff --git a/cocos2d/tileMap_parallax_nodes/CCTMXLayer.js b/cocos2d/tileMap_nodes/CCTMXLayer.js similarity index 100% rename from cocos2d/tileMap_parallax_nodes/CCTMXLayer.js rename to cocos2d/tileMap_nodes/CCTMXLayer.js diff --git a/cocos2d/tileMap_parallax_nodes/CCTMXObjectGroup.js b/cocos2d/tileMap_nodes/CCTMXObjectGroup.js similarity index 100% rename from cocos2d/tileMap_parallax_nodes/CCTMXObjectGroup.js rename to cocos2d/tileMap_nodes/CCTMXObjectGroup.js diff --git a/cocos2d/tileMap_parallax_nodes/CCTMXTiledMap.js b/cocos2d/tileMap_nodes/CCTMXTiledMap.js similarity index 100% rename from cocos2d/tileMap_parallax_nodes/CCTMXTiledMap.js rename to cocos2d/tileMap_nodes/CCTMXTiledMap.js diff --git a/cocos2d/tileMap_parallax_nodes/CCTMXXMLParser.js b/cocos2d/tileMap_nodes/CCTMXXMLParser.js similarity index 100% rename from cocos2d/tileMap_parallax_nodes/CCTMXXMLParser.js rename to cocos2d/tileMap_nodes/CCTMXXMLParser.js diff --git a/cocos2d/tileMap_parallax_nodes/CCTileMapAtlas.js b/cocos2d/tileMap_nodes/CCTileMapAtlas.js similarity index 100% rename from cocos2d/tileMap_parallax_nodes/CCTileMapAtlas.js rename to cocos2d/tileMap_nodes/CCTileMapAtlas.js diff --git a/cocos2d/layers_scenes_transitions_nodes/CCTransition.js b/cocos2d/transitions_nodes/CCTransition.js similarity index 100% rename from cocos2d/layers_scenes_transitions_nodes/CCTransition.js rename to cocos2d/transitions_nodes/CCTransition.js diff --git a/cocos2d/layers_scenes_transitions_nodes/CCTransitionPageTurn.js b/cocos2d/transitions_nodes/CCTransitionPageTurn.js similarity index 100% rename from cocos2d/layers_scenes_transitions_nodes/CCTransitionPageTurn.js rename to cocos2d/transitions_nodes/CCTransitionPageTurn.js diff --git a/cocos2d/layers_scenes_transitions_nodes/CCTransitionProgress.js b/cocos2d/transitions_nodes/CCTransitionProgress.js similarity index 100% rename from cocos2d/layers_scenes_transitions_nodes/CCTransitionProgress.js rename to cocos2d/transitions_nodes/CCTransitionProgress.js From 134b17b4f1d874f50e84c78cd0aac137c8e9e860 Mon Sep 17 00:00:00 2001 From: linshun Date: Fri, 20 Dec 2013 11:59:06 +0800 Subject: [PATCH 12/15] issue #1758: adjusted core and modules folder structure. --- HelloHTML5World/cocos2d.js | 2 +- cocos2d/{cocos/platform => }/CCImage.js | 0 .../support => }/CCNotificationCenter.js | 0 cocos2d/{cocos/support => }/CCUserDefault.js | 0 .../CCAccelerometer.js | 0 .../{cocos/platform => compress}/ZipUtils.js | 0 .../{cocos/platform => compress}/base64.js | 0 cocos2d/{cocos/platform => compress}/gzip.js | 0 .../{cocos/platform => compress}/zlib.min.js | 0 cocos2d/{cocos => core}/CCCamera.js | 0 cocos2d/{cocos => core}/CCConfiguration.js | 0 cocos2d/{cocos => core}/CCDirector.js | 0 cocos2d/{cocos => core}/CCLoader.js | 0 cocos2d/{cocos => core}/CCScheduler.js | 0 .../{cocos => core}/base_nodes/CCAtlasNode.js | 0 cocos2d/{cocos => core}/base_nodes/CCNode.js | 0 .../cocoa/CCAffineTransform.js | 0 cocos2d/{cocos => core}/cocoa/CCGeometry.js | 0 cocos2d/{cocos => core}/cocoa/CCNS.js | 0 .../{cocos => core}/layers_nodes/CCLayer.js | 0 .../{cocos => core}/platform/AppControl.js | 0 .../{cocos => core}/platform/CCApplication.js | 0 cocos2d/{cocos => core}/platform/CCClass.js | 0 cocos2d/{cocos => core}/platform/CCCommon.js | 0 cocos2d/{cocos => core}/platform/CCConfig.js | 0 cocos2d/{cocos => core}/platform/CCEGLView.js | 0 .../{cocos => core}/platform/CCFileUtils.js | 0 cocos2d/{cocos => core}/platform/CCMacro.js | 0 .../{cocos => core}/platform/CCSAXParser.js | 0 cocos2d/{cocos => core}/platform/CCScreen.js | 0 cocos2d/{cocos => core}/platform/CCTypes.js | 0 .../{cocos => core}/platform/CCVisibleRect.js | 0 cocos2d/{cocos => core}/platform/Sys.js | 0 .../{cocos => core}/platform/miniFramework.js | 0 .../{cocos => core}/scenes_nodes/CCScene.js | 0 .../sprite_nodes/CCAnimation.js | 0 .../sprite_nodes/CCAnimationCache.js | 0 .../{cocos => core}/sprite_nodes/CCSprite.js | 0 .../sprite_nodes/CCSpriteBatchNode.js | 0 .../sprite_nodes/CCSpriteFrame.js | 0 .../sprite_nodes/CCSpriteFrameCache.js | 0 .../support/CCPointExtension.js | 0 cocos2d/{cocos => core}/support/CCVertex.js | 0 .../{cocos => core}/support/TransformUtils.js | 0 .../{cocos => core}/textures/CCTexture2D.js | 0 .../textures/CCTextureAtlas.js | 0 .../textures/CCTextureCache.js | 0 cocos2d/jsloader.js | 342 ++++++++++++++++++ .../support => particle_nodes}/CCPNGReader.js | 0 .../CCTIFFReader.js | 0 .../support => tileMap_nodes}/CCTGAlib.js | 0 .../CCEditBox}/CCdomNode.js | 0 .../CocoStudio/Components}/CCComponent.js | 0 .../Components}/CCComponentContainer.js | 0 template/cocos2d.js | 2 +- 55 files changed, 344 insertions(+), 2 deletions(-) rename cocos2d/{cocos/platform => }/CCImage.js (100%) rename cocos2d/{cocos/support => }/CCNotificationCenter.js (100%) rename cocos2d/{cocos/support => }/CCUserDefault.js (100%) rename cocos2d/{cocos/platform => accelerometer}/CCAccelerometer.js (100%) rename cocos2d/{cocos/platform => compress}/ZipUtils.js (100%) rename cocos2d/{cocos/platform => compress}/base64.js (100%) rename cocos2d/{cocos/platform => compress}/gzip.js (100%) rename cocos2d/{cocos/platform => compress}/zlib.min.js (100%) rename cocos2d/{cocos => core}/CCCamera.js (100%) rename cocos2d/{cocos => core}/CCConfiguration.js (100%) rename cocos2d/{cocos => core}/CCDirector.js (100%) rename cocos2d/{cocos => core}/CCLoader.js (100%) rename cocos2d/{cocos => core}/CCScheduler.js (100%) rename cocos2d/{cocos => core}/base_nodes/CCAtlasNode.js (100%) rename cocos2d/{cocos => core}/base_nodes/CCNode.js (100%) rename cocos2d/{cocos => core}/cocoa/CCAffineTransform.js (100%) rename cocos2d/{cocos => core}/cocoa/CCGeometry.js (100%) rename cocos2d/{cocos => core}/cocoa/CCNS.js (100%) rename cocos2d/{cocos => core}/layers_nodes/CCLayer.js (100%) rename cocos2d/{cocos => core}/platform/AppControl.js (100%) rename cocos2d/{cocos => core}/platform/CCApplication.js (100%) rename cocos2d/{cocos => core}/platform/CCClass.js (100%) rename cocos2d/{cocos => core}/platform/CCCommon.js (100%) rename cocos2d/{cocos => core}/platform/CCConfig.js (100%) rename cocos2d/{cocos => core}/platform/CCEGLView.js (100%) rename cocos2d/{cocos => core}/platform/CCFileUtils.js (100%) rename cocos2d/{cocos => core}/platform/CCMacro.js (100%) rename cocos2d/{cocos => core}/platform/CCSAXParser.js (100%) rename cocos2d/{cocos => core}/platform/CCScreen.js (100%) rename cocos2d/{cocos => core}/platform/CCTypes.js (100%) rename cocos2d/{cocos => core}/platform/CCVisibleRect.js (100%) rename cocos2d/{cocos => core}/platform/Sys.js (100%) rename cocos2d/{cocos => core}/platform/miniFramework.js (100%) rename cocos2d/{cocos => core}/scenes_nodes/CCScene.js (100%) rename cocos2d/{cocos => core}/sprite_nodes/CCAnimation.js (100%) rename cocos2d/{cocos => core}/sprite_nodes/CCAnimationCache.js (100%) rename cocos2d/{cocos => core}/sprite_nodes/CCSprite.js (100%) rename cocos2d/{cocos => core}/sprite_nodes/CCSpriteBatchNode.js (100%) rename cocos2d/{cocos => core}/sprite_nodes/CCSpriteFrame.js (100%) rename cocos2d/{cocos => core}/sprite_nodes/CCSpriteFrameCache.js (100%) rename cocos2d/{cocos => core}/support/CCPointExtension.js (100%) rename cocos2d/{cocos => core}/support/CCVertex.js (100%) rename cocos2d/{cocos => core}/support/TransformUtils.js (100%) rename cocos2d/{cocos => core}/textures/CCTexture2D.js (100%) rename cocos2d/{cocos => core}/textures/CCTextureAtlas.js (100%) rename cocos2d/{cocos => core}/textures/CCTextureCache.js (100%) create mode 100644 cocos2d/jsloader.js rename cocos2d/{cocos/support => particle_nodes}/CCPNGReader.js (100%) rename cocos2d/{cocos/support => particle_nodes}/CCTIFFReader.js (100%) rename cocos2d/{cocos/support => tileMap_nodes}/CCTGAlib.js (100%) rename {cocos2d/cocos/base_nodes => extensions/CCEditBox}/CCdomNode.js (100%) rename {cocos2d/cocos/support/component => extensions/CocoStudio/Components}/CCComponent.js (100%) rename {cocos2d/cocos/support/component => extensions/CocoStudio/Components}/CCComponentContainer.js (100%) diff --git a/HelloHTML5World/cocos2d.js b/HelloHTML5World/cocos2d.js index 1078929fcd..bba31a16fd 100644 --- a/HelloHTML5World/cocos2d.js +++ b/HelloHTML5World/cocos2d.js @@ -66,7 +66,7 @@ s.src = c.SingleEngineFile; } else if (c.engineDir && !c.SingleEngineFile) { - s.src = c.engineDir + 'platform/jsloader.js'; + s.src = c.engineDir + 'jsloader.js'; } else { alert('You must specify either the single engine file OR the engine directory in "cocos2d.js"'); diff --git a/cocos2d/cocos/platform/CCImage.js b/cocos2d/CCImage.js similarity index 100% rename from cocos2d/cocos/platform/CCImage.js rename to cocos2d/CCImage.js diff --git a/cocos2d/cocos/support/CCNotificationCenter.js b/cocos2d/CCNotificationCenter.js similarity index 100% rename from cocos2d/cocos/support/CCNotificationCenter.js rename to cocos2d/CCNotificationCenter.js diff --git a/cocos2d/cocos/support/CCUserDefault.js b/cocos2d/CCUserDefault.js similarity index 100% rename from cocos2d/cocos/support/CCUserDefault.js rename to cocos2d/CCUserDefault.js diff --git a/cocos2d/cocos/platform/CCAccelerometer.js b/cocos2d/accelerometer/CCAccelerometer.js similarity index 100% rename from cocos2d/cocos/platform/CCAccelerometer.js rename to cocos2d/accelerometer/CCAccelerometer.js diff --git a/cocos2d/cocos/platform/ZipUtils.js b/cocos2d/compress/ZipUtils.js similarity index 100% rename from cocos2d/cocos/platform/ZipUtils.js rename to cocos2d/compress/ZipUtils.js diff --git a/cocos2d/cocos/platform/base64.js b/cocos2d/compress/base64.js similarity index 100% rename from cocos2d/cocos/platform/base64.js rename to cocos2d/compress/base64.js diff --git a/cocos2d/cocos/platform/gzip.js b/cocos2d/compress/gzip.js similarity index 100% rename from cocos2d/cocos/platform/gzip.js rename to cocos2d/compress/gzip.js diff --git a/cocos2d/cocos/platform/zlib.min.js b/cocos2d/compress/zlib.min.js similarity index 100% rename from cocos2d/cocos/platform/zlib.min.js rename to cocos2d/compress/zlib.min.js diff --git a/cocos2d/cocos/CCCamera.js b/cocos2d/core/CCCamera.js similarity index 100% rename from cocos2d/cocos/CCCamera.js rename to cocos2d/core/CCCamera.js diff --git a/cocos2d/cocos/CCConfiguration.js b/cocos2d/core/CCConfiguration.js similarity index 100% rename from cocos2d/cocos/CCConfiguration.js rename to cocos2d/core/CCConfiguration.js diff --git a/cocos2d/cocos/CCDirector.js b/cocos2d/core/CCDirector.js similarity index 100% rename from cocos2d/cocos/CCDirector.js rename to cocos2d/core/CCDirector.js diff --git a/cocos2d/cocos/CCLoader.js b/cocos2d/core/CCLoader.js similarity index 100% rename from cocos2d/cocos/CCLoader.js rename to cocos2d/core/CCLoader.js diff --git a/cocos2d/cocos/CCScheduler.js b/cocos2d/core/CCScheduler.js similarity index 100% rename from cocos2d/cocos/CCScheduler.js rename to cocos2d/core/CCScheduler.js diff --git a/cocos2d/cocos/base_nodes/CCAtlasNode.js b/cocos2d/core/base_nodes/CCAtlasNode.js similarity index 100% rename from cocos2d/cocos/base_nodes/CCAtlasNode.js rename to cocos2d/core/base_nodes/CCAtlasNode.js diff --git a/cocos2d/cocos/base_nodes/CCNode.js b/cocos2d/core/base_nodes/CCNode.js similarity index 100% rename from cocos2d/cocos/base_nodes/CCNode.js rename to cocos2d/core/base_nodes/CCNode.js diff --git a/cocos2d/cocos/cocoa/CCAffineTransform.js b/cocos2d/core/cocoa/CCAffineTransform.js similarity index 100% rename from cocos2d/cocos/cocoa/CCAffineTransform.js rename to cocos2d/core/cocoa/CCAffineTransform.js diff --git a/cocos2d/cocos/cocoa/CCGeometry.js b/cocos2d/core/cocoa/CCGeometry.js similarity index 100% rename from cocos2d/cocos/cocoa/CCGeometry.js rename to cocos2d/core/cocoa/CCGeometry.js diff --git a/cocos2d/cocos/cocoa/CCNS.js b/cocos2d/core/cocoa/CCNS.js similarity index 100% rename from cocos2d/cocos/cocoa/CCNS.js rename to cocos2d/core/cocoa/CCNS.js diff --git a/cocos2d/cocos/layers_nodes/CCLayer.js b/cocos2d/core/layers_nodes/CCLayer.js similarity index 100% rename from cocos2d/cocos/layers_nodes/CCLayer.js rename to cocos2d/core/layers_nodes/CCLayer.js diff --git a/cocos2d/cocos/platform/AppControl.js b/cocos2d/core/platform/AppControl.js similarity index 100% rename from cocos2d/cocos/platform/AppControl.js rename to cocos2d/core/platform/AppControl.js diff --git a/cocos2d/cocos/platform/CCApplication.js b/cocos2d/core/platform/CCApplication.js similarity index 100% rename from cocos2d/cocos/platform/CCApplication.js rename to cocos2d/core/platform/CCApplication.js diff --git a/cocos2d/cocos/platform/CCClass.js b/cocos2d/core/platform/CCClass.js similarity index 100% rename from cocos2d/cocos/platform/CCClass.js rename to cocos2d/core/platform/CCClass.js diff --git a/cocos2d/cocos/platform/CCCommon.js b/cocos2d/core/platform/CCCommon.js similarity index 100% rename from cocos2d/cocos/platform/CCCommon.js rename to cocos2d/core/platform/CCCommon.js diff --git a/cocos2d/cocos/platform/CCConfig.js b/cocos2d/core/platform/CCConfig.js similarity index 100% rename from cocos2d/cocos/platform/CCConfig.js rename to cocos2d/core/platform/CCConfig.js diff --git a/cocos2d/cocos/platform/CCEGLView.js b/cocos2d/core/platform/CCEGLView.js similarity index 100% rename from cocos2d/cocos/platform/CCEGLView.js rename to cocos2d/core/platform/CCEGLView.js diff --git a/cocos2d/cocos/platform/CCFileUtils.js b/cocos2d/core/platform/CCFileUtils.js similarity index 100% rename from cocos2d/cocos/platform/CCFileUtils.js rename to cocos2d/core/platform/CCFileUtils.js diff --git a/cocos2d/cocos/platform/CCMacro.js b/cocos2d/core/platform/CCMacro.js similarity index 100% rename from cocos2d/cocos/platform/CCMacro.js rename to cocos2d/core/platform/CCMacro.js diff --git a/cocos2d/cocos/platform/CCSAXParser.js b/cocos2d/core/platform/CCSAXParser.js similarity index 100% rename from cocos2d/cocos/platform/CCSAXParser.js rename to cocos2d/core/platform/CCSAXParser.js diff --git a/cocos2d/cocos/platform/CCScreen.js b/cocos2d/core/platform/CCScreen.js similarity index 100% rename from cocos2d/cocos/platform/CCScreen.js rename to cocos2d/core/platform/CCScreen.js diff --git a/cocos2d/cocos/platform/CCTypes.js b/cocos2d/core/platform/CCTypes.js similarity index 100% rename from cocos2d/cocos/platform/CCTypes.js rename to cocos2d/core/platform/CCTypes.js diff --git a/cocos2d/cocos/platform/CCVisibleRect.js b/cocos2d/core/platform/CCVisibleRect.js similarity index 100% rename from cocos2d/cocos/platform/CCVisibleRect.js rename to cocos2d/core/platform/CCVisibleRect.js diff --git a/cocos2d/cocos/platform/Sys.js b/cocos2d/core/platform/Sys.js similarity index 100% rename from cocos2d/cocos/platform/Sys.js rename to cocos2d/core/platform/Sys.js diff --git a/cocos2d/cocos/platform/miniFramework.js b/cocos2d/core/platform/miniFramework.js similarity index 100% rename from cocos2d/cocos/platform/miniFramework.js rename to cocos2d/core/platform/miniFramework.js diff --git a/cocos2d/cocos/scenes_nodes/CCScene.js b/cocos2d/core/scenes_nodes/CCScene.js similarity index 100% rename from cocos2d/cocos/scenes_nodes/CCScene.js rename to cocos2d/core/scenes_nodes/CCScene.js diff --git a/cocos2d/cocos/sprite_nodes/CCAnimation.js b/cocos2d/core/sprite_nodes/CCAnimation.js similarity index 100% rename from cocos2d/cocos/sprite_nodes/CCAnimation.js rename to cocos2d/core/sprite_nodes/CCAnimation.js diff --git a/cocos2d/cocos/sprite_nodes/CCAnimationCache.js b/cocos2d/core/sprite_nodes/CCAnimationCache.js similarity index 100% rename from cocos2d/cocos/sprite_nodes/CCAnimationCache.js rename to cocos2d/core/sprite_nodes/CCAnimationCache.js diff --git a/cocos2d/cocos/sprite_nodes/CCSprite.js b/cocos2d/core/sprite_nodes/CCSprite.js similarity index 100% rename from cocos2d/cocos/sprite_nodes/CCSprite.js rename to cocos2d/core/sprite_nodes/CCSprite.js diff --git a/cocos2d/cocos/sprite_nodes/CCSpriteBatchNode.js b/cocos2d/core/sprite_nodes/CCSpriteBatchNode.js similarity index 100% rename from cocos2d/cocos/sprite_nodes/CCSpriteBatchNode.js rename to cocos2d/core/sprite_nodes/CCSpriteBatchNode.js diff --git a/cocos2d/cocos/sprite_nodes/CCSpriteFrame.js b/cocos2d/core/sprite_nodes/CCSpriteFrame.js similarity index 100% rename from cocos2d/cocos/sprite_nodes/CCSpriteFrame.js rename to cocos2d/core/sprite_nodes/CCSpriteFrame.js diff --git a/cocos2d/cocos/sprite_nodes/CCSpriteFrameCache.js b/cocos2d/core/sprite_nodes/CCSpriteFrameCache.js similarity index 100% rename from cocos2d/cocos/sprite_nodes/CCSpriteFrameCache.js rename to cocos2d/core/sprite_nodes/CCSpriteFrameCache.js diff --git a/cocos2d/cocos/support/CCPointExtension.js b/cocos2d/core/support/CCPointExtension.js similarity index 100% rename from cocos2d/cocos/support/CCPointExtension.js rename to cocos2d/core/support/CCPointExtension.js diff --git a/cocos2d/cocos/support/CCVertex.js b/cocos2d/core/support/CCVertex.js similarity index 100% rename from cocos2d/cocos/support/CCVertex.js rename to cocos2d/core/support/CCVertex.js diff --git a/cocos2d/cocos/support/TransformUtils.js b/cocos2d/core/support/TransformUtils.js similarity index 100% rename from cocos2d/cocos/support/TransformUtils.js rename to cocos2d/core/support/TransformUtils.js diff --git a/cocos2d/cocos/textures/CCTexture2D.js b/cocos2d/core/textures/CCTexture2D.js similarity index 100% rename from cocos2d/cocos/textures/CCTexture2D.js rename to cocos2d/core/textures/CCTexture2D.js diff --git a/cocos2d/cocos/textures/CCTextureAtlas.js b/cocos2d/core/textures/CCTextureAtlas.js similarity index 100% rename from cocos2d/cocos/textures/CCTextureAtlas.js rename to cocos2d/core/textures/CCTextureAtlas.js diff --git a/cocos2d/cocos/textures/CCTextureCache.js b/cocos2d/core/textures/CCTextureCache.js similarity index 100% rename from cocos2d/cocos/textures/CCTextureCache.js rename to cocos2d/core/textures/CCTextureCache.js diff --git a/cocos2d/jsloader.js b/cocos2d/jsloader.js new file mode 100644 index 0000000000..fc2a591eb0 --- /dev/null +++ b/cocos2d/jsloader.js @@ -0,0 +1,342 @@ +/**************************************************************************** + Copyright (c) 2010-2012 cocos2d-x.org + Copyright (c) 2008-2010 Ricardo Quesada + Copyright (c) 2011 Zynga Inc. + + http://www.cocos2d-x.org + + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ +(function () { + var engine = [ + 'cocos/platform/CCClass.js', + 'cocos/cocoa/CCGeometry.js', + 'cocos/platform/Sys.js', + 'cocos/platform/CCConfig.js', + 'cocos/platform/miniFramework.js', + 'cocos/platform/CCCommon.js', + 'cocos/platform/ZipUtils.js', + 'cocos/platform/base64.js', + 'cocos/platform/gzip.js', + 'cocos/platform/CCMacro.js', + 'cocos/platform/CCFileUtils.js', + 'cocos/platform/CCTypes.js', + 'cocos/platform/CCAccelerometer.js', + 'cocos/platform/zlib.min.js', + 'cocos/platform/CCEGLView.js', + 'cocos/platform/CCImage.js', + 'cocos/platform/CCScreen.js', + 'cocos/platform/CCVisibleRect.js', + 'kazmath/utility.js', + 'kazmath/vec2.js', + 'kazmath/vec3.js', + 'kazmath/vec4.js', + 'kazmath/ray2.js', + 'kazmath/mat3.js', + 'kazmath/mat4.js', + 'kazmath/plane.js', + 'kazmath/quaternion.js', + 'kazmath/aabb.js', + 'kazmath/GL/mat4stack.js', + 'kazmath/GL/matrix.js', + 'cocos/cocoa/CCNS.js', + 'cocos/cocoa/CCAffineTransform.js', + 'cocos/support/CCPointExtension.js', + 'cocos/support/CCUserDefault.js', + 'cocos/support/CCVertex.js', + 'cocos/support/TransformUtils.js', + 'cocos/support/CCTGAlib.js', + 'cocos/support/CCPNGReader.js', + 'cocos/support/CCTIFFReader.js', + 'cocos/support/component/CCComponent.js', + 'cocos/support/component/CCComponentContainer.js', + 'shaders/CCShaders.js', + 'shaders/CCShaderCache.js', + 'shaders/CCGLProgram.js', + 'shaders/CCGLStateCache.js', + 'cocos/base_nodes/CCNode.js', + 'cocos/base_nodes/CCAtlasNode.js', + 'cocos/textures/CCTexture2D.js', + 'cocos/textures/CCTextureCache.js', + 'cocos/textures/CCTextureAtlas.js', + 'misc_nodes/CCRenderTexture.js', + 'misc_nodes/CCMotionStreak.js', + 'misc_nodes/CCClippingNode.js', + 'effects/CCGrid.js', + 'effects/CCGrabber.js', + 'draw_nodes/CCDrawNode.js', + 'actions/CCAction.js', + 'actions/CCActionInterval.js', + 'actions/CCActionInstant.js', + 'actions/CCActionManager.js', + 'actions/CCActionCamera.js', + 'actions/CCActionEase.js', + 'actions/CCActionCatmullRom.js', + 'actions/CCActionTween.js', + 'actions3d/CCActionGrid.js', + 'actions3d/CCActionGrid3D.js', + 'actions3d/CCActionTiledGrid.js', + 'actions3d/CCActionPageTurn3D.js', + 'progress_timer/CCProgressTimer.js', + 'progress_timer/CCActionProgressTimer.js', + 'cocos/scenes_nodes/CCScene.js', + 'cocos/layers_nodes/CCLayer.js', + 'transitions_nodes/CCTransition.js', + 'transitions_nodes/CCTransitionProgress.js', + 'transitions_nodes/CCTransitionPageTurn.js', + 'cocos/sprite_nodes/CCSprite.js', + 'cocos/sprite_nodes/CCAnimation.js', + 'cocos/sprite_nodes/CCAnimationCache.js', + 'cocos/sprite_nodes/CCSpriteFrame.js', + 'cocos/sprite_nodes/CCSpriteFrameCache.js', + 'cocos/sprite_nodes/CCSpriteBatchNode.js', + 'label_nodes/CCLabelAtlas.js', + 'label_nodes/CCLabelTTF.js', + 'label_nodes/CCLabelBMFont.js', + 'particle_nodes/CCParticleSystem.js', + 'particle_nodes/CCParticleExamples.js', + 'particle_nodes/CCParticleBatchNode.js', + 'touch_dispatcher/CCTouchDelegateProtocol.js', + 'touch_dispatcher/CCTouchHandler.js', + 'touch_dispatcher/CCTouchDispatcher.js', + 'touch_dispatcher/CCMouseDispatcher.js', + 'keyboard_dispatcher/CCKeyboardDelegate.js', + 'keyboard_dispatcher/CCKeyboardDispatcher.js', + 'text_input_node/CCIMEDispatcher.js', + 'text_input_node/CCTextFieldTTF.js', + 'cocos/CCConfiguration.js', + 'cocos/CCDirector.js', + 'cocos/CCCamera.js', + 'cocos/CCScheduler.js', + 'cocos/CCLoader.js', + 'CCDrawingPrimitives.js', + 'cocos/platform/CCApplication.js', + 'cocos/platform/CCSAXParser.js', + 'cocos/platform/AppControl.js', + 'menu_nodes/CCMenuItem.js', + 'menu_nodes/CCMenu.js', + 'tileMap_nodes/CCTMXTiledMap.js', + 'tileMap_nodes/CCTMXXMLParser.js', + 'tileMap_nodes/CCTMXObjectGroup.js', + 'tileMap_nodes/CCTMXLayer.js', + 'parallax_nodes/CCParallaxNode.js', + 'cocos/base_nodes/CCdomNode.js', + '../CocosDenshion/SimpleAudioEngine.js' + ]; + + var d = document; + var c = d["ccConfig"]; + + if (c.loadExtension != null && c.loadExtension == true) { + engine = engine.concat([ + '../extensions/GUI/CCControlExtension/CCControl.js', + '../extensions/GUI/CCControlExtension/CCControlButton.js', + '../extensions/GUI/CCControlExtension/CCControlUtils.js', + '../extensions/GUI/CCControlExtension/CCInvocation.js', + '../extensions/GUI/CCControlExtension/CCScale9Sprite.js', + '../extensions/GUI/CCControlExtension/CCMenuPassive.js', + '../extensions/GUI/CCControlExtension/CCControlSaturationBrightnessPicker.js', + '../extensions/GUI/CCControlExtension/CCControlHuePicker.js', + '../extensions/GUI/CCControlExtension/CCControlColourPicker.js', + '../extensions/GUI/CCControlExtension/CCControlSlider.js', + '../extensions/GUI/CCControlExtension/CCControlSwitch.js', + '../extensions/GUI/CCControlExtension/CCControlStepper.js', + '../extensions/GUI/CCControlExtension/CCControlPotentiometer.js', + '../extensions/GUI/CCScrollView/CCScrollView.js', + '../extensions/GUI/CCScrollView/CCSorting.js', + '../extensions/GUI/CCScrollView/CCTableView.js', + '../extensions/CCBReader/CCNodeLoader.js', + '../extensions/CCBReader/CCBReaderUtil.js', + '../extensions/CCBReader/CCControlLoader.js', + '../extensions/CCBReader/CCSpriteLoader.js', + '../extensions/CCBReader/CCNodeLoaderLibrary.js', + '../extensions/CCBReader/CCBReader.js', + '../extensions/CCBReader/CCBValue.js', + '../extensions/CCBReader/CCBKeyframe.js', + '../extensions/CCBReader/CCBSequence.js', + '../extensions/CCBReader/CCBRelativePositioning.js', + '../extensions/CCBReader/CCBAnimationManager.js', + '../extensions/CCEditBox/CCEditBox.js', + + '../extensions/CocoStudio/CocoStudio.js', + // CocoStudio Armature + '../extensions/CocoStudio/Armature/utils/CCArmatureDefine.js', + '../extensions/CocoStudio/Armature/utils/CCDataReaderHelper.js', + '../extensions/CocoStudio/Armature/utils/CCSpriteFrameCacheHelper.js', + '../extensions/CocoStudio/Armature/utils/CCTransformHelp.js', + '../extensions/CocoStudio/Armature/utils/CCTweenFunction.js', + '../extensions/CocoStudio/Armature/utils/CCUtilMath.js', + '../extensions/CocoStudio/Armature/utils/CCArmatureDataManager.js', + '../extensions/CocoStudio/Armature/datas/CCDatas.js', + '../extensions/CocoStudio/Armature/display/CCDecorativeDisplay.js', + '../extensions/CocoStudio/Armature/display/CCDisplayFactory.js', + '../extensions/CocoStudio/Armature/display/CCDisplayManager.js', + '../extensions/CocoStudio/Armature/display/CCSkin.js', + '../extensions/CocoStudio/Armature/animation/CCProcessBase.js', + '../extensions/CocoStudio/Armature/animation/CCArmatureAnimation.js', + '../extensions/CocoStudio/Armature/animation/CCTween.js', + '../extensions/CocoStudio/Armature/physics/CCColliderDetector.js', + '../extensions/CocoStudio/Armature/CCArmature.js', + '../extensions/CocoStudio/Armature/CCBone.js', + // CocoStudio Action + '../extensions/CocoStudio/Action/CCActionFrame.js', + '../extensions/CocoStudio/Action/CCActionManager.js', + '../extensions/CocoStudio/Action/CCActionNode.js', + '../extensions/CocoStudio/Action/CCActionObject.js', + // CocoStudio Components + '../extensions/CocoStudio/Components/CCComAttribute.js', + '../extensions/CocoStudio/Components/CCComAudio.js', + '../extensions/CocoStudio/Components/CCComController.js', + '../extensions/CocoStudio/Components/CCComRender.js', + // CocoStudio GUI + '../extensions/CocoStudio/GUI/BaseClasses/UIWidget.js', + '../extensions/CocoStudio/GUI/Layouts/UILayout.js', + '../extensions/CocoStudio/GUI/BaseClasses/UIRootWidget.js', + '../extensions/CocoStudio/GUI/Layouts/UILayoutParameter.js', + '../extensions/CocoStudio/GUI/Layouts/UILayoutDefine.js', + '../extensions/CocoStudio/GUI/System/CocosGUI.js', + '../extensions/CocoStudio/GUI/System/UIHelper.js', + '../extensions/CocoStudio/GUI/System/UIInputManager.js', + '../extensions/CocoStudio/GUI/System/UILayer.js', + '../extensions/CocoStudio/GUI/UIWidgets/UIButton.js', + '../extensions/CocoStudio/GUI/UIWidgets/UICheckBox.js', + '../extensions/CocoStudio/GUI/UIWidgets/UIImageView.js', + '../extensions/CocoStudio/GUI/UIWidgets/UILabel.js', + '../extensions/CocoStudio/GUI/UIWidgets/UILabelAtlas.js', + '../extensions/CocoStudio/GUI/UIWidgets/UILabelBMFont.js', + '../extensions/CocoStudio/GUI/UIWidgets/UILoadingBar.js', + '../extensions/CocoStudio/GUI/UIWidgets/UISlider.js', + '../extensions/CocoStudio/GUI/UIWidgets/UISwitch.js', + '../extensions/CocoStudio/GUI/UIWidgets/UITextField.js', + '../extensions/CocoStudio/GUI/UIWidgets/Compatible/CompatibleClasses.js', + '../extensions/CocoStudio/GUI/UIWidgets/ScrollWidget/UIScrollView.js', + '../extensions/CocoStudio/GUI/UIWidgets/ScrollWidget/UIListView.js', + '../extensions/CocoStudio/GUI/UIWidgets/ScrollWidget/UIPageView.js', + '../extensions/CocoStudio/GUI/UIWidgets/ScrollWidget/UIScrollInterface.js', + '../extensions/CocoStudio/Reader/GUIReader.js', + '../extensions/CocoStudio/Reader/SceneReader.js' + + ]); + } + + if (c.loadPluginx != null && c.loadPluginx == true) { + engine = engine.concat([ + //protocols + '../extensions/PluginX/protocols/Config.js', + '../extensions/PluginX/protocols/PluginUtils.js', + '../extensions/PluginX/protocols/PluginProtocol.js', + '../extensions/PluginX/protocols/ProtocolSocial.js', + //'../extensions/PluginX/protocols/ProtocolAds.js', + //'../extensions/PluginX/protocols/ProtocolAnalytics.js', + //'../extensions/PluginX/protocols/ProtocolIAP.js', + '../extensions/PluginX/protocols/PluginFactory.js', + '../extensions/PluginX/protocols/PluginManager.js', + + //plugins + '../extensions/PluginX/plugins/SocialWeibo.js', + '../extensions/PluginX/plugins/SocialQQWeibo.js', + '../extensions/PluginX/plugins/SocialQzone.js', + '../extensions/PluginX/plugins/SocialTwitter.js', + '../extensions/PluginX/plugins/SocialFacebook.js' + //'../extensions/PluginX/plugins/AdsGoogle.js' + ]); + } + + if (!c.engineDir) { + engine = []; + } + else { + if(c.box2d || c.chipmunk){ + engine.push('physics_nodes/CCPhysicsSprite.js'); + engine.push('physics_nodes/CCPhysicsDebugNode.js'); + if (c.box2d === true) + engine.push('../box2d/box2d.js'); + if (c.chipmunk === true) + engine.push('../chipmunk/chipmunk.js'); + } + engine.forEach(function (e, i) { + engine[i] = c.engineDir + e; + }); + } + if (typeof c.box2d === "string") { + engine.push(c.box2d); + } + if (typeof c.chipmunk === "string") { + engine.push(c.chipmunk); + } + + var loadJsImg = document.getElementById("cocos2d_loadJsImg"); + if(!loadJsImg){ + loadJsImg = document.createElement('img'); + loadJsImg.src = "data:image/gif;base64,R0lGODlhEAAQALMNAD8/P7+/vyoqKlVVVX9/fxUVFUBAQGBgYMDAwC8vL5CQkP///wAAAP///wAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQFAAANACwAAAAAEAAQAAAEO5DJSau9OOvNex0IMnDIsiCkiW6g6BmKYlBFkhSUEgQKlQCARG6nEBwOgl+QApMdCIRD7YZ5RjlGpCUCACH5BAUAAA0ALAAAAgAOAA4AAAQ6kLGB0JA4M7QW0hrngRllkYyhKAYqKUGguAws0ypLS8JxCLQDgXAIDg+FRKIA6v0SAECCBpXSkstMBAAh+QQFAAANACwAAAAACgAQAAAEOJDJORAac6K1kDSKYmydpASBUl0mqmRfaGTCcQgwcxDEke+9XO2WkxQSiUIuAQAkls0n7JgsWq8RACH5BAUAAA0ALAAAAAAOAA4AAAQ6kMlplDIzTxWC0oxwHALnDQgySAdBHNWFLAvCukc215JIZihVIZEogDIJACBxnCSXTcmwGK1ar1hrBAAh+QQFAAANACwAAAAAEAAKAAAEN5DJKc4RM+tDyNFTkSQF5xmKYmQJACTVpQSBwrpJNteZSGYoFWjIGCAQA2IGsVgglBOmEyoxIiMAIfkEBQAADQAsAgAAAA4ADgAABDmQSVZSKjPPBEDSGucJxyGA1XUQxAFma/tOpDlnhqIYN6MEAUXvF+zldrMBAjHoIRYLhBMqvSmZkggAIfkEBQAADQAsBgAAAAoAEAAABDeQyUmrnSWlYhMASfeFVbZdjHAcgnUQxOHCcqWylKEohqUEAYVkgEAMfkEJYrFA6HhKJsJCNFoiACH5BAUAAA0ALAIAAgAOAA4AAAQ3kMlJq704611SKloCAEk4lln3DQgyUMJxCBKyLAh1EMRR3wiDQmHY9SQslyIQUMRmlmVTIyRaIgA7"; + + var canvasNode = document.getElementById(c.tag); + canvasNode.style.backgroundColor = "black"; + canvasNode.parentNode.appendChild(loadJsImg); + + var canvasStyle = getComputedStyle?getComputedStyle(canvasNode):canvasNode.currentStyle; + loadJsImg.style.left = canvasNode.offsetLeft + (parseFloat(canvasStyle.width) - loadJsImg.width)/2 + "px"; + loadJsImg.style.top = canvasNode.offsetTop + (parseFloat(canvasStyle.height) - loadJsImg.height)/2 + "px"; + loadJsImg.style.position = "absolute"; + } + + var updateLoading = function(p){ + if(p>=1) { + loadJsImg.parentNode.removeChild(loadJsImg); + } + }; + + var loaded = 0; + var que = engine.concat(c.appFiles); + que.push('main.js'); + + if (navigator.userAgent.indexOf("Trident/5") > -1) { + //ie9 + var i = -1; + var loadNext = function () { + i++; + if (i < que.length) { + var f = d.createElement('script'); + f.src = que[i]; + f.addEventListener('load',function(){ + loadNext(); + updateLoading(loaded / que.length); + this.removeEventListener('load', arguments.callee, false); + },false); + d.body.appendChild(f); + } + updateLoading(i / (que.length - 1)); + }; + loadNext(); + } + else { + que.forEach(function (f, i) { + var s = d.createElement('script'); + s.async = false; + s.src = f; + s.addEventListener('load',function(){ + loaded++; + updateLoading(loaded / que.length); + this.removeEventListener('load', arguments.callee, false); + },false); + d.body.appendChild(s); + }); + } +})(); diff --git a/cocos2d/cocos/support/CCPNGReader.js b/cocos2d/particle_nodes/CCPNGReader.js similarity index 100% rename from cocos2d/cocos/support/CCPNGReader.js rename to cocos2d/particle_nodes/CCPNGReader.js diff --git a/cocos2d/cocos/support/CCTIFFReader.js b/cocos2d/particle_nodes/CCTIFFReader.js similarity index 100% rename from cocos2d/cocos/support/CCTIFFReader.js rename to cocos2d/particle_nodes/CCTIFFReader.js diff --git a/cocos2d/cocos/support/CCTGAlib.js b/cocos2d/tileMap_nodes/CCTGAlib.js similarity index 100% rename from cocos2d/cocos/support/CCTGAlib.js rename to cocos2d/tileMap_nodes/CCTGAlib.js diff --git a/cocos2d/cocos/base_nodes/CCdomNode.js b/extensions/CCEditBox/CCdomNode.js similarity index 100% rename from cocos2d/cocos/base_nodes/CCdomNode.js rename to extensions/CCEditBox/CCdomNode.js diff --git a/cocos2d/cocos/support/component/CCComponent.js b/extensions/CocoStudio/Components/CCComponent.js similarity index 100% rename from cocos2d/cocos/support/component/CCComponent.js rename to extensions/CocoStudio/Components/CCComponent.js diff --git a/cocos2d/cocos/support/component/CCComponentContainer.js b/extensions/CocoStudio/Components/CCComponentContainer.js similarity index 100% rename from cocos2d/cocos/support/component/CCComponentContainer.js rename to extensions/CocoStudio/Components/CCComponentContainer.js diff --git a/template/cocos2d.js b/template/cocos2d.js index c21c5a771e..1cd293aace 100644 --- a/template/cocos2d.js +++ b/template/cocos2d.js @@ -80,7 +80,7 @@ loadJsImg.id = "cocos2d_loadJsImg"; } else if (c.engineDir && !c.SingleEngineFile) { - s.src = c.engineDir + 'platform/jsloader.js'; + s.src = c.engineDir + 'jsloader.js'; } else { alert('You must specify either the single engine file OR the engine directory in "cocos2d.js"'); From 0c78d23cdbe9b9f34e8bccb58bd26b61fc132b32 Mon Sep 17 00:00:00 2001 From: xingsenma Date: Fri, 20 Dec 2013 14:44:59 +0800 Subject: [PATCH 13/15] issue #3419 transform bug --- .../Armature/display/CCDisplayFactory.js | 17 ++++++++++++----- .../CocoStudio/Armature/display/CCSkin.js | 9 ++++++++- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/extensions/CocoStudio/Armature/display/CCDisplayFactory.js b/extensions/CocoStudio/Armature/display/CCDisplayFactory.js index 4592036a82..5d284c8594 100644 --- a/extensions/CocoStudio/Armature/display/CCDisplayFactory.js +++ b/extensions/CocoStudio/Armature/display/CCDisplayFactory.js @@ -53,7 +53,7 @@ ccs.DisplayFactory.createDisplay = function (bone, decoDisplay) { break; } }; - +ccs.DisplayFactory._helpTransform = {a:1, b:0, c:0, d:1, tx:0, ty:0}; ccs.DisplayFactory.updateDisplay = function (bone,dt, dirty) { var display = bone.getDisplayRenderNode(); if(!display) @@ -87,11 +87,18 @@ ccs.DisplayFactory.updateDisplay = function (bone,dt, dirty) { if (detector) { var node = decoDisplay.getDisplay(); var displayTransform = node.nodeToParentTransform(); + var helpTransform = this._helpTransform; + helpTransform.a = displayTransform.a; + helpTransform.b = displayTransform.b; + helpTransform.c = displayTransform.c; + helpTransform.d = displayTransform.d; + helpTransform.tx = displayTransform.tx; + helpTransform.ty = displayTransform.ty; var anchorPoint = node.getAnchorPointInPoints(); - anchorPoint = cc.PointApplyAffineTransform(anchorPoint, displayTransform); - displayTransform.tx = anchorPoint.x; - displayTransform.ty = anchorPoint.y; - var t = cc.AffineTransformConcat(displayTransform, bone.getArmature().nodeToParentTransform()); + anchorPoint = cc.PointApplyAffineTransform(anchorPoint, helpTransform); + helpTransform.tx = anchorPoint.x; + helpTransform.ty = anchorPoint.y; + var t = cc.AffineTransformConcat(helpTransform, bone.getArmature().nodeToParentTransform()); detector.updateTransform(t); } } diff --git a/extensions/CocoStudio/Armature/display/CCSkin.js b/extensions/CocoStudio/Armature/display/CCSkin.js index ba4f07083b..2f59f6c198 100644 --- a/extensions/CocoStudio/Armature/display/CCSkin.js +++ b/extensions/CocoStudio/Armature/display/CCSkin.js @@ -62,7 +62,14 @@ ccs.Skin = ccs.Sprite.extend(/** @lends ccs.Skin# */{ this.setRotationY(cc.RADIANS_TO_DEGREES(-skinData.skewY)); this.setPosition(skinData.x, skinData.y); - this._skinTransform = this.nodeToParentTransform(); + var localTransform = this.nodeToParentTransform(); + var skinTransform = this._skinTransform; + skinTransform.a = localTransform.a; + skinTransform.b = localTransform.b; + skinTransform.c = localTransform.c; + skinTransform.d = localTransform.d; + skinTransform.tx = localTransform.tx; + skinTransform.ty = localTransform.ty; this.updateArmatureTransform(); }, From 37f9a5fca4637b35c2fbf9c83d2e67eb69f4c770 Mon Sep 17 00:00:00 2001 From: xingsenma Date: Fri, 20 Dec 2013 14:46:15 +0800 Subject: [PATCH 14/15] issue #3419 change animation play --- .../Armature/animation/CCArmatureAnimation.js | 29 +++++++++++++++---- 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/extensions/CocoStudio/Armature/animation/CCArmatureAnimation.js b/extensions/CocoStudio/Armature/animation/CCArmatureAnimation.js index 2c47fd9114..dec5514567 100644 --- a/extensions/CocoStudio/Armature/animation/CCArmatureAnimation.js +++ b/extensions/CocoStudio/Armature/animation/CCArmatureAnimation.js @@ -183,21 +183,38 @@ ccs.ArmatureAnimation = ccs.ProcessBase.extend(/** @lends ccs.ArmatureAnimation# /** * play animation by animation name. - * @param {String||Array} animationName The animation name you want to play + * @param {String} animationName The animation name you want to play * @param {Number} durationTo * he frames between two animation changing-over.It's meaning is changing to this animation need how many frames * -1 : use the value from CCMovementData get from flash design panel + * @param {Number} durationTween he + * frame count you want to play in the game.if _durationTween is 80, then the animation will played 80 frames in a loop + * -1 : use the value from CCMovementData get from flash design panel * @param {Number} loop * Whether the animation is loop. * loop < 0 : use the value from CCMovementData get from flash design panel * loop = 0 : this animation is not loop * loop > 0 : this animation is loop + * @param {Number} tweenEasing + * CCTween easing is used for calculate easing effect + * TWEEN_EASING_MAX : use the value from CCMovementData get from flash design panel + * -1 : fade out + * 0 : line + * 1 : fade in + * 2 : fade in and out + * @example + * // example + * armature.getAnimation().play("run",-1,-1,1,-1);//loop play + * armature.getAnimation().play("run",-1,-1,-1,-1);//not loop play + * armature.getAnimation().play(["run1","run2","run3"],1);//loop play animations */ - play:function (animationName, durationTo, loop) { + play:function (animationName, durationTo, durationTween, loop, tweenEasing) { if(typeof animationName == "string"){ this._playByName(animationName, durationTo, loop); } else if(animationName instanceof Array){ - this._playByNames(animationName, durationTo, loop); + this._playByNames(arguments[0], -1, arguments[1]); + //todo + //this._playByNames(animationName, durationTo, loop); } }, @@ -296,7 +313,7 @@ ccs.ArmatureAnimation = ccs.ProcessBase.extend(/** @lends ccs.ArmatureAnimation# if (this._onMovementList) { if (this._movementListLoop) { var movementObj = this._movementList[this._movementIndex]; - this.play(movementObj.name, movementObj.durationTo,0); + this.play(movementObj.name, movementObj.durationTo,-1,0); this._movementIndex++; if (this._movementIndex >= this._movementList.length) { this._movementIndex = 0; @@ -305,7 +322,7 @@ ccs.ArmatureAnimation = ccs.ProcessBase.extend(/** @lends ccs.ArmatureAnimation# else { if (this._movementIndex < this._movementList.length) { var movementObj = this._movementList[this._movementIndex]; - this.play(movementObj.name, movementObj.durationTo,0); + this.play(movementObj.name, movementObj.durationTo,-1,0); this._movementIndex++; } else { @@ -385,7 +402,7 @@ ccs.ArmatureAnimation = ccs.ProcessBase.extend(/** @lends ccs.ArmatureAnimation# return; } var animationName = moveNames[animationIndex]; - this.play(animationName, durationTo, loop); + this.play(animationName, durationTo,-1, loop, 0); }, _playByIndexs: function (movementIndexes,durationTo, loop) { this._movementList = []; From e7daeaa9a8862b5fbb6cf3d6afb665010f224437 Mon Sep 17 00:00:00 2001 From: linshun Date: Fri, 20 Dec 2013 15:36:08 +0800 Subject: [PATCH 15/15] issue #1758: Move the audio folder into the cocos folder, and put the box2d and the chipmunk into the external folder. --- .../audio}/SimpleAudioEngine.js | 0 cocos2d/core/base_nodes/CCNode.js | 8 +- cocos2d/core/platform/CCEGLView.js | 4 +- cocos2d/jsloader.js | 115 ++++++++++-------- {box2d => external/box2d}/box2d.js | 0 {chipmunk => external/chipmunk}/chipmunk.js | 0 6 files changed, 70 insertions(+), 57 deletions(-) rename {CocosDenshion => cocos2d/audio}/SimpleAudioEngine.js (100%) rename {box2d => external/box2d}/box2d.js (100%) rename {chipmunk => external/chipmunk}/chipmunk.js (100%) diff --git a/CocosDenshion/SimpleAudioEngine.js b/cocos2d/audio/SimpleAudioEngine.js similarity index 100% rename from CocosDenshion/SimpleAudioEngine.js rename to cocos2d/audio/SimpleAudioEngine.js diff --git a/cocos2d/core/base_nodes/CCNode.js b/cocos2d/core/base_nodes/CCNode.js index 60260fb8ff..4721b828a3 100644 --- a/cocos2d/core/base_nodes/CCNode.js +++ b/cocos2d/core/base_nodes/CCNode.js @@ -165,7 +165,9 @@ cc.Node = cc.Class.extend(/** @lends cc.Node# */{ this._scheduler = director.getScheduler(); this._initializedNode = true; this._additionalTransform = cc.AffineTransformMakeIdentity(); - this._componentContainer = new cc.ComponentContainer(this); + if(cc.ComponentContainer){ + this._componentContainer = new cc.ComponentContainer(this); + } }, /** @@ -1290,7 +1292,9 @@ cc.Node = cc.Class.extend(/** @lends cc.Node# */{ this._running = false; this.pauseSchedulerAndActions(); this._arrayMakeObjectsPerformSelector(this._children, cc.Node.StateCallbackType.onExit); - this._componentContainer.removeAll(); + if(this._componentContainer){ + this._componentContainer.removeAll(); + } }, // actions diff --git a/cocos2d/core/platform/CCEGLView.js b/cocos2d/core/platform/CCEGLView.js index 548e4a92b6..e0b91523af 100644 --- a/cocos2d/core/platform/CCEGLView.js +++ b/cocos2d/core/platform/CCEGLView.js @@ -491,7 +491,9 @@ cc.EGLView = cc.Class.extend(/** @lends cc.EGLView# */{ this._originalScaleX = this._scaleX; this._originalScaleY = this._scaleY; // For editbox - cc.DOM._resetEGLViewDiv(); + if( cc.DOM){ + cc.DOM._resetEGLViewDiv(); + } cc.VisibleRect.init(this.getVisibleSize()); } diff --git a/cocos2d/jsloader.js b/cocos2d/jsloader.js index fc2a591eb0..3fa202d6f0 100644 --- a/cocos2d/jsloader.js +++ b/cocos2d/jsloader.js @@ -26,24 +26,46 @@ ****************************************************************************/ (function () { var engine = [ - 'cocos/platform/CCClass.js', - 'cocos/cocoa/CCGeometry.js', - 'cocos/platform/Sys.js', - 'cocos/platform/CCConfig.js', - 'cocos/platform/miniFramework.js', - 'cocos/platform/CCCommon.js', - 'cocos/platform/ZipUtils.js', - 'cocos/platform/base64.js', - 'cocos/platform/gzip.js', - 'cocos/platform/CCMacro.js', - 'cocos/platform/CCFileUtils.js', - 'cocos/platform/CCTypes.js', - 'cocos/platform/CCAccelerometer.js', - 'cocos/platform/zlib.min.js', - 'cocos/platform/CCEGLView.js', - 'cocos/platform/CCImage.js', - 'cocos/platform/CCScreen.js', - 'cocos/platform/CCVisibleRect.js', + // Core + 'core/platform/CCClass.js', + 'core/cocoa/CCGeometry.js', + 'core/platform/Sys.js', + 'core/platform/CCConfig.js', + 'core/platform/miniFramework.js', + 'core/platform/CCCommon.js', + 'core/platform/CCMacro.js', + 'core/platform/CCFileUtils.js', + 'core/platform/CCTypes.js', + 'core/platform/CCEGLView.js', + 'core/platform/CCScreen.js', + 'core/platform/CCVisibleRect.js', + 'core/cocoa/CCNS.js', + 'core/cocoa/CCAffineTransform.js', + 'core/support/CCPointExtension.js', + 'core/support/CCVertex.js', + 'core/support/TransformUtils.js', + 'core/base_nodes/CCNode.js', + 'core/base_nodes/CCAtlasNode.js', + 'core/textures/CCTexture2D.js', + 'core/textures/CCTextureCache.js', + 'core/textures/CCTextureAtlas.js', + 'core/scenes_nodes/CCScene.js', + 'core/layers_nodes/CCLayer.js', + 'core/sprite_nodes/CCSprite.js', + 'core/sprite_nodes/CCAnimation.js', + 'core/sprite_nodes/CCAnimationCache.js', + 'core/sprite_nodes/CCSpriteFrame.js', + 'core/sprite_nodes/CCSpriteFrameCache.js', + 'core/sprite_nodes/CCSpriteBatchNode.js', + 'core/CCConfiguration.js', + 'core/CCDirector.js', + 'core/CCCamera.js', + 'core/CCScheduler.js', + 'core/CCLoader.js', + 'core/platform/CCApplication.js', + 'core/platform/CCSAXParser.js', + 'core/platform/AppControl.js', + 'kazmath/utility.js', 'kazmath/vec2.js', 'kazmath/vec3.js', @@ -56,26 +78,10 @@ 'kazmath/aabb.js', 'kazmath/GL/mat4stack.js', 'kazmath/GL/matrix.js', - 'cocos/cocoa/CCNS.js', - 'cocos/cocoa/CCAffineTransform.js', - 'cocos/support/CCPointExtension.js', - 'cocos/support/CCUserDefault.js', - 'cocos/support/CCVertex.js', - 'cocos/support/TransformUtils.js', - 'cocos/support/CCTGAlib.js', - 'cocos/support/CCPNGReader.js', - 'cocos/support/CCTIFFReader.js', - 'cocos/support/component/CCComponent.js', - 'cocos/support/component/CCComponentContainer.js', 'shaders/CCShaders.js', 'shaders/CCShaderCache.js', 'shaders/CCGLProgram.js', 'shaders/CCGLStateCache.js', - 'cocos/base_nodes/CCNode.js', - 'cocos/base_nodes/CCAtlasNode.js', - 'cocos/textures/CCTexture2D.js', - 'cocos/textures/CCTextureCache.js', - 'cocos/textures/CCTextureAtlas.js', 'misc_nodes/CCRenderTexture.js', 'misc_nodes/CCMotionStreak.js', 'misc_nodes/CCClippingNode.js', @@ -96,20 +102,18 @@ 'actions3d/CCActionPageTurn3D.js', 'progress_timer/CCProgressTimer.js', 'progress_timer/CCActionProgressTimer.js', - 'cocos/scenes_nodes/CCScene.js', - 'cocos/layers_nodes/CCLayer.js', 'transitions_nodes/CCTransition.js', 'transitions_nodes/CCTransitionProgress.js', 'transitions_nodes/CCTransitionPageTurn.js', - 'cocos/sprite_nodes/CCSprite.js', - 'cocos/sprite_nodes/CCAnimation.js', - 'cocos/sprite_nodes/CCAnimationCache.js', - 'cocos/sprite_nodes/CCSpriteFrame.js', - 'cocos/sprite_nodes/CCSpriteFrameCache.js', - 'cocos/sprite_nodes/CCSpriteBatchNode.js', 'label_nodes/CCLabelAtlas.js', 'label_nodes/CCLabelTTF.js', 'label_nodes/CCLabelBMFont.js', + 'compress/ZipUtils.js', + 'compress/base64.js', + 'compress/gzip.js', + 'compress/zlib.min.js', + 'particle_nodes/CCPNGReader.js', + 'particle_nodes/CCTIFFReader.js', 'particle_nodes/CCParticleSystem.js', 'particle_nodes/CCParticleExamples.js', 'particle_nodes/CCParticleBatchNode.js', @@ -119,26 +123,25 @@ 'touch_dispatcher/CCMouseDispatcher.js', 'keyboard_dispatcher/CCKeyboardDelegate.js', 'keyboard_dispatcher/CCKeyboardDispatcher.js', + 'accelerometer/CCAccelerometer.js', 'text_input_node/CCIMEDispatcher.js', 'text_input_node/CCTextFieldTTF.js', - 'cocos/CCConfiguration.js', - 'cocos/CCDirector.js', - 'cocos/CCCamera.js', - 'cocos/CCScheduler.js', - 'cocos/CCLoader.js', 'CCDrawingPrimitives.js', - 'cocos/platform/CCApplication.js', - 'cocos/platform/CCSAXParser.js', - 'cocos/platform/AppControl.js', 'menu_nodes/CCMenuItem.js', 'menu_nodes/CCMenu.js', + 'tileMap_nodes/CCTGAlib.js', 'tileMap_nodes/CCTMXTiledMap.js', 'tileMap_nodes/CCTMXXMLParser.js', 'tileMap_nodes/CCTMXObjectGroup.js', 'tileMap_nodes/CCTMXLayer.js', 'parallax_nodes/CCParallaxNode.js', - 'cocos/base_nodes/CCdomNode.js', - '../CocosDenshion/SimpleAudioEngine.js' + 'audio/SimpleAudioEngine.js', + + // useless + 'CCUserDefault.js', + + 'CCImage.js' + ]; var d = document; @@ -173,8 +176,11 @@ '../extensions/CCBReader/CCBSequence.js', '../extensions/CCBReader/CCBRelativePositioning.js', '../extensions/CCBReader/CCBAnimationManager.js', + '../extensions/CCEditBox/CCdomNode.js', '../extensions/CCEditBox/CCEditBox.js', + '../extensions/CocoStudio/Components/CCComponent.js', + '../extensions/CocoStudio/Components/CCComponentContainer.js', '../extensions/CocoStudio/CocoStudio.js', // CocoStudio Armature '../extensions/CocoStudio/Armature/utils/CCArmatureDefine.js', @@ -201,6 +207,7 @@ '../extensions/CocoStudio/Action/CCActionNode.js', '../extensions/CocoStudio/Action/CCActionObject.js', // CocoStudio Components + '../extensions/CocoStudio/Components/CCComAttribute.js', '../extensions/CocoStudio/Components/CCComAudio.js', '../extensions/CocoStudio/Components/CCComController.js', @@ -267,9 +274,9 @@ engine.push('physics_nodes/CCPhysicsSprite.js'); engine.push('physics_nodes/CCPhysicsDebugNode.js'); if (c.box2d === true) - engine.push('../box2d/box2d.js'); + engine.push('../external/box2d/box2d.js'); if (c.chipmunk === true) - engine.push('../chipmunk/chipmunk.js'); + engine.push('../external/chipmunk/chipmunk.js'); } engine.forEach(function (e, i) { engine[i] = c.engineDir + e; diff --git a/box2d/box2d.js b/external/box2d/box2d.js similarity index 100% rename from box2d/box2d.js rename to external/box2d/box2d.js diff --git a/chipmunk/chipmunk.js b/external/chipmunk/chipmunk.js similarity index 100% rename from chipmunk/chipmunk.js rename to external/chipmunk/chipmunk.js