forked from robterrell/cocos2d-javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.js
33 lines (27 loc) · 814 Bytes
/
init.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
var path = require('path')
exports.main = function () {
require.paths.push(path.join(__dirname, 'libs'))
require('./js_extensions')
// Link to the parent window's XHR object, IE9 will fail with cross-origin
// errors if we don't.
window.XMLHttpRequest = parent.XMLHttpRequest
// Load default cocos2d config
var config = require('./config')
for (var k in config) {
if (config.hasOwnProperty(k)) {
window[k] = config[k]
}
}
// Load appliaction config
if (path.exists('/config.js')) {
config = require('/config')
for (var k in config) {
if (config.hasOwnProperty(k)) {
window[k] = config[k]
}
}
}
if (ENABLE_DEPRECATED_METHODS) {
require('./legacy')
}
};