forked from NingZhengsheng/ComposeGigWatermelon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgame.js
43 lines (27 loc) · 1.07 KB
/
game.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
"use strict";
require('adapter-min.js');
__globalAdapter.init();
require('cocos/cocos2d-js-min.js');
require('physics-min.js');
__globalAdapter.adaptEngine();
require('./ccRequire');
require('./src/settings'); // Introduce Cocos Service here
require('./main'); // TODO: move to common
// Adjust devicePixelRatio
cc.view._maxPixelRatio = 4; // downloader polyfill
window.wxDownloader = remoteDownloader; // handle remote downloader
remoteDownloader.REMOTE_SERVER_ROOT = "";
remoteDownloader.SUBCONTEXT_ROOT = "";
var pipeBeforeDownloader = cc.loader.subPackPipe || cc.loader.md5Pipe || cc.loader.assetLoader;
cc.loader.insertPipeAfter(pipeBeforeDownloader, remoteDownloader);
if (cc.sys.platform === cc.sys.WECHAT_GAME_SUB) {
var SUBDOMAIN_DATA = require('src/subdomain.json.js');
cc.game.once(cc.game.EVENT_ENGINE_INITED, function () {
cc.Pipeline.Downloader.PackDownloader._doPreload("SUBDOMAIN_DATA", SUBDOMAIN_DATA);
});
} else {
// Release Image objects after uploaded gl texture
cc.macro.CLEANUP_IMAGE_CACHE = true;
}
remoteDownloader.init();
window.boot();