Skip to content

Commit

Permalink
Merge pull request cocos2d#5 from cocos2d/develop
Browse files Browse the repository at this point in the history
Pull down updates from cocos2d:develop #4
  • Loading branch information
pandamicro committed Dec 20, 2013
2 parents 72283ed + a7d2118 commit d28ea98
Show file tree
Hide file tree
Showing 90 changed files with 773 additions and 555 deletions.
2 changes: 1 addition & 1 deletion HelloHTML5World/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
<file name="GUI/CCScrollView/CCSorting.js"/>
<file name="GUI/CCScrollView/CCScrollView.js"/>
<file name="GUI/CCScrollView/CCTableView.js"/>
<file name="CCEditBox.js"/>
<file name="CCEditBox/CCEditBox.js"/>

<file name="CocoStudio/CocoStudio.js"/>
<file name="CocoStudio/Armature/utils/CCArmatureDefine.js"/>
Expand Down
2 changes: 1 addition & 1 deletion HelloHTML5World/cocos2d.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"');
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion cocos2d/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
<file name="GUI/CCScrollView/CCSorting.js"/>
<file name="GUI/CCScrollView/CCScrollView.js"/>
<file name="GUI/CCScrollView/CCTableView.js"/>
<file name="CCEditBox.js"/>
<file name="CCEditBox/CCEditBox.js"/>
<file name="CocoStudio/CocoStudio.js"/>
<file name="CocoStudio/Armature/utils/CCArmatureDefine.js"/>
<file name="CocoStudio/Armature/utils/CCDataReaderHelper.js"/>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
},

/**
Expand Down Expand Up @@ -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
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
145 changes: 76 additions & 69 deletions cocos2d/platform/jsloader.js → cocos2d/jsloader.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,46 @@
****************************************************************************/
(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',
// 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',
Expand All @@ -56,28 +78,11 @@
'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',
Expand All @@ -87,29 +92,28 @@
'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',
'actions3d/CCActionGrid.js',
'actions3d/CCActionGrid3D.js',
'actions3d/CCActionTiledGrid.js',
'actions3d/CCActionPageTurn3D.js',
'progress_timer/CCProgressTimer.js',
'progress_timer/CCActionProgressTimer.js',
'transitions_nodes/CCTransition.js',
'transitions_nodes/CCTransitionProgress.js',
'transitions_nodes/CCTransitionPageTurn.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',
Expand All @@ -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',
'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'
'tileMap_nodes/CCTGAlib.js',
'tileMap_nodes/CCTMXTiledMap.js',
'tileMap_nodes/CCTMXXMLParser.js',
'tileMap_nodes/CCTMXObjectGroup.js',
'tileMap_nodes/CCTMXLayer.js',
'parallax_nodes/CCParallaxNode.js',
'audio/SimpleAudioEngine.js',

// useless
'CCUserDefault.js',

'CCImage.js'

];

var d = document;
Expand Down Expand Up @@ -173,8 +176,11 @@
'../extensions/CCBReader/CCBSequence.js',
'../extensions/CCBReader/CCBRelativePositioning.js',
'../extensions/CCBReader/CCBAnimationManager.js',
'../extensions/CCEditBox.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',
Expand All @@ -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',
Expand Down Expand Up @@ -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;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
46 changes: 17 additions & 29 deletions extensions/CocoStudio/Armature/CCArmature.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -563,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}
Expand Down
Loading

0 comments on commit d28ea98

Please sign in to comment.