From 0e4aea6dcd577758d778225684b13b8e9ebd3d08 Mon Sep 17 00:00:00 2001 From: lanbinqiang <39689887+W-MTZing@users.noreply.github.com> Date: Wed, 13 Nov 2024 18:37:32 +0800 Subject: [PATCH] =?UTF-8?q?[v3.8.5]=20Remove=20unused=20cocos=20play?= =?UTF-8?q?=EF=BC=8Clink-sure,=20qtt=20=20platform=20adapter=20(#17849)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: lbq <563294062@qq.com> --- platforms/runtime/README.md | 10 +---- .../platforms/cocos-play/engine/canvas.js | 45 ------------------- .../platforms/cocos-play/engine/index.js | 3 -- .../platforms/link-sure/engine/index.js | 2 - .../platforms/link-sure/engine/resize.js | 10 ----- .../runtime/platforms/qtt/engine/index.js | 1 - 6 files changed, 1 insertion(+), 70 deletions(-) delete mode 100644 platforms/runtime/platforms/cocos-play/engine/canvas.js delete mode 100644 platforms/runtime/platforms/cocos-play/engine/index.js delete mode 100644 platforms/runtime/platforms/link-sure/engine/index.js delete mode 100644 platforms/runtime/platforms/link-sure/engine/resize.js delete mode 100644 platforms/runtime/platforms/qtt/engine/index.js diff --git a/platforms/runtime/README.md b/platforms/runtime/README.md index 3fb723b4e63..d2756b699a0 100644 --- a/platforms/runtime/README.md +++ b/platforms/runtime/README.md @@ -3,12 +3,4 @@ included platforms: - vivo - OPPO - huawei -- link-sure -- QTT -- cocos play / cocos runtime - -# Update RAL -the file __target-commit.json__ is the current version we are using, if you want to update the version, please update the commit in this file, and run the command line in the engine repository -```shell -npm run fetch-ral -``` \ No newline at end of file +- Migu \ No newline at end of file diff --git a/platforms/runtime/platforms/cocos-play/engine/canvas.js b/platforms/runtime/platforms/cocos-play/engine/canvas.js deleted file mode 100644 index a8a97a2e0b7..00000000000 --- a/platforms/runtime/platforms/cocos-play/engine/canvas.js +++ /dev/null @@ -1,45 +0,0 @@ -let _oldCreateElement = document.createElement; -let _gl = null; -document.createElement = function (name) { - if (name === "canvas") { - let canvas = new window.HTMLCanvasElement; - let getContext = canvas.getContext; - canvas.getContext = function (type, attributes) { - if (type === 'webgl' || - type === 'webgl2' || - type === 'experimental-webgl' || - type === 'experimental-webgl2') { - if (!_gl) { - _gl = getContext.call(this, type, attributes); - } - return _gl; - } else { - return getContext.call(this, type, attributes); - } - } - return canvas; - } - return _oldCreateElement(name); -} - -if (typeof ral.getFeatureProperty("ral.createCanvas", "spec") === "undefined") { - let _originalCreateCanvas = ral.createCanvas.bind(ral); - ral.createCanvas = function () { - let canvas = _originalCreateCanvas(); - let getContext = canvas.getContext; - canvas.getContext = function (type, attributes) { - if (type === 'webgl' || - type === 'webgl2' || - type === 'experimental-webgl' || - type === 'experimental-webgl2') { - if (!_gl) { - _gl = getContext.call(this, type, attributes); - } - return _gl; - } else { - return getContext.call(this, type, attributes); - } - } - return canvas; - }; -} \ No newline at end of file diff --git a/platforms/runtime/platforms/cocos-play/engine/index.js b/platforms/runtime/platforms/cocos-play/engine/index.js deleted file mode 100644 index 1c95caf4442..00000000000 --- a/platforms/runtime/platforms/cocos-play/engine/index.js +++ /dev/null @@ -1,3 +0,0 @@ -require('../../../common/engine/index'); - -require("./canvas.js"); \ No newline at end of file diff --git a/platforms/runtime/platforms/link-sure/engine/index.js b/platforms/runtime/platforms/link-sure/engine/index.js deleted file mode 100644 index 8e0dda22d15..00000000000 --- a/platforms/runtime/platforms/link-sure/engine/index.js +++ /dev/null @@ -1,2 +0,0 @@ -require('../../../common/engine/index'); -require('./resize'); \ No newline at end of file diff --git a/platforms/runtime/platforms/link-sure/engine/resize.js b/platforms/runtime/platforms/link-sure/engine/resize.js deleted file mode 100644 index 6e2c3d63879..00000000000 --- a/platforms/runtime/platforms/link-sure/engine/resize.js +++ /dev/null @@ -1,10 +0,0 @@ -let originalResize = window.resize; -let sysInfo = ral.getSystemInfoSync(); -let pixelRatio = sysInfo.pixelRatio; - -// HACK: window.resize called by platform -window.resize = function (width, height) { - width /= pixelRatio; - height /= pixelRatio; - originalResize.call(window, width, height); -}; \ No newline at end of file diff --git a/platforms/runtime/platforms/qtt/engine/index.js b/platforms/runtime/platforms/qtt/engine/index.js deleted file mode 100644 index 15d34b77a68..00000000000 --- a/platforms/runtime/platforms/qtt/engine/index.js +++ /dev/null @@ -1 +0,0 @@ -require('../../../common/engine/index'); \ No newline at end of file