mirror of
https://github.com/smallmain/cocos-enhance-kit.git
synced 2025-01-15 07:21:07 +00:00
25 lines
684 B
JavaScript
25 lines
684 B
JavaScript
|
const adapter = window.__globalAdapter;
|
||
|
let adaptSysFunc = adapter.adaptSys;
|
||
|
|
||
|
Object.assign(adapter, {
|
||
|
// Extend adaptSys interface
|
||
|
adaptSys (sys) {
|
||
|
adaptSysFunc.call(this, sys, GameGlobal._env);
|
||
|
delete GameGlobal._env; // release env
|
||
|
|
||
|
// baidugame subdomain
|
||
|
if (!swan.getOpenDataContext) {
|
||
|
sys.platform = sys.BAIDU_GAME_SUB;
|
||
|
}
|
||
|
else {
|
||
|
sys.platform = sys.BAIDU_GAME;
|
||
|
}
|
||
|
|
||
|
// sys.glExtension = function (name) {
|
||
|
// if (name === 'OES_texture_float') {
|
||
|
// return false;
|
||
|
// }
|
||
|
// return !!cc.renderer.device.ext(name);
|
||
|
// };
|
||
|
},
|
||
|
});
|