diff --git a/CCBoot.js b/CCBoot.js index 659a6301b5..d89458871a 100644 --- a/CCBoot.js +++ b/CCBoot.js @@ -23,7 +23,6 @@ THE SOFTWARE. ****************************************************************************/ -cc._tmp = cc._tmp || {}; cc._LogInfos = cc._LogInfos || {}; /** diff --git a/DebugInfos.js b/DebugInfos.js index bb66631b62..55d8b92a6e 100644 --- a/DebugInfos.js +++ b/DebugInfos.js @@ -237,8 +237,6 @@ if (CC_DEBUG) { "3115": "Frame Grabber: could not attach texture to framebuffer", //CCGrabber.grab "3116": "WebGLRenderingContext.CLAMP_TO_EDGE should be used in NPOT textures", //setTexParameters "3117": "Mimpap texture only works in POT textures", //generateMipmap - //MissingFile: 3200 - "3200": "Missing file: %s", //MissingFile //RectWidth: 3300 "3300": "Rect width exceeds maximum margin: %s", //RectWidth //RectHeight: 3400 diff --git a/cocos2d/actions/index.js b/cocos2d/actions/index.js index 0b91c2c40a..ed6f20abc1 100644 --- a/cocos2d/actions/index.js +++ b/cocos2d/actions/index.js @@ -1,6 +1,6 @@ -require('./CCActionManager.js'); -require('./CCAction.js'); -require('./CCActionInterval.js'); -require('./CCActionInstant.js'); -require('./CCActionEase.js'); -require('./CCActionCatmullRom.js'); \ No newline at end of file +require('./CCActionManager'); +require('./CCAction'); +require('./CCActionInterval'); +require('./CCActionInstant'); +require('./CCActionEase'); +require('./CCActionCatmullRom'); \ No newline at end of file diff --git a/cocos2d/audio/CCAudio.js b/cocos2d/audio/CCAudio.js index e86787a786..12175071e6 100644 --- a/cocos2d/audio/CCAudio.js +++ b/cocos2d/audio/CCAudio.js @@ -85,8 +85,17 @@ Audio.State = { (function (proto) { proto.preload = function () { - var src = this._src, - audio = this; + var src = this._src, audio = this; + + if (!src) { + this._src = ''; + this._audioType = Audio.Type.UNKNOWN; + this._element = null; + this._state = Audio.State.INITIALZING; + this._loaded = false; + return; + } + var item = cc.loader.getItem(src); if (!item) { diff --git a/cocos2d/core/base-nodes/BaseNodesPropertyDefine.js b/cocos2d/core/base-nodes/BaseNodesPropertyDefine.js deleted file mode 100644 index 651f193670..0000000000 --- a/cocos2d/core/base-nodes/BaseNodesPropertyDefine.js +++ /dev/null @@ -1,60 +0,0 @@ -/**************************************************************************** - Copyright (c) 2013-2016 Chukong Technologies Inc. - - http://www.cocos.com - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated engine source code (the "Software"), a limited, - worldwide, royalty-free, non-assignable, revocable and non-exclusive license - to use Cocos Creator solely to develop games on your target platforms. You shall - not use Cocos Creator software for developing other software or tools that's - used for developing games. You are not granted to publish, distribute, - sublicense, and/or sell copies of Cocos Creator. - - The software or tools in this License Agreement are licensed, not sold. - Chukong Aipu reserves all rights not expressly granted to you. - - 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. - ****************************************************************************/ - -cc._tmp.PrototypeCCNode = function () { - - var _p = _ccsg.Node.prototype; - - cc.defineGetterSetter(_p, "x", _p.getPositionX, _p.setPositionX); - cc.defineGetterSetter(_p, "y", _p.getPositionY, _p.setPositionY); - cc.defineGetterSetter(_p, "width", _p._getWidth, _p._setWidth); - cc.defineGetterSetter(_p, "height", _p._getHeight, _p._setHeight); - cc.defineGetterSetter(_p, "anchorX", _p._getAnchorX, _p._setAnchorX); - cc.defineGetterSetter(_p, "anchorY", _p._getAnchorY, _p._setAnchorY); - cc.defineGetterSetter(_p, "skewX", _p.getSkewX, _p.setSkewX); - cc.defineGetterSetter(_p, "skewY", _p.getSkewY, _p.setSkewY); - cc.defineGetterSetter(_p, "zIndex", _p.getLocalZOrder, _p.setLocalZOrder); - cc.defineGetterSetter(_p, "vertexZ", _p.getVertexZ, _p.setVertexZ); - cc.defineGetterSetter(_p, "rotation", _p.getRotation, _p.setRotation); - cc.defineGetterSetter(_p, "rotationX", _p.getRotationX, _p.setRotationX); - cc.defineGetterSetter(_p, "rotationY", _p.getRotationY, _p.setRotationY); - cc.defineGetterSetter(_p, "scale", _p.getScale, _p.setScale); - cc.defineGetterSetter(_p, "scaleX", _p.getScaleX, _p.setScaleX); - cc.defineGetterSetter(_p, "scaleY", _p.getScaleY, _p.setScaleY); - cc.defineGetterSetter(_p, "children", _p.getChildren); - cc.defineGetterSetter(_p, "childrenCount", _p.getChildrenCount); - cc.defineGetterSetter(_p, "parent", _p.getParent, _p.setParent); - cc.defineGetterSetter(_p, "visible", _p.isVisible, _p.setVisible); - cc.defineGetterSetter(_p, "running", _p.isRunning); - cc.defineGetterSetter(_p, "ignoreAnchor", _p.isIgnoreAnchorPointForPosition, _p.setIgnoreAnchorPointForPosition); - cc.defineGetterSetter(_p, "scheduler", _p.getScheduler, _p.setScheduler); - //cc.defineGetterSetter(_p, "boundingBox", _p.getBoundingBox); - cc.defineGetterSetter(_p, "shaderProgram", _p.getShaderProgram, _p.setShaderProgram); - cc.defineGetterSetter(_p, "opacity", _p.getOpacity, _p.setOpacity); - cc.defineGetterSetter(_p, "opacityModifyRGB", _p.isOpacityModifyRGB); - cc.defineGetterSetter(_p, "cascadeOpacity", _p.isCascadeOpacityEnabled, _p.setCascadeOpacityEnabled); - cc.defineGetterSetter(_p, "color", _p.getColor, _p.setColor); - cc.defineGetterSetter(_p, "cascadeColor", _p.isCascadeColorEnabled, _p.setCascadeColorEnabled); -}; \ No newline at end of file diff --git a/cocos2d/core/base-nodes/CCSGNode.js b/cocos2d/core/base-nodes/CCSGNode.js index 1e9a2d16b2..4856e1f5ed 100644 --- a/cocos2d/core/base-nodes/CCSGNode.js +++ b/cocos2d/core/base-nodes/CCSGNode.js @@ -24,6 +24,8 @@ THE SOFTWARE. ****************************************************************************/ +var Misc = require('../utils/misc'); + var ActionManagerExist = !!cc.ActionManager; var emptyFunc = function () {}; @@ -2191,6 +2193,22 @@ _ccsg.Node.performType = { _ccsg.Node._performStacks = [[]]; _ccsg.Node._performing = 0; -cc.assertID(typeof cc._tmp.PrototypeCCNode === 'function', 3200, "BaseNodesPropertyDefine.js"); -cc._tmp.PrototypeCCNode(); -delete cc._tmp.PrototypeCCNode; + +var SameNameGetSets = ['skewX', 'skewY', 'vertexZ', 'rotation', 'rotationX', 'rotationY', 'scale', 'scaleX', 'scaleY', + 'children', 'childrenCount', 'parent', 'scheduler', 'shaderProgram', 'opacity', 'color']; +var DiffNameGetSets = { + x: ['getPositionX', 'setPositionX'], + y: ['getPositionY', 'setPositionY'], + width: ['_getWidth', '_setWidth'], + height: ['_getHeight', '_setHeight'], + anchorX: ['_getAnchorX', '_setAnchorX'], + anchorY: ['_getAnchorY', '_setAnchorY'], + zIndex: ['getLocalZOrder', 'setLocalZOrder'], + visible: ['isVisible', 'setVisible'], + running: ['isRunning'], + ignoreAnchor: ['isIgnoreAnchorPointForPosition', 'setIgnoreAnchorPointForPosition'], + opacityModifyRGB: ['isOpacityModifyRGB', 'setOpacityModifyRGB'], + cascadeOpacity: ['isCascadeOpacityEnabled', 'setCascadeOpacityEnabled'], + cascadeColor: ['isCascadeColorEnabled', 'setCascadeColorEnabled'], +}; +Misc.propertyDefine(_ccsg.Node, SameNameGetSets, DiffNameGetSets); diff --git a/cocos2d/core/components/CCAudioSource.js b/cocos2d/core/components/CCAudioSource.js index 91d2cd5a44..37da741dd2 100644 --- a/cocos2d/core/components/CCAudioSource.js +++ b/cocos2d/core/components/CCAudioSource.js @@ -41,7 +41,11 @@ var AudioSource = cc.Class({ }, ctor: function () { - this.audio = new cc.Audio(this._clip); + this.audio = new cc.Audio(); + }, + + onLoad: function () { + this.clip = this._clip; }, properties: { diff --git a/cocos2d/core/components/CCEditBox.js b/cocos2d/core/components/CCEditBox.js index 31f7c4c577..82e8896670 100644 --- a/cocos2d/core/components/CCEditBox.js +++ b/cocos2d/core/components/CCEditBox.js @@ -24,7 +24,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -require('../editbox/CCSGEditBox.js'); +require('../editbox/CCSGEditBox'); /** * !#en Enum for keyboard return types * !#zh 键盘的返回键类型 diff --git a/cocos2d/core/components/CCLabel.js b/cocos2d/core/components/CCLabel.js index f7b9073255..847608dd48 100644 --- a/cocos2d/core/components/CCLabel.js +++ b/cocos2d/core/components/CCLabel.js @@ -22,9 +22,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -require('../label/CCSGLabel.js'); -require('../label/CCSGLabelCanvasRenderCmd.js'); -require('../label/CCSGLabelWebGLRenderCmd.js'); +require('../label/CCSGLabel'); +require('../label/CCSGLabelCanvasRenderCmd'); +require('../label/CCSGLabelWebGLRenderCmd'); /** * !#en Enum for text alignment. * !#zh 文本横向对齐类型 diff --git a/cocos2d/core/components/CCMask.js b/cocos2d/core/components/CCMask.js index 5d82d439e0..95b26646f9 100644 --- a/cocos2d/core/components/CCMask.js +++ b/cocos2d/core/components/CCMask.js @@ -22,9 +22,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -require('../../clipping-nodes/CCClippingNode.js'); -require('../../clipping-nodes/CCClippingNodeCanvasRenderCmd.js'); -require('../../clipping-nodes/CCClippingNodeWebGLRenderCmd.js'); +require('../../clipping-nodes/CCClippingNode'); +require('../../clipping-nodes/CCClippingNodeCanvasRenderCmd'); +require('../../clipping-nodes/CCClippingNodeWebGLRenderCmd'); var Base = cc._RendererInSG; /** diff --git a/cocos2d/core/components/CCRichText.js b/cocos2d/core/components/CCRichText.js index a02d4b2a8b..1b8b06f018 100644 --- a/cocos2d/core/components/CCRichText.js +++ b/cocos2d/core/components/CCRichText.js @@ -22,8 +22,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -require('../label/CCHtmlTextParser.js'); -require('../label/CCTextUtils.js'); +require('../label/CCHtmlTextParser'); +require('../label/CCTextUtils'); var HorizontalAlign = cc.TextAlignment; var VerticalAlign = cc.VerticalTextAlignment; diff --git a/cocos2d/core/components/CCToggle.js b/cocos2d/core/components/CCToggle.js index a65605ab18..541fdc0983 100644 --- a/cocos2d/core/components/CCToggle.js +++ b/cocos2d/core/components/CCToggle.js @@ -32,7 +32,7 @@ */ var Toggle = cc.Class({ name: 'cc.Toggle', - extends: require('./CCButton.js'), + extends: require('./CCButton'), editor: CC_EDITOR && { menu: 'i18n:MAIN_MENU.component.ui/Toggle', help: 'i18n:COMPONENT.help_url.toggle', diff --git a/cocos2d/core/components/CCVideoPlayer.js b/cocos2d/core/components/CCVideoPlayer.js index 020c5830cf..07dce51579 100644 --- a/cocos2d/core/components/CCVideoPlayer.js +++ b/cocos2d/core/components/CCVideoPlayer.js @@ -20,7 +20,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -require('../videoplayer/CCSGVideoPlayer.js'); +require('../videoplayer/CCSGVideoPlayer'); /** * !#en Video event type * !#zh 视频事件类型 diff --git a/cocos2d/core/components/CCWebView.js b/cocos2d/core/components/CCWebView.js index bffe016a37..8b52f806fb 100644 --- a/cocos2d/core/components/CCWebView.js +++ b/cocos2d/core/components/CCWebView.js @@ -20,7 +20,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -require('../webview/CCSGWebView.js'); +require('../webview/CCSGWebView'); /** * !#en WebView event type * !#zh 网页视图事件类型 diff --git a/cocos2d/core/event/index.js b/cocos2d/core/event/index.js index 77efb8a72d..f275852a85 100644 --- a/cocos2d/core/event/index.js +++ b/cocos2d/core/event/index.js @@ -23,6 +23,6 @@ THE SOFTWARE. ****************************************************************************/ -require('./event.js'); -require('./event-listeners.js'); -require('./event-target.js'); \ No newline at end of file +require('./event'); +require('./event-listeners'); +require('./event-target'); \ No newline at end of file diff --git a/cocos2d/core/label/CCSGLabel.js b/cocos2d/core/label/CCSGLabel.js index 790f958869..44bccc2ba0 100644 --- a/cocos2d/core/label/CCSGLabel.js +++ b/cocos2d/core/label/CCSGLabel.js @@ -23,7 +23,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -require('./CCTextUtils.js'); +require('./CCTextUtils'); var EventTarget = require("../event/event-target"); var JS = require("../platform/js"); diff --git a/cocos2d/core/physics/CCPolygonSeprator.js b/cocos2d/core/physics/CCPolygonSeparator.js similarity index 98% rename from cocos2d/core/physics/CCPolygonSeprator.js rename to cocos2d/core/physics/CCPolygonSeparator.js index 22ccabd6ac..dd14c21500 100644 --- a/cocos2d/core/physics/CCPolygonSeprator.js +++ b/cocos2d/core/physics/CCPolygonSeparator.js @@ -312,4 +312,8 @@ function Area(a, b, c) { return a.x * (b.y - c.y) + b.x * (c.y - a.y) + c.x * (a.y - b.y); } -module.exports = ConvexPartition; +module.exports = { + ConvexPartition: ConvexPartition, + ForceCounterClockWise: ForceCounterClockWise, + IsCounterClockWise: IsCounterClockWise +}; diff --git a/cocos2d/core/physics/collider/CCPhysicsPolygonCollider.js b/cocos2d/core/physics/collider/CCPhysicsPolygonCollider.js index cc946132db..c61d6438f0 100644 --- a/cocos2d/core/physics/collider/CCPhysicsPolygonCollider.js +++ b/cocos2d/core/physics/collider/CCPhysicsPolygonCollider.js @@ -24,7 +24,7 @@ ****************************************************************************/ var PTM_RATIO = require('../CCPhysicsTypes').PTM_RATIO; -var PolygonSeprator = require('../CCPolygonSeprator'); +var PolygonSeparator = require('../CCPolygonSeparator'); /** * @class PhysicsPolygonCollider @@ -52,7 +52,7 @@ var PhysicsPolygonCollider = cc.Class({ points.length -= 1; } - var polys = PolygonSeprator(points); + var polys = PolygonSeparator.ConvexPartition(points); var offset = this.offset; for (var i = 0; i < polys.length; i++) { diff --git a/cocos2d/core/platform/CCMacro.js b/cocos2d/core/platform/CCMacro.js index 67be251354..5c295430a5 100644 --- a/cocos2d/core/platform/CCMacro.js +++ b/cocos2d/core/platform/CCMacro.js @@ -26,8 +26,6 @@ require('./_CCClass'); -cc._tmp = cc._tmp || {}; - /** * !#en Key map for keyboard event * !#zh 键盘事件的按键值 diff --git a/cocos2d/core/sprites/CCSGSprite.js b/cocos2d/core/sprites/CCSGSprite.js index edad263bae..b1dba14cb0 100644 --- a/cocos2d/core/sprites/CCSGSprite.js +++ b/cocos2d/core/sprites/CCSGSprite.js @@ -25,6 +25,7 @@ ****************************************************************************/ var EventTarget = require("../event/event-target"); +var Misc = require('../utils/misc'); /** *
_ccsg.Sprite is a 2d image ( http://en.wikipedia.org/wiki/Sprite_(computer_graphics) )
@@ -757,7 +758,13 @@ _ccsg.Sprite = _ccsg.Node.extend({
cc.js.addon(_ccsg.Sprite.prototype, EventTarget.prototype);
-
-cc.assertID(typeof cc._tmp.PrototypeSprite === 'function', 3200, "SpritesPropertyDefine.js");
-cc._tmp.PrototypeSprite();
-delete cc._tmp.PrototypeSprite;
+var SameNameGetSets = ['opacity', 'color', 'texture', 'quad'];
+var DiffNameGetSets = {
+ opacityModifyRGB: ['isOpacityModifyRGB', 'setOpacityModifyRGB'],
+ flippedX: ['isFlippedX', 'setFlippedX'],
+ flippedY: ['isFlippedY', 'setFlippedY'],
+ offsetX: ['_getOffsetX'],
+ offsetY: ['_getOffsetY'],
+ textureRectRotated: ['isTextureRectRotated'],
+};
+Misc.propertyDefine(_ccsg.Sprite, SameNameGetSets, DiffNameGetSets);
diff --git a/cocos2d/core/sprites/SpritesPropertyDefine.js b/cocos2d/core/sprites/SpritesPropertyDefine.js
deleted file mode 100644
index 59517de287..0000000000
--- a/cocos2d/core/sprites/SpritesPropertyDefine.js
+++ /dev/null
@@ -1,67 +0,0 @@
-/****************************************************************************
- Copyright (c) 2008-2010 Ricardo Quesada
- Copyright (c) 2011-2012 cocos2d-x.org
- Copyright (c) 2013-2014 Chukong Technologies 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.
- ****************************************************************************/
-
-cc._tmp.PrototypeSprite = function () {
- var _p = _ccsg.Sprite.prototype;
-
- // Override properties
- cc.defineGetterSetter(_p, "opacityModifyRGB", _p.isOpacityModifyRGB, _p.setOpacityModifyRGB);
- cc.defineGetterSetter(_p, "opacity", _p.getOpacity, _p.setOpacity);
- cc.defineGetterSetter(_p, "color", _p.getColor, _p.setColor);
-
- // Extended properties
- /** @expose */
- _p.dirty;
- /** @expose */
- _p.flippedX;
- cc.defineGetterSetter(_p, "flippedX", _p.isFlippedX, _p.setFlippedX);
- /** @expose */
- _p.flippedY;
- cc.defineGetterSetter(_p, "flippedY", _p.isFlippedY, _p.setFlippedY);
- /** @expose */
- _p.offsetX;
- cc.defineGetterSetter(_p, "offsetX", _p._getOffsetX);
- /** @expose */
- _p.offsetY;
- cc.defineGetterSetter(_p, "offsetY", _p._getOffsetY);
- /** @expose */
- _p.atlasIndex;
- /** @expose */
- _p.texture;
- cc.defineGetterSetter(_p, "texture", _p.getTexture, _p.setTexture);
- /** @expose */
- _p.textureRectRotated;
- cc.defineGetterSetter(_p, "textureRectRotated", _p.isTextureRectRotated);
- /** @expose */
- _p.textureAtlas;
- /** @expose */
- _p.batchNode;
- cc.defineGetterSetter(_p, "batchNode", _p.getBatchNode, _p.setBatchNode);
- /** @expose */
- _p.quad;
- cc.defineGetterSetter(_p, "quad", _p.getQuad);
-
-};
diff --git a/cocos2d/index.js b/cocos2d/index.js
index b2a17e0c0d..e51e1bd471 100644
--- a/cocos2d/index.js
+++ b/cocos2d/index.js
@@ -3,25 +3,23 @@ require('./core/CCGame');
// ensure modular-cocos2d can determine whether action module is included
require('./actions');
-require('./core/base-nodes/BaseNodesPropertyDefine.js');
-require('./core/base-nodes/CCSGNode.js');
-require('./core/base-nodes/CCSGNodeCanvasRenderCmd.js');
-require('./core/base-nodes/CCSGNodeWebGLRenderCmd.js');
-require('./core/scenes/CCSGScene.js');
-require('./core/CCConfiguration.js');
-require('./core/CCDrawingPrimitivesCanvas.js');
-require('./core/CCDrawingPrimitivesWebGL.js');
-require('./core/sprites/SpritesPropertyDefine.js');
-require('./core/sprites/CCSGSprite.js');
-require('./core/sprites/CCSGSpriteCanvasRenderCmd.js');
-require('./core/sprites/CCSGSpriteWebGLRenderCmd.js');
-require('./core/sprites/CCScale9Sprite.js');
-require('./core/sprites/CCScale9SpriteCanvasRenderCmd.js');
-require('./core/sprites/CCScale9SpriteWebGLRenderCmd.js');
-require('./core/sprites/CCSpriteBatchNode.js');
-require('./shape-nodes/CCDrawNode.js');
-require('./shape-nodes/CCDrawNodeCanvasRenderCmd.js');
-require('./shape-nodes/CCDrawNodeWebGLRenderCmd.js');
-require('./render-texture/CCRenderTexture.js');
-require('./render-texture/CCRenderTextureCanvasRenderCmd.js');
-require('./render-texture/CCRenderTextureWebGLRenderCmd.js');
+require('./core/base-nodes/CCSGNode');
+require('./core/base-nodes/CCSGNodeCanvasRenderCmd');
+require('./core/base-nodes/CCSGNodeWebGLRenderCmd');
+require('./core/scenes/CCSGScene');
+require('./core/CCConfiguration');
+require('./core/CCDrawingPrimitivesCanvas');
+require('./core/CCDrawingPrimitivesWebGL');
+require('./core/sprites/CCSGSprite');
+require('./core/sprites/CCSGSpriteCanvasRenderCmd');
+require('./core/sprites/CCSGSpriteWebGLRenderCmd');
+require('./core/sprites/CCScale9Sprite');
+require('./core/sprites/CCScale9SpriteCanvasRenderCmd');
+require('./core/sprites/CCScale9SpriteWebGLRenderCmd');
+require('./core/sprites/CCSpriteBatchNode');
+require('./shape-nodes/CCDrawNode');
+require('./shape-nodes/CCDrawNodeCanvasRenderCmd');
+require('./shape-nodes/CCDrawNodeWebGLRenderCmd');
+require('./render-texture/CCRenderTexture');
+require('./render-texture/CCRenderTextureCanvasRenderCmd');
+require('./render-texture/CCRenderTextureWebGLRenderCmd');
diff --git a/cocos2d/motion-streak/CCMotionStreak.js b/cocos2d/motion-streak/CCMotionStreak.js
index a00b264f62..0c57416bda 100644
--- a/cocos2d/motion-streak/CCMotionStreak.js
+++ b/cocos2d/motion-streak/CCMotionStreak.js
@@ -22,8 +22,8 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
-require('./CCSGMotionStreak.js');
-require('./CCSGMotionStreakWebGLRenderCmd.js');
+require('./CCSGMotionStreak');
+require('./CCSGMotionStreakWebGLRenderCmd');
/**
* !#en
* cc.MotionStreak manages a Ribbon based on it's motion in absolute space.
diff --git a/cocos2d/particle/CCParticleSystem.js b/cocos2d/particle/CCParticleSystem.js
index ad28f3d403..751fd10b85 100644
--- a/cocos2d/particle/CCParticleSystem.js
+++ b/cocos2d/particle/CCParticleSystem.js
@@ -24,12 +24,12 @@
****************************************************************************/
require('./CCParticleAsset');
-require('./CCSGParticleSystem.js');
-require('./CCSGParticleSystemCanvasRenderCmd.js');
-require('./CCSGParticleSystemWebGLRenderCmd.js');
-require('./CCParticleBatchNode.js');
-require('./CCParticleBatchNodeCanvasRenderCmd.js');
-require('./CCParticleBatchNodeWebGLRenderCmd.js');
+require('./CCSGParticleSystem');
+require('./CCSGParticleSystemCanvasRenderCmd');
+require('./CCSGParticleSystemWebGLRenderCmd');
+require('./CCParticleBatchNode');
+require('./CCParticleBatchNodeCanvasRenderCmd');
+require('./CCParticleBatchNodeWebGLRenderCmd');
var BlendFactor = cc.BlendFunc.BlendFactor;
/**
diff --git a/cocos2d/tilemap/CCSGTMXTiledMap.js b/cocos2d/tilemap/CCSGTMXTiledMap.js
index 96a6b493ff..5c6d91b93a 100644
--- a/cocos2d/tilemap/CCSGTMXTiledMap.js
+++ b/cocos2d/tilemap/CCSGTMXTiledMap.js
@@ -23,8 +23,8 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
-require('./CCSGTMXObject.js');
-require('./CCTMXXMLParser.js');
+require('./CCSGTMXObject');
+require('./CCTMXXMLParser');
/**
*
_ccsg.TMXTiledMap knows how to parse and render a TMX map.
diff --git a/cocos2d/tilemap/CCTiledLayer.js b/cocos2d/tilemap/CCTiledLayer.js index 5106655cb3..39e256c1b6 100644 --- a/cocos2d/tilemap/CCTiledLayer.js +++ b/cocos2d/tilemap/CCTiledLayer.js @@ -22,9 +22,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -require('./CCSGTMXLayer.js'); -require('./CCTMXLayerCanvasRenderCmd.js'); -require('./CCTMXLayerWebGLRenderCmd.js'); +require('./CCSGTMXLayer'); +require('./CCTMXLayerCanvasRenderCmd'); +require('./CCTMXLayerWebGLRenderCmd'); /** * !#en Render the TMX layer. * !#zh 渲染 TMX layer。 diff --git a/cocos2d/tilemap/CCTiledMap.js b/cocos2d/tilemap/CCTiledMap.js index de8e5076c0..149ef00456 100644 --- a/cocos2d/tilemap/CCTiledMap.js +++ b/cocos2d/tilemap/CCTiledMap.js @@ -26,7 +26,7 @@ require('./CCTiledMapAsset'); require('./CCTiledLayer'); require('./CCTiledObjectGroup'); -require('./CCSGTMXTiledMap.js'); +require('./CCSGTMXTiledMap'); /** * !#en The orientation of tiled map. diff --git a/cocos2d/tilemap/CCTiledObjectGroup.js b/cocos2d/tilemap/CCTiledObjectGroup.js index eec6b3756b..009932e59f 100644 --- a/cocos2d/tilemap/CCTiledObjectGroup.js +++ b/cocos2d/tilemap/CCTiledObjectGroup.js @@ -22,7 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -require('./CCSGTMXObjectGroup.js'); +require('./CCSGTMXObjectGroup'); /** * !#en Renders the TMX object group. * !#zh 渲染 tmx object group。 diff --git a/gulpfile.js b/gulpfile.js index a687e86440..9571543768 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -173,8 +173,7 @@ gulp.task('test-no-build', function (done) { // fast build, only for develop gulp.task('build-dev', ['build-html5-preview', 'build-jsb-preview'], function (done) { - // make dist version dirty - Del(['./bin/.cache'], done); + Del(['./bin/jsb_polyfill.js', './bin/jsb_polyfill.dev.js', './bin/.cache'], done); }); // only build preview for html5 since it will built by editor diff --git a/jsb/index.js b/jsb/index.js index a372eca22b..d913bd7dcb 100644 --- a/jsb/index.js +++ b/jsb/index.js @@ -117,7 +117,7 @@ require('./jsb-scale9sprite'); require('./jsb-label'); require('./jsb-editbox'); require('./jsb-videoplayer'); -require('./jsb-webview.js'); +require('./jsb-webview'); require('./jsb-particle'); require('./jsb-spine'); require('./jsb-enums');