diff --git a/cocos2d/core/assets/CCSpriteFrame.js b/cocos2d/core/assets/CCSpriteFrame.js index de6441f01e..da911febfa 100644 --- a/cocos2d/core/assets/CCSpriteFrame.js +++ b/cocos2d/core/assets/CCSpriteFrame.js @@ -536,8 +536,6 @@ proto.copyWithZone = proto.clone; proto.copy = proto.clone; proto.initWithTexture = proto.setTexture; -if (!CC_JSB) { - cc.SpriteFrame = SpriteFrame; -} +cc.SpriteFrame = SpriteFrame; module.exports = SpriteFrame; diff --git a/cocos2d/core/utils/index.js b/cocos2d/core/utils/index.js index 9f2686ae22..e97dc29341 100644 --- a/cocos2d/core/utils/index.js +++ b/cocos2d/core/utils/index.js @@ -25,7 +25,7 @@ ****************************************************************************/ require('./CCPath'); -if (!CC_EDITOR && !CC_JSB && !CC_WECHATGAME && !CC_QQPLAY) { +if (!CC_EDITOR) { require('./profiler/CCProfiler'); } require('./find'); diff --git a/index.js b/index.js index d78b1b3b4e..12f2f0a141 100644 --- a/index.js +++ b/index.js @@ -34,7 +34,7 @@ * @module cc * @main cc */ -cc = {}; +cc = cc || {}; require('./predefine'); require('./CCDebugger'); diff --git a/jsb/builtin/jsb-adapter/FileReader.js b/jsb/builtin/jsb-adapter/FileReader.js index 6f49201fc6..dabc8b7f44 100755 --- a/jsb/builtin/jsb-adapter/FileReader.js +++ b/jsb/builtin/jsb-adapter/FileReader.js @@ -23,12 +23,32 @@ THE SOFTWARE. ****************************************************************************/ -/* - * TODO 使用 wx.readFile 来封装 FileReader - */ -class FileReader { - construct() { - } +const EventTarget = require('./EventTarget') + +class FileReader extends EventTarget { + construct() { + this.result = null + + } + + // Aborts the read operation. Upon return, the readyState will be DONE. + abort() {} + + // Starts reading the contents of the specified Blob, once finished, the result attribute contains an ArrayBuffer representing the file's data. + readAsArrayBuffer() { + + } + + // Starts reading the contents of the specified Blob, once finished, the result attribute contains a data: URL representing the file's data. + readAsDataURL(blob) { + this.result = 'data:image/png;base64,' + window.btoa(blob); + this.onload(); + } + + // Starts reading the contents of the specified Blob, once finished, the result attribute contains the contents of the file as a text string. + readAsText() { + + } } module.exports = FileReader; diff --git a/jsb/builtin/jsb-adapter/WindowProperties.js b/jsb/builtin/jsb-adapter/WindowProperties.js deleted file mode 100755 index 58e9466855..0000000000 --- a/jsb/builtin/jsb-adapter/WindowProperties.js +++ /dev/null @@ -1,47 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - 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. - Xiamen Yaji Software Co., Ltd. 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. - ****************************************************************************/ -const { screenWidth, screenHeight, devicePixelRatio } = {screenWidth: window.innerWidth, screenHeight: window.innerHeight, devicePixelRatio: 1};//cjh wx.getSystemInfoSync() - -const innerWidth = screenWidth -const innerHeight = screenHeight -const screen = { - availWidth: innerWidth, - availHeight: innerHeight -} -const performance = null//cjh wx.getPerformance() -const ontouchstart = null -const ontouchmove = null -const ontouchend = null - -module.exports = { - innerWidth: innerWidth, - innerHeight: innerHeight, - devicePixelRatio: devicePixelRatio, - screen: screen, - performance: performance, - ontouchstart: ontouchstart, - ontouchmove: ontouchmove, - ontouchend: ontouchend -}; diff --git a/jsb/builtin/xmldom/dom-parser.js b/jsb/builtin/xmldom/dom-parser.js index b8dc100965..e45dd476f1 100644 --- a/jsb/builtin/xmldom/dom-parser.js +++ b/jsb/builtin/xmldom/dom-parser.js @@ -1,27 +1,3 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - 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. - Xiamen Yaji Software Co., Ltd. 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. - ****************************************************************************/ function DOMParser(options){ this.options = options ||{locator:{}}; diff --git a/jsb/builtin/xmldom/dom.js b/jsb/builtin/xmldom/dom.js index a44f8d7e2e..b13b3719d7 100644 --- a/jsb/builtin/xmldom/dom.js +++ b/jsb/builtin/xmldom/dom.js @@ -1,28 +1,3 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - 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. - Xiamen Yaji Software Co., Ltd. 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. - ****************************************************************************/ - /* * DOM Level 2 * Object DOMException diff --git a/jsb/builtin/xmldom/entities.js b/jsb/builtin/xmldom/entities.js index 038a5c32c0..1f7d605fbf 100644 --- a/jsb/builtin/xmldom/entities.js +++ b/jsb/builtin/xmldom/entities.js @@ -1,27 +1,3 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - 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. - Xiamen Yaji Software Co., Ltd. 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. - ****************************************************************************/ exports.entityMap = { lt: '<', gt: '>', diff --git a/jsb/builtin/xmldom/sax.js b/jsb/builtin/xmldom/sax.js index 933b26681f..f8b494e097 100644 --- a/jsb/builtin/xmldom/sax.js +++ b/jsb/builtin/xmldom/sax.js @@ -1,28 +1,3 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - 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. - Xiamen Yaji Software Co., Ltd. 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. - ****************************************************************************/ - //[4] NameStartChar ::= ":" | [A-Z] | "_" | [a-z] | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x2FF] | [#x370-#x37D] | [#x37F-#x1FFF] | [#x200C-#x200D] | [#x2070-#x218F] | [#x2C00-#x2FEF] | [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF] //[4a] NameChar ::= NameStartChar | "-" | "." | [0-9] | #xB7 | [#x0300-#x036F] | [#x203F-#x2040] //[5] Name ::= NameStartChar (NameChar)* diff --git a/jsb/jsb-audio.js b/jsb/jsb-audio.js index 94f94ebc1a..a59846a41e 100644 --- a/jsb/jsb-audio.js +++ b/jsb/jsb-audio.js @@ -48,10 +48,6 @@ cc.Audio.Type = { cc.audioEngine = audioEngine; audioEngine.play = audioEngine.play2d; audioEngine.setMaxWebAudioSize = function () {}; - // deprecated - // var Module = require('../cocos2d/audio/deprecated'); - // Module.removed(audioEngine); - // Module.deprecated(audioEngine); proto.State = audioEngine.AudioState;