Skip to content

Commit

Permalink
Merge pull request cocos2d#5 from cocos2d/develop
Browse files Browse the repository at this point in the history
Merge from trunk
  • Loading branch information
WanderWang committed Dec 23, 2013
2 parents 7135f5b + 9621a57 commit 660d655
Show file tree
Hide file tree
Showing 133 changed files with 3,585 additions and 2,489 deletions.
155 changes: 75 additions & 80 deletions HelloHTML5World/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,48 @@
<file name="cocos2d_externs.js"/>
</externs>
<sources dir="${basedir}/../cocos2d">
<file name="platform/CCClass.js"/>
<file name="cocoa/CCGeometry.js"/>
<file name="platform/Sys.js"/>
<file name="platform/CCConfig.js"/>
<file name="platform/CCCommon.js"/>
<file name="platform/miniFramework.js"/>
<file name="platform/ZipUtils.js"/>
<file name="platform/base64.js"/>
<file name="platform/gzip.js"/>
<file name="platform/CCMacro.js"/>
<file name="platform/CCFileUtils.js"/>
<file name="platform/CCTypes.js"/>
<file name="platform/CCAccelerometer.js"/>
<file name="platform/CCEGLView.js"/>
<file name="platform/CCImage.js"/>
<file name="platform/CCScreen.js"/>
<file name="platform/CCVisibleRect.js"/>
<file name="platform/zlib.min.js"/>
<file name="cocoa/CCNS.js"/>
<file name="core/platform/CCClass.js"/>
<file name="core/cocoa/CCGeometry.js"/>
<file name="core/platform/Sys.js"/>
<file name="core/platform/CCConfig.js"/>
<file name="core/platform/miniFramework.js"/>
<file name="core/platform/CCCommon.js"/>
<file name="core/platform/CCMacro.js"/>
<file name="core/platform/CCFileUtils.js"/>
<file name="core/platform/CCTypes.js"/>
<file name="core/platform/CCEGLView.js"/>
<file name="core/platform/CCScreen.js"/>
<file name="core/platform/CCVisibleRect.js"/>
<file name="core/cocoa/CCNS.js"/>
<file name="core/cocoa/CCAffineTransform.js"/>
<file name="core/support/CCPointExtension.js"/>
<file name="core/support/CCVertex.js"/>
<file name="core/support/TransformUtils.js"/>
<file name="core/base_nodes/CCNode.js"/>
<file name="core/base_nodes/CCAtlasNode.js"/>
<file name="core/textures/CCTexture2D.js"/>
<file name="core/textures/CCTextureCache.js"/>
<file name="core/textures/CCTextureAtlas.js"/>
<file name="core/scenes_nodes/CCScene.js"/>
<file name="core/layers_nodes/CCLayer.js"/>
<file name="core/sprite_nodes/CCSprite.js"/>
<file name="core/sprite_nodes/CCAnimation.js"/>
<file name="core/sprite_nodes/CCAnimationCache.js"/>
<file name="core/sprite_nodes/CCSpriteFrame.js"/>
<file name="core/sprite_nodes/CCSpriteFrameCache.js"/>
<file name="core/sprite_nodes/CCSpriteBatchNode.js"/>
<file name="core/CCConfiguration.js"/>
<file name="core/CCDirector.js"/>
<file name="core/CCCamera.js"/>
<file name="core/CCScheduler.js"/>
<file name="core/CCLoader.js"/>
<file name="core/platform/CCApplication.js"/>
<file name="core/platform/CCSAXParser.js"/>
<file name="core/platform/AppControl.js"/>
<file name="kazmath/utility.js"/>
<file name="kazmath/vec2.js"/>
<file name="kazmath/vec3.js"/>
<file name="kazmath/vec4.js"/>
<file name="kazmath/utility.js"/>
<file name="kazmath/ray2.js"/>
<file name="kazmath/mat3.js"/>
<file name="kazmath/mat4.js"/>
Expand All @@ -44,92 +63,66 @@
<file name="kazmath/aabb.js"/>
<file name="kazmath/GL/mat4stack.js"/>
<file name="kazmath/GL/matrix.js"/>
<file name="cocoa/CCAffineTransform.js"/>
<file name="support/CCPointExtension.js"/>
<file name="support/CCPNGReader.js"/>
<file name="support/CCTIFFReader.js"/>
<file name="support/CCUserDefault.js"/>
<file name="support/CCVertex.js"/>
<file name="support/TransformUtils.js"/>
<file name="support/component/CCComponent.js"/>
<file name="support/component/CCComponentContainer.js"/>
<file name="shaders/CCShaders.js"/>
<file name="shaders/CCShaderCache.js"/>
<file name="shaders/CCGLProgram.js"/>
<file name="shaders/CCGLStateCache.js"/>
<file name="shaders/CCShaderCache.js"/>
<file name="base_nodes/CCNode.js"/>
<file name="base_nodes/CCdomNode.js"/>
<file name="base_nodes/CCAtlasNode.js"/>
<file name="textures/CCTexture2D.js"/>
<file name="textures/CCTextureCache.js"/>
<file name="textures/CCTextureAtlas.js"/>
<file name="misc_nodes/CCRenderTexture.js"/>
<file name="misc_nodes/CCProgressTimer.js"/>
<file name="misc_nodes/CCClippingNode.js"/>
<file name="misc_nodes/CCMotionStreak.js"/>
<file name="render_texture/CCRenderTexture.js"/>
<file name="motion_streak/CCMotionStreak.js"/>
<file name="clipping_nodes/CCClippingNode.js"/>
<file name="effects/CCGrid.js"/>
<file name="effects/CCGrabber.js"/>
<file name="draw_nodes/CCDrawNode.js"/>
<file name="actions/CCAction.js"/>
<file name="actions/CCActionInterval.js"/>
<file name="actions/CCActionInstant.js"/>
<file name="actions/CCActionManager.js"/>
<file name="actions/CCActionProgressTimer.js"/>
<file name="actions/CCActionCamera.js"/>
<file name="actions/CCActionEase.js"/>
<file name="actions/CCActionGrid.js"/>
<file name="actions/CCActionGrid3D.js"/>
<file name="actions/CCActionPageTurn3D.js"/>
<file name="actions/CCActionTiledGrid.js"/>
<file name="actions/CCActionTween.js"/>
<file name="actions/CCActionCatmullRom.js"/>
<file name="layers_scenes_transitions_nodes/CCScene.js"/>
<file name="layers_scenes_transitions_nodes/CCLayer.js"/>
<file name="layers_scenes_transitions_nodes/CCTransition.js"/>
<file name="layers_scenes_transitions_nodes/CCTransitionProgress.js"/>
<file name="layers_scenes_transitions_nodes/CCTransitionPageTurn.js"/>
<file name="sprite_nodes/CCSprite.js"/>
<file name="sprite_nodes/CCAnimation.js"/>
<file name="sprite_nodes/CCAnimationCache.js"/>
<file name="sprite_nodes/CCSpriteFrame.js"/>
<file name="sprite_nodes/CCSpriteFrameCache.js"/>
<file name="sprite_nodes/CCSpriteBatchNode.js"/>
<file name="actions/CCActionTween.js"/>
<file name="actions3d/CCActionGrid.js"/>
<file name="actions3d/CCActionGrid3D.js"/>
<file name="actions3d/CCActionTiledGrid.js"/>
<file name="actions3d/CCActionPageTurn3D.js"/>
<file name="progress_timer/CCProgressTimer.js"/>
<file name="progress_timer/CCActionProgressTimer.js"/>
<file name="transitions_nodes/CCTransition.js"/>
<file name="transitions_nodes/CCTransitionProgress.js"/>
<file name="transitions_nodes/CCTransitionPageTurn.js"/>
<file name="label_nodes/CCLabelAtlas.js"/>
<file name="label_nodes/CCLabelTTF.js"/>
<file name="label_nodes/CCLabelBMFont.js"/>
<file name="compress/ZipUtils.js"/>
<file name="compress/base64.js"/>
<file name="compress/gzip.js"/>
<file name="compress/zlib.min.js"/>
<file name="particle_nodes/CCPNGReader.js"/>
<file name="particle_nodes/CCTIFFReader.js"/>
<file name="particle_nodes/CCParticleSystem.js"/>
<file name="particle_nodes/CCParticleBatchNode.js"/>
<file name="particle_nodes/CCParticleExamples.js"/>
<file name="particle_nodes/CCParticleBatchNode.js"/>
<file name="touch_dispatcher/CCTouchDelegateProtocol.js"/>
<file name="touch_dispatcher/CCTouchHandler.js"/>
<file name="touch_dispatcher/CCTouchDispatcher.js"/>
<file name="touch_dispatcher/CCMouseDispatcher.js"/>
<file name="keyboard_dispatcher/CCKeyboardDelegate.js"/>
<file name="keyboard_dispatcher/CCKeyboardDispatcher.js"/>
<file name="accelerometer/CCAccelerometer.js"/>
<file name="text_input_node/CCIMEDispatcher.js"/>
<file name="text_input_node/CCTextFieldTTF.js"/>
<file name="draw_nodes/CCDrawNode.js" />
<file name="physics_nodes/CCPhysicsDebugNode.js" />
<file name="physics_nodes/CCPhysicsSprite.js" />
<file name="CCConfiguration.js"/>
<file name="CCDirector.js"/>
<file name="CCCamera.js"/>
<file name="CCScheduler.js"/>
<file name="CCLoader.js"/>
<file name="CCDrawingPrimitives.js"/>
<file name="platform/CCApplication.js"/>
<file name="platform/CCSAXParser.js"/>
<file name="platform/AppControl.js"/>
<file name="menu_nodes/CCMenuItem.js"/>
<file name="menu_nodes/CCMenu.js"/>
<file name="tileMap_parallax_nodes/CCTMXTiledMap.js"/>
<file name="tileMap_parallax_nodes/CCTMXXMLParser.js"/>
<file name="tileMap_parallax_nodes/CCTMXObjectGroup.js"/>
<file name="tileMap_parallax_nodes/CCTMXLayer.js"/>
<file name="tileMap_parallax_nodes/CCParallaxNode.js"/>
</sources>
<sources dir="${basedir}/../CocosDenshion">
<file name="SimpleAudioEngine.js"/>
</sources>
<file name="tileMap_nodes/CCTGAlib.js"/>
<file name="tileMap_nodes/CCTMXTiledMap.js"/>
<file name="tileMap_nodes/CCTMXXMLParser.js"/>
<file name="tileMap_nodes/CCTMXObjectGroup.js"/>
<file name="tileMap_nodes/CCTMXLayer.js"/>
<file name="parallax_nodes/CCParallaxNode.js"/>
<file name="audio/SimpleAudioEngine.js"/>
<file name="CCUserDefault.js"/>
<file name="CCImage.js"/>
<!-- extensions -->
<sources dir="${basedir}/../extensions">
<file name="CCBReader/CCBReaderUtil.js"/>
Expand Down Expand Up @@ -159,8 +152,10 @@
<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/CCdomNode.js"/>
<file name="CCEditBox/CCEditBox.js"/>
<file name="CocoStudio/Components/CCComponent.js"/>
<file name="CocoStudio/Components/CCComponentContainer.js"/>
<file name="CocoStudio/CocoStudio.js"/>
<file name="CocoStudio/Armature/utils/CCArmatureDefine.js"/>
<file name="CocoStudio/Armature/utils/CCDataReaderHelper.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
12 changes: 6 additions & 6 deletions HelloHTML5World/src/myApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,20 @@ var Helloworld = cc.Layer.extend({
function () {
history.go(-1);
},this);
closeItem.setAnchorPoint(cc.p(0.5, 0.5));
closeItem.setAnchorPoint(0.5, 0.5);

var menu = cc.Menu.create(closeItem);
menu.setPosition(cc.PointZero());
menu.setPosition(0,0);
this.addChild(menu, 1);
closeItem.setPosition(cc.p(size.width - 20, 20));
closeItem.setPosition(size.width - 20, 20);

/////////////////////////////
// 3. add your codes below...
// add a label shows "Hello World"
// create and initialize a label
this.helloLabel = cc.LabelTTF.create("Hello World", "Arial", 38);
// position the label on the center of the screen
this.helloLabel.setPosition(cc.p(size.width / 2, 0));
this.helloLabel.setPosition(size.width / 2, 0);
// add the label as a child to this layer
this.addChild(this.helloLabel, 5);

Expand All @@ -72,7 +72,7 @@ var Helloworld = cc.Layer.extend({

// add "HelloWorld" splash screen"
this.sprite = cc.Sprite.create("res/HelloWorld.png");
this.sprite.setPosition(cc.p(size.width / 2, size.height / 2));
this.sprite.setPosition(size.width / 2, size.height / 2);
this.sprite.setScale(0.5);
this.sprite.setRotation(180);

Expand All @@ -97,7 +97,7 @@ var Helloworld = cc.Layer.extend({
onTouchesMoved:function (touches, event) {
if (this.isMouseDown) {
if (touches) {
//this.circle.setPosition(cc.p(touches[0].getLocation().x, touches[0].getLocation().y));
//this.circle.setPosition(touches[0].getLocation().x, touches[0].getLocation().y);
}
}
},
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 5 additions & 3 deletions cocos2d/actions/CCActionCatmullRom.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@ cc.CardinalSplineTo = cc.ActionInterval.extend(/** @lends cc.CardinalSplineTo# *
cc.ActionInterval.prototype.startWithTarget.call(this, target);
// Issue #1441 from cocos2d-iphone
this._deltaT = 1 / (this._points.length - 1);

this._previousPosition = this._target.getPosition();
var locPosition = this._target.getPosition();
this._previousPosition = cc.p(locPosition.x, locPosition.y);
this._accumulatedDiff = cc.p(0, 0);
},

Expand Down Expand Up @@ -303,7 +303,9 @@ cc.CardinalSplineBy = cc.CardinalSplineTo.extend(/** @lends cc.CardinalSplineBy#
*/
startWithTarget:function (target) {
cc.CardinalSplineTo.prototype.startWithTarget.call(this, target);
this._startPosition = target.getPosition();
var locPosition = target.getPosition();
this._startPosition.x = locPosition.x;
this._startPosition.y = locPosition.y;
},

/**
Expand Down
8 changes: 3 additions & 5 deletions cocos2d/actions/CCActionManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,9 @@ cc.ActionManager = cc.Class.extend({
var limit = element.actions.length;
for (var i = 0; i < limit; ++i) {
var action = element.actions[i];
if (action) {
if (action.getTag() === tag && action.getOriginalTarget() == target) {
this._removeActionAtIndex(i, element);
break;
}
if (action && action.getTag() === tag && action.getOriginalTarget() == target) {
this._removeActionAtIndex(i, element);
break;
}
}
}
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ cc.Lens3D = cc.Grid3DAction.extend(/** @lends cc.Lens3D# */{
ctor:function () {
cc.GridAction.prototype.ctor.call(this);

this._position = cc.p(0, 0);
this._position = cc._pConst(0, 0);
this._radius = 0;
this._lensEffect = 0;
this._concave = false;
Expand Down Expand Up @@ -366,7 +366,7 @@ cc.Lens3D = cc.Grid3DAction.extend(/** @lends cc.Lens3D# */{
* @return {cc.Point}
*/
getPosition:function () {
return cc.p(this._position.x,this._position.y);
return this._position;
},

/**
Expand All @@ -375,8 +375,8 @@ cc.Lens3D = cc.Grid3DAction.extend(/** @lends cc.Lens3D# */{
*/
setPosition:function (position) {
if (!cc.pointEqualToPoint(position, this._position)) {
this._position.x = position.x;
this._position.y = position.y;
this._position._x = position.x;
this._position._y = position.y;
this._dirty = true;
}
},
Expand All @@ -391,8 +391,6 @@ cc.Lens3D = cc.Grid3DAction.extend(/** @lends cc.Lens3D# */{
*/
initWithDuration:function (duration, gridSize, position, radius) {
if (cc.Grid3DAction.prototype.initWithDuration.call(this, duration, gridSize)) {
this._position.x = -1;
this._position.y = -1;
this.setPosition(position);
this._radius = radius;
this._lensEffect = 0.7;
Expand Down Expand Up @@ -475,7 +473,7 @@ cc.Ripple3D = cc.Grid3DAction.extend(/** @lends cc.Ripple3D# */{
ctor:function () {
cc.GridAction.prototype.ctor.call(this);

this._position = cc.p(0,0);
this._position = cc._pConst(0, 0);
this._radius = 0;
this._waves = 0;
this._amplitude = 0;
Expand All @@ -487,16 +485,16 @@ cc.Ripple3D = cc.Grid3DAction.extend(/** @lends cc.Ripple3D# */{
* @return {cc.Point}
*/
getPosition:function () {
return cc.p(this._position.x, this._position.y);
return this._position;
},

/**
* set center position
* @param {cc.Point} position
*/
setPosition:function (position) {
this._position.x = position.x;
this._position.y = position.y;
this._position._x = position.x;
this._position._y = position.y;
},

/**
Expand Down Expand Up @@ -888,7 +886,7 @@ cc.Twirl = cc.Grid3DAction.extend({
ctor:function () {
cc.GridAction.prototype.ctor.call(this);

this._position = cc.p(0,0);
this._position = cc._pConst(0, 0);
this._twirls = 0;
this._amplitude = 0;
this._amplitudeRate = 0;
Expand All @@ -899,16 +897,16 @@ cc.Twirl = cc.Grid3DAction.extend({
* @return {cc.Point}
*/
getPosition:function () {
return cc.p(this._position.x, this._position.y);
return this._position;
},

/**
* set twirl center
* @param {cc.Point} position
*/
setPosition:function (position) {
this._position.x = position.x;
this._position.y = position.y;
this._position._x = position.x;
this._position._y = position.y;
},

/**
Expand Down
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 660d655

Please sign in to comment.