2024-10-24 17:27:28 +08:00
|
|
|
require("./macro");
|
2024-10-21 20:23:37 +08:00
|
|
|
require("./ipc-main.js");
|
|
|
|
|
2024-10-22 15:45:08 +08:00
|
|
|
module.exports = {
|
2024-10-24 17:27:28 +08:00
|
|
|
init(callback) {
|
2024-10-22 15:45:08 +08:00
|
|
|
if (CC_USE_WORKER) {
|
|
|
|
var t = Date.now();
|
2024-10-28 17:28:44 +08:00
|
|
|
require("./handlers.js");
|
2024-10-22 15:45:08 +08:00
|
|
|
ipcMain.init(() => {
|
|
|
|
console.log("worker init cost:", Date.now() - t);
|
|
|
|
console.log("worker settings:", {
|
|
|
|
CC_USE_WORKER,
|
|
|
|
CC_WORKER_DEBUG,
|
|
|
|
CC_WORKER_ASSET_PIPELINE,
|
2024-10-24 17:27:28 +08:00
|
|
|
CC_WORKER_AUDIO_SYSTEM,
|
2024-10-22 15:45:08 +08:00
|
|
|
CC_WORKER_SCHEDULER,
|
|
|
|
CC_WORKER_FS_SYNC,
|
2024-10-24 17:27:28 +08:00
|
|
|
CC_WORKER_SUB_PACKAGE,
|
2024-10-22 15:45:08 +08:00
|
|
|
});
|
2024-10-24 17:27:28 +08:00
|
|
|
callback && callback();
|
2024-10-22 15:45:08 +08:00
|
|
|
});
|
|
|
|
} else {
|
2024-10-24 17:27:28 +08:00
|
|
|
callback && callback();
|
2024-10-22 15:45:08 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
};
|