|
@@ -5,14 +5,11 @@ if (false) {
|
|
|
|
|
|
var loadingBool = true;
|
|
|
var loadingNum = 0;
|
|
|
-window.boot = function() {
|
|
|
-
|
|
|
+window.boot = function () {
|
|
|
var settings = window._CCSettings;
|
|
|
window._CCSettings = undefined;
|
|
|
-
|
|
|
if (!settings.debug) {
|
|
|
var uuids = settings.uuids;
|
|
|
-
|
|
|
var rawAssets = settings.rawAssets;
|
|
|
var assetTypes = settings.assetTypes;
|
|
|
var realRawAssets = settings.rawAssets = {};
|
|
@@ -66,14 +63,9 @@ window.boot = function() {
|
|
|
// Loading splash scene
|
|
|
var splash = document.getElementById('splash');
|
|
|
// var progressBar = splash.querySelector('.progress-bar span');
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- cc.loader.onProgress = function(completedCount, totalCount, item) {
|
|
|
-
|
|
|
+ cc.loader.onProgress = function (completedCount, totalCount, item) {
|
|
|
loadData.completedCount = completedCount;
|
|
|
loadData.totalCount = totalCount;
|
|
|
-
|
|
|
if (loadingBool) {
|
|
|
var loadintT = document.getElementById("loadingText")
|
|
|
}
|
|
@@ -81,7 +73,7 @@ window.boot = function() {
|
|
|
if (loadingBool && loadingNum >= 1 && totalCount > 1) {
|
|
|
if (percent.toFixed(0) >= 100) {
|
|
|
loadintT.innerHTML = 'loading......100' + '%';
|
|
|
- setTimeout(function() {
|
|
|
+ setTimeout(function () {
|
|
|
loadingBool = false;
|
|
|
loadintT.remove();
|
|
|
}, 0.1 * 1000);
|
|
@@ -108,30 +100,22 @@ window.boot = function() {
|
|
|
// if (progressBar) {
|
|
|
// progressBar.style.width = percent.toFixed(2) + '%';
|
|
|
// }
|
|
|
-
|
|
|
-
|
|
|
};
|
|
|
splash.style.display = 'block';
|
|
|
// progressBar.style.width = '0%';
|
|
|
-
|
|
|
- cc.director.once(cc.Director.EVENT_AFTER_SCENE_LAUNCH, function() {
|
|
|
+ cc.director.once(cc.Director.EVENT_AFTER_SCENE_LAUNCH, function () {
|
|
|
splash.style.display = 'none';
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- var onStart = function() {
|
|
|
-
|
|
|
+ var onStart = function () {
|
|
|
cc.loader.downloader._subpackages = settings.subpackages;
|
|
|
-
|
|
|
cc.view.enableRetina(true);
|
|
|
cc.view.resizeWithBrowserSize(true);
|
|
|
-
|
|
|
if (!false && !false) {
|
|
|
-
|
|
|
if (cc.sys.isBrowser) {
|
|
|
setLoadingDisplay();
|
|
|
}
|
|
|
-
|
|
|
if (cc.sys.isMobile) {
|
|
|
if (settings.orientation === 'landscape') {
|
|
|
cc.view.setOrientation(cc.macro.ORIENTATION_LANDSCAPE);
|
|
@@ -146,7 +130,6 @@ window.boot = function() {
|
|
|
// ].indexOf(cc.sys.browserType) < 0);
|
|
|
cc.view.enableAutoFullScreen(false);
|
|
|
}
|
|
|
-
|
|
|
// Limit downloading max concurrent task to 2,
|
|
|
// more tasks simultaneously may cause performance draw back on some android system / browsers.
|
|
|
// You can adjust the number based on your own test result, you have to set it before any loading process to take effect.
|
|
@@ -171,16 +154,13 @@ window.boot = function() {
|
|
|
// console.log('Success to load scene: ' + launchScene);
|
|
|
// }
|
|
|
// );
|
|
|
-
|
|
|
// }
|
|
|
|
|
|
var launchScene = settings.launchScene;
|
|
|
|
|
|
// load scene
|
|
|
// loadScene(launchScene);
|
|
|
-
|
|
|
var canvas;
|
|
|
-
|
|
|
if (cc.sys.isBrowser) {
|
|
|
canvas = document.getElementById('GameCanvas');
|
|
|
}
|
|
@@ -188,12 +168,6 @@ window.boot = function() {
|
|
|
console.log("landscape,", launchScene);
|
|
|
var MainManger = __require("MainManage");
|
|
|
MainManger.init(launchScene, cc.sys.isBrowser, canvas.style.visibility);
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
};
|
|
|
|
|
|
// jsList
|
|
@@ -204,7 +178,7 @@ window.boot = function() {
|
|
|
} else {
|
|
|
var bundledScript = settings.debug ? 'src/project.dev.js' : 'src/project.js';
|
|
|
if (jsList) {
|
|
|
- jsList = jsList.map(function(x) {
|
|
|
+ jsList = jsList.map(function (x) {
|
|
|
return 'src/' + x;
|
|
|
});
|
|
|
jsList.push(bundledScript);
|
|
@@ -242,7 +216,6 @@ if (false) {
|
|
|
BK.Script.loadlib('GameRes://src/settings.js');
|
|
|
BK.Script.loadlib();
|
|
|
BK.Script.loadlib('GameRes://libs/qqplay-downloader.js');
|
|
|
-
|
|
|
var ORIENTATIONS = {
|
|
|
'portrait': 1,
|
|
|
'landscape left': 2,
|
|
@@ -250,17 +223,14 @@ if (false) {
|
|
|
};
|
|
|
BK.Director.screenMode = ORIENTATIONS[window._CCSettings.orientation];
|
|
|
initAdapter();
|
|
|
- cc.game.once(cc.game.EVENT_ENGINE_INITED, function() {
|
|
|
+ cc.game.once(cc.game.EVENT_ENGINE_INITED, function () {
|
|
|
initRendererAdapter();
|
|
|
});
|
|
|
-
|
|
|
qqPlayDownloader.REMOTE_SERVER_ROOT = "";
|
|
|
var prevPipe = cc.loader.md5Pipe || cc.loader.assetLoader;
|
|
|
cc.loader.insertPipeAfter(prevPipe, qqPlayDownloader);
|
|
|
-
|
|
|
window.boot();
|
|
|
} else if (window.jsb) {
|
|
|
-
|
|
|
var isRuntime = (typeof loadRuntime === 'function');
|
|
|
if (isRuntime) {
|
|
|
require('src/settings.js');
|
|
@@ -271,7 +241,6 @@ if (false) {
|
|
|
require('src/cocos2d-jsb.js');
|
|
|
require('jsb-adapter/jsb-engine.js');
|
|
|
}
|
|
|
-
|
|
|
cc.macro.CLEANUP_IMAGE_CACHE = true;
|
|
|
window.boot();
|
|
|
}
|