diff --git a/jsb/index.js b/jsb/index.js index 4416f9b461..4bcff8db27 100644 --- a/jsb/index.js +++ b/jsb/index.js @@ -1,5 +1,15 @@ 'use strict'; +// cc.initEngine +cc.initEngine = function (config, cb) { + require('script/jsb.js'); + cc._renderType = cc.game.RENDER_TYPE_OPENGL; + cc._initDebugSetting(config[cc.game.CONFIG_KEY.debugMode]); + cc._engineLoaded = true; + cc.log(cc.ENGINE_VERSION); + if (cb) cb(); +}; + require('./jsb-predefine'); require('./jsb-game'); require('./jsb-director'); @@ -27,6 +37,9 @@ var _engineNumberVersion = (function () { // Version polyfills if (_engineNumberVersion) { if (_engineNumberVersion.major === 3) { + if (_engineNumberVersion.minor < 6) { + require('./versions/jsb-polyfill-v3.5'); + } if (_engineNumberVersion.minor < 9) { require('./versions/jsb-polyfill-v3.8'); } diff --git a/jsb/versions/jsb-polyfill-v3.5.js b/jsb/versions/jsb-polyfill-v3.5.js new file mode 100644 index 0000000000..4a9db30395 --- /dev/null +++ b/jsb/versions/jsb-polyfill-v3.5.js @@ -0,0 +1,31 @@ +/**************************************************************************** + Copyright (c) 2015 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. + ****************************************************************************/ + +'use strict'; + +if (!cc.Scheduler.prototype.unscheduleAllForTarget) { + cc.Scheduler.prototype.unscheduleAllForTarget = function (target) { + this.unscheduleAllCallbacksForTarget(target); + }; +} \ No newline at end of file