diff --git a/cc.config.json b/cc.config.json index 4eae710d317..78637e4084d 100644 --- a/cc.config.json +++ b/cc.config.json @@ -478,13 +478,6 @@ "value": false, "internal": false }, - "BAIDU": { - "comment": "Running in the baidu's mini game.", - "type": "boolean", - "value": false, - "ccGlobal": true, - "internal": false - }, "XIAOMI": { "comment": "Running in the xiaomi's quick game.", "type": "boolean", @@ -539,27 +532,6 @@ "ccGlobal": true, "internal": false }, - "COCOSPLAY": { - "comment": "Running in the cocosplay.", - "type": "boolean", - "value": false, - "ccGlobal": true, - "internal": false - }, - "QTT": { - "comment": "Running in the qtt's quick game.", - "type": "boolean", - "value": false, - "ccGlobal": true, - "internal": false - }, - "LINKSURE": { - "comment": "Running in the linksure's quick game.", - "type": "boolean", - "value": false, - "ccGlobal": true, - "internal": false - }, "MIGU": { "comment": "Running in the migu's quick game.", "type": "boolean", @@ -567,7 +539,6 @@ "ccGlobal": true, "internal": false }, - "EDITOR": { "comment": "Running in the editor.", "type": "boolean", @@ -622,8 +593,6 @@ "value": false, "internal": true }, - - "DEV": { "comment": "Running in the editor or preview.", "type": "boolean", @@ -635,14 +604,14 @@ "MINIGAME": { "comment": "Running in mini game.", "type": "boolean", - "value": "$WECHAT || $WECHAT_MINI_PROGRAM || $BAIDU || $XIAOMI || $ALIPAY || $TAOBAO || $TAOBAO_MINIGAME || $BYTEDANCE", + "value": "$WECHAT || $WECHAT_MINI_PROGRAM || $XIAOMI || $ALIPAY || $TAOBAO || $TAOBAO_MINIGAME || $BYTEDANCE", "ccGlobal": true, "internal": false }, "RUNTIME_BASED": { "comment": "Running in runtime based environment.", "type": "boolean", - "value": "$OPPO || $VIVO || $HUAWEI || $COCOSPLAY || $QTT || $LINKSURE || $MIGU", + "value": "$OPPO || $VIVO || $HUAWEI || $MIGU", "ccGlobal": true, "internal": false }, diff --git a/cocos/asset/assets/image-asset.jsb.ts b/cocos/asset/assets/image-asset.jsb.ts index fa68d4833a7..44f1fad6f01 100644 --- a/cocos/asset/assets/image-asset.jsb.ts +++ b/cocos/asset/assets/image-asset.jsb.ts @@ -22,7 +22,7 @@ THE SOFTWARE. */ -import { ALIPAY, XIAOMI, JSB, TEST, BAIDU, EDITOR } from 'internal:constants'; +import { ALIPAY, XIAOMI, JSB, TEST, EDITOR } from 'internal:constants'; import { Format, FormatFeatureBit, deviceManager } from '../../gfx'; import { PixelFormat } from './asset-enum'; import { sys, macro, warnID, cclegacy } from '../../core'; @@ -54,7 +54,7 @@ function isImageBitmap (imageSource: any): boolean { } function isNativeImage (imageSource: ImageSource): imageSource is (HTMLImageElement | HTMLCanvasElement | ImageBitmap) { - if (ALIPAY || XIAOMI || BAIDU) { + if (ALIPAY || XIAOMI) { // We're unable to grab the constructors of Alipay native image or canvas object. return !('_data' in imageSource); } diff --git a/cocos/asset/assets/image-asset.ts b/cocos/asset/assets/image-asset.ts index f708938c465..73fd7008d82 100644 --- a/cocos/asset/assets/image-asset.ts +++ b/cocos/asset/assets/image-asset.ts @@ -24,7 +24,7 @@ // @ts-check import { ccclass, override } from 'cc.decorator'; -import { EDITOR, ALIPAY, XIAOMI, JSB, TEST, BAIDU, TAOBAO, TAOBAO_MINIGAME, WECHAT_MINI_PROGRAM, BYTEDANCE } from 'internal:constants'; +import { EDITOR, ALIPAY, XIAOMI, JSB, TEST, TAOBAO, TAOBAO_MINIGAME, WECHAT_MINI_PROGRAM, BYTEDANCE } from 'internal:constants'; import { Device, Format, FormatFeatureBit, deviceManager } from '../../gfx'; import { Asset } from './asset'; import { PixelFormat } from './asset-enum'; @@ -163,7 +163,7 @@ function fetchImageSource (imageSource: ImageSource): HTMLCanvasElement | HTMLIm // 返回该图像源是否是平台提供的图像对象。 function isNativeImage (imageSource: ImageSource): imageSource is (HTMLImageElement | HTMLCanvasElement | ImageBitmap) { - if (ALIPAY || TAOBAO || TAOBAO_MINIGAME || XIAOMI || BAIDU || WECHAT_MINI_PROGRAM || BYTEDANCE) { + if (ALIPAY || TAOBAO || TAOBAO_MINIGAME || XIAOMI || WECHAT_MINI_PROGRAM || BYTEDANCE) { // We're unable to grab the constructors of Alipay native image or canvas object. return !('_data' in imageSource); } diff --git a/cocos/core/platform/deprecated.ts b/cocos/core/platform/deprecated.ts index 5b1fdc9b2ea..7ad79fbeda5 100644 --- a/cocos/core/platform/deprecated.ts +++ b/cocos/core/platform/deprecated.ts @@ -43,7 +43,9 @@ markAsWarning(sys, 'sys', [ ]); // deprecate languageCode field -replaceProperty(sys, 'sys', +replaceProperty( + sys, + 'sys', ['UNKNOWN', 'ENGLISH', 'CHINESE', 'FRENCH', 'ITALIAN', 'GERMAN', 'SPANISH', 'DUTCH', 'RUSSIAN', 'KOREAN', 'JAPANESE', 'HUNGARIAN', 'PORTUGUESE', 'ARABIC', 'NORWEGIAN', @@ -52,19 +54,25 @@ replaceProperty(sys, 'sys', newName: item, target: sys.Language, targetName: 'sys.Language', - }))); + })), +); // deprecate os field -replaceProperty(sys, 'sys', +replaceProperty( + sys, + 'sys', ['UNKNOWN', 'IOS', 'ANDROID', 'WINDOWS', 'LINUX', 'OSX'].map((item) => ({ name: `OS_${item}`, newName: item, target: sys.OS, targetName: 'sys.OS', - }))); + })), +); // deprecate browserType field -replaceProperty(sys, 'sys', +replaceProperty( + sys, + 'sys', ['UNKNOWN', 'WECHAT', 'ANDROID', 'IE', 'EDGE', 'QQ', 'MOBILE_QQ', 'UC', 'UCBS', 'BAIDU_APP', 'BAIDU', 'MAXTHON', 'OPERA', 'OUPENG', 'MIUI', 'FIREFOX', 'SAFARI', 'CHROME', 'LIEBAO', @@ -73,7 +81,8 @@ replaceProperty(sys, 'sys', newName: item, target: sys.BrowserType, targetName: 'sys.BrowserType', - }))); + })), +); replaceProperty(sys, 'sys', [ { name: 'BROWSER_TYPE_360', @@ -84,14 +93,17 @@ replaceProperty(sys, 'sys', [ ]); // deprecate platform field -replaceProperty(sys, 'sys', +replaceProperty( + sys, + 'sys', ['UNKNOWN', 'EDITOR_PAGE', 'EDITOR_CORE', 'MOBILE_BROWSER', 'DESKTOP_BROWSER', 'WIN32', 'MACOS', 'IOS', 'ANDROID', 'OHOS', - 'WECHAT_GAME', 'BAIDU_MINI_GAME', 'XIAOMI_QUICK_GAME', 'ALIPAY_MINI_GAME', 'BYTEDANCE_MINI_GAME', - 'OPPO_MINI_GAME', 'VIVO_MINI_GAME', 'HUAWEI_QUICK_GAME', 'COCOSPLAY', 'LINKSURE_MINI_GAME', 'QTT_MINI_GAME'].map((item) => ({ + 'WECHAT_GAME', 'XIAOMI_QUICK_GAME', 'ALIPAY_MINI_GAME', 'BYTEDANCE_MINI_GAME', + 'OPPO_MINI_GAME', 'VIVO_MINI_GAME', 'HUAWEI_QUICK_GAME'].map((item) => ({ name: item, target: sys.Platform, targetName: 'sys.Platform', - }))); + })), +); // remove platform field replaceProperty(sys, 'sys', [ @@ -108,11 +120,14 @@ replaceProperty(sys, 'sys', [ targetName: 'sys.Platform', }, ]); -removeProperty(sys, 'sys', +removeProperty( + sys, + 'sys', ['LINUX', 'BLACKBERRY', 'NACL', 'EMSCRIPTEN', 'TIZEN', 'WINRT', 'WP8', 'QQ_PLAY', 'FB_PLAYABLE_ADS'].map((item) => ({ name: item, - }))); + })), +); replaceProperty(sys, 'sys', [ { name: 'windowPixelResolution', diff --git a/cocos/gfx/webgl/webgl-swapchain.ts b/cocos/gfx/webgl/webgl-swapchain.ts index 0dd4031a926..7cefd10dcb9 100644 --- a/cocos/gfx/webgl/webgl-swapchain.ts +++ b/cocos/gfx/webgl/webgl-swapchain.ts @@ -22,7 +22,7 @@ THE SOFTWARE. */ -import { ALIPAY, RUNTIME_BASED, BYTEDANCE, WECHAT, LINKSURE, QTT, COCOSPLAY, HUAWEI, EDITOR, VIVO, TAOBAO, TAOBAO_MINIGAME, WECHAT_MINI_PROGRAM } from 'internal:constants'; +import { ALIPAY, RUNTIME_BASED, BYTEDANCE, WECHAT, HUAWEI, EDITOR, TAOBAO, TAOBAO_MINIGAME, WECHAT_MINI_PROGRAM } from 'internal:constants'; import { systemInfo } from 'pal/system-info'; import { WebGLStateCache } from './webgl-state-cache'; import { WebGLTexture } from './webgl-texture'; @@ -149,7 +149,7 @@ export function getExtensions (gl: WebGLRenderingContext): IWebGLExtensions { if (RUNTIME_BASED) { // VAO implementations doesn't work well on some runtime platforms - if (LINKSURE || QTT || COCOSPLAY || HUAWEI) { + if (HUAWEI) { res.OES_vertex_array_object$ = null; } } diff --git a/cocos/scene-graph/scene-globals.ts b/cocos/scene-graph/scene-globals.ts index 577f671963b..39c40015ddd 100644 --- a/cocos/scene-graph/scene-globals.ts +++ b/cocos/scene-graph/scene-globals.ts @@ -25,7 +25,7 @@ import { ccclass, visible, type, displayOrder, readOnly, slide, range, rangeStep, editable, serializable, rangeMin, tooltip, formerlySerializedAs, displayName, } from 'cc.decorator'; -import { BAIDU } from 'internal:constants'; + import { TextureCube } from '../asset/assets/texture-cube'; import { CCFloat, CCInteger } from '../core/data/utils/attribute'; import { Color, Quat, Vec3, Vec2, Vec4 } from '../core/math'; @@ -862,11 +862,6 @@ export class ShadowsInfo { } } get enabled (): boolean { - if (BAIDU) { - if (this._type !== ShadowType.Planar) { - this._enabled = false; - } - } return this._enabled; } @@ -1708,7 +1703,7 @@ export class SceneGlobals { this.skin.activate(sceneData.skin); this.postSettings.activate(sceneData.postSettings); if (this.lightProbeInfo && sceneData.lightProbes) { - this.lightProbeInfo.activate(scene, sceneData.lightProbes as LightProbes); + this.lightProbeInfo.activate(scene, sceneData.lightProbes); } const root = legacyCC.director.root as Root; diff --git a/pal/env/minigame/env.ts b/pal/env/minigame/env.ts index 21fa0118eb3..9f29c09e489 100644 --- a/pal/env/minigame/env.ts +++ b/pal/env/minigame/env.ts @@ -23,7 +23,7 @@ */ /* eslint-disable import/no-dynamic-require */ -import { BAIDU, TAOBAO, TAOBAO_MINIGAME, WECHAT, WECHAT_MINI_PROGRAM, XIAOMI } from 'internal:constants'; +import { TAOBAO, TAOBAO_MINIGAME, WECHAT, WECHAT_MINI_PROGRAM, XIAOMI } from 'internal:constants'; import { checkPalIntegrity, withImpl } from '../../integrity-check'; declare const require: (path: string) => any; @@ -40,9 +40,6 @@ export function loadJsFile (path: string): any { if (XIAOMI) { return require(`../../${path}`); } - if (BAIDU) { - return __baiduRequire(`./${path}`); - } if (WECHAT || WECHAT_MINI_PROGRAM) { return __wxRequire(path); } diff --git a/pal/env/runtime/env.ts b/pal/env/runtime/env.ts index d418ba86b1f..78538f72cce 100644 --- a/pal/env/runtime/env.ts +++ b/pal/env/runtime/env.ts @@ -22,7 +22,7 @@ THE SOFTWARE. */ -import { COCOSPLAY, HUAWEI, OPPO, VIVO } from 'internal:constants'; +import { HUAWEI, OPPO, VIVO } from 'internal:constants'; import { checkPalIntegrity, withImpl } from '../../integrity-check'; declare const require: (path: string) => Promise; @@ -30,15 +30,8 @@ declare const ral: any; export function findCanvas (): { frame: HTMLDivElement, container: HTMLDivElement, canvas: HTMLCanvasElement } { const container = document.createElement('div'); - let frame; - if (COCOSPLAY) { - frame = { - clientWidth: window.innerWidth, - clientHeight: window.innerHeight, - } as any; - } else { - frame = container.parentNode === document.body ? document.documentElement : container.parentNode as any; - } + const frame = container.parentNode === document.body ? document.documentElement : container.parentNode as any; + let canvas; if (VIVO) { canvas = window.mainCanvas; diff --git a/pal/minigame/runtime.ts b/pal/minigame/runtime.ts index 8dfad251c88..43d040bdd83 100644 --- a/pal/minigame/runtime.ts +++ b/pal/minigame/runtime.ts @@ -22,7 +22,7 @@ THE SOFTWARE. */ -import { COCOSPLAY, HUAWEI, LINKSURE, OPPO, QTT, VIVO } from 'internal:constants'; +import { VIVO } from 'internal:constants'; import { SystemInfo, IMiniGame } from 'pal/minigame'; import { checkPalIntegrity, withImpl } from '../integrity-check'; @@ -66,17 +66,6 @@ Object.defineProperty(minigame, 'orientation', { }, }); -if (LINKSURE || COCOSPLAY) { - // TODO: update system info when view resized, currently the resize callback is not supported. - let cachedSystemInfo = ral.getSystemInfoSync() as SystemInfo; - minigame.onWindowResize?.(() => { - // update cached system info - cachedSystemInfo = ral.getSystemInfoSync() as SystemInfo; - }); - minigame.getSystemInfoSync = function (): SystemInfo { - return cachedSystemInfo; - }; -} // #endregion SystemInfo // #region Accelerometer @@ -115,22 +104,12 @@ minigame.offAccelerometerChange = function (cb): void { }; // #endregion Accelerometer -// NOTE: Audio playing crash on COCOSPLAY, need to play audio asynchronously. -if (COCOSPLAY) { - minigame.createInnerAudioContext = createInnerAudioContextPolyfill(ral, { - onPlay: true, // polyfill for vivo - onPause: true, - onStop: true, - onSeek: true, - }, true); -} else { - minigame.createInnerAudioContext = createInnerAudioContextPolyfill(ral, { - onPlay: true, // polyfill for vivo - onPause: true, - onStop: true, - onSeek: true, - }); -} +minigame.createInnerAudioContext = createInnerAudioContextPolyfill(ral, { + onPlay: true, // polyfill for vivo + onPause: true, + onStop: true, + onSeek: true, +}); // #region SafeArea minigame.getSafeArea = function (): SafeArea { diff --git a/pal/system-info/enum-type/platform.ts b/pal/system-info/enum-type/platform.ts index 040da4aa750..ea32bdfc8cd 100644 --- a/pal/system-info/enum-type/platform.ts +++ b/pal/system-info/enum-type/platform.ts @@ -39,7 +39,6 @@ export enum Platform { // Minigame WECHAT_GAME = 'WECHAT_GAME', WECHAT_MINI_PROGRAM = 'WECHAT_MINI_PROGRAM', - BAIDU_MINI_GAME = 'BAIDU_MINI_GAME', XIAOMI_QUICK_GAME = 'XIAOMI_QUICK_GAME', ALIPAY_MINI_GAME = 'ALIPAY_MINI_GAME', TAOBAO_CREATIVE_APP = 'TAOBAO_CREATIVE_APP', @@ -49,8 +48,5 @@ export enum Platform { OPPO_MINI_GAME = 'OPPO_MINI_GAME', VIVO_MINI_GAME = 'VIVO_MINI_GAME', HUAWEI_QUICK_GAME = 'HUAWEI_QUICK_GAME', - COCOSPLAY = 'COCOSPLAY', - LINKSURE_MINI_GAME = 'LINKSURE_MINI_GAME', - QTT_MINI_GAME = 'QTT_MINI_GAME', MIGU_MINI_GAME = 'MIGU_MINI_GAME', } diff --git a/pal/system-info/minigame/system-info.ts b/pal/system-info/minigame/system-info.ts index 884af43c8d3..b6eaeb4e870 100644 --- a/pal/system-info/minigame/system-info.ts +++ b/pal/system-info/minigame/system-info.ts @@ -22,7 +22,7 @@ THE SOFTWARE. */ -import { ALIPAY, BAIDU, BYTEDANCE, COCOSPLAY, HUAWEI, LINKSURE, OPPO, QTT, VIVO, MIGU, WECHAT, XIAOMI, DEBUG, TEST, TAOBAO, TAOBAO_MINIGAME, WECHAT_MINI_PROGRAM } from 'internal:constants'; +import { ALIPAY, BYTEDANCE, HUAWEI, OPPO, VIVO, MIGU, WECHAT, XIAOMI, DEBUG, TEST, TAOBAO, TAOBAO_MINIGAME, WECHAT_MINI_PROGRAM } from 'internal:constants'; import { minigame } from 'pal/minigame'; import { IFeatureMap } from 'pal/system-info'; import { EventTarget } from '../../../cocos/core/event'; @@ -36,8 +36,6 @@ if (WECHAT) { currentPlatform = Platform.WECHAT_GAME; } else if (WECHAT_MINI_PROGRAM) { currentPlatform = Platform.WECHAT_MINI_PROGRAM; -} else if (BAIDU) { - currentPlatform = Platform.BAIDU_MINI_GAME; } else if (XIAOMI) { currentPlatform = Platform.XIAOMI_QUICK_GAME; } else if (ALIPAY) { @@ -54,12 +52,6 @@ if (WECHAT) { currentPlatform = Platform.VIVO_MINI_GAME; } else if (HUAWEI) { currentPlatform = Platform.HUAWEI_QUICK_GAME; -} else if (COCOSPLAY) { - currentPlatform = Platform.COCOSPLAY; -} else if (LINKSURE) { - currentPlatform = Platform.LINKSURE_MINI_GAME; -} else if (QTT) { - currentPlatform = Platform.QTT_MINI_GAME; } else if (MIGU) { currentPlatform = Platform.MIGU_MINI_GAME; } diff --git a/platforms/minigame/common/engine/AssetManager.js b/platforms/minigame/common/engine/AssetManager.js index eb0c3851225..d50ec79fa49 100644 --- a/platforms/minigame/common/engine/AssetManager.js +++ b/platforms/minigame/common/engine/AssetManager.js @@ -43,9 +43,6 @@ presets.scene.maxRequestsPerFrame = 64; const subpackages = {}; const sys = cc.sys; -if (sys.platform === sys.Platform.BAIDU_MINI_GAME) { - require = __baiduRequire; -} if (sys.platform === sys.Platform.TAOBAO_MINI_GAME) { require = globalThis.__taobaoRequire; } diff --git a/tests/constants-for-test.ts b/tests/constants-for-test.ts index b643b681087..5c165ddc297 100644 --- a/tests/constants-for-test.ts +++ b/tests/constants-for-test.ts @@ -33,8 +33,6 @@ export const RUNTIME_BASED = tryDefineGlobal('CC_RUNTIME_BASED', false); export const ALIPAY = tryDefineGlobal('CC_ALIPAY', false); export const XIAOMI = tryDefineGlobal('CC_XIAOMI', false); export const BYTEDANCE = tryDefineGlobal('CC_BYTEDANCE', false); -export const BAIDU = tryDefineGlobal('CC_BAIDU', false); -export const COCOSPLAY = tryDefineGlobal('CC_COCOSPLAY', false); export const HUAWEI = tryDefineGlobal('CC_HUAWEI', false); export const OPPO = tryDefineGlobal('CC_OPPO', false); export const VIVO = tryDefineGlobal('CC_VIVO', false);