mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-02 00:22:43 +08:00
spell fix & macro init & bug fix (#5831)
* spell fix (cherry picked from commit ca2dbfb5140b52627675d5e97b3d772c39b4d77f) * macro init * glloc fixed & destroyByParent fixed
This commit is contained in:
@@ -1609,7 +1609,7 @@ export function WebGL2CmdFuncCreateShader (device: WebGL2GFXDevice, gpuShader: W
|
||||
const uniformInfo = gl.getActiveUniform(gpuShader.glProgram, i);
|
||||
if (uniformInfo) {
|
||||
const glLoc = gl.getUniformLocation(gpuShader.glProgram, uniformInfo.name);
|
||||
if (glLoc) {
|
||||
if (glLoc !== null) {
|
||||
let varName: string;
|
||||
const nameOffset = uniformInfo.name.indexOf('[');
|
||||
if (nameOffset !== -1) {
|
||||
|
||||
@@ -1333,7 +1333,7 @@ export class BaseNode extends CCObject implements IBaseNode, ISchedulable {
|
||||
|
||||
// detach self and children from editor
|
||||
const parent = this._parent;
|
||||
const destroyByParent: boolean = (parent !== null) && ((parent._objFlags & Destroying) !== 0);
|
||||
const destroyByParent: boolean = (!!parent) && ((parent._objFlags & Destroying) !== 0);
|
||||
if (!destroyByParent && (CC_EDITOR || CC_TEST)) {
|
||||
this._registerIfAttached!(false);
|
||||
}
|
||||
|
||||
@@ -368,7 +368,7 @@ interface IGlobaldefines {
|
||||
|
||||
// engine use platform macros
|
||||
CC_RUNTIME_BASED?: boolean;
|
||||
CC_MINIGAMES?: boolean;
|
||||
CC_MINIGAME?: boolean;
|
||||
CC_JSB?: boolean;
|
||||
|
||||
// Flag macros
|
||||
@@ -424,12 +424,14 @@ function getGlobalDefs (options: IBuildOptions): object {
|
||||
result[macro as keyof IGlobaldefines] = !!(flags && flags[flag as keyof IFlags]);
|
||||
}
|
||||
|
||||
result.CC_RUNTIME_BASED = false;
|
||||
result.CC_MINIGAME = false;
|
||||
result.CC_DEV = result.CC_EDITOR || result.CC_PREVIEW || result.CC_TEST;
|
||||
result.CC_DEBUG = result.CC_DEBUG || result.CC_DEV;
|
||||
result.CC_RUNTIME_BASED = result.CC_OPPO || result.CC_VIVO || result.CC_HUAWEI;
|
||||
result.CC_MINIGAMES = result.CC_WECHAT || result.CC_ALIPAY || result.CC_XIAOMI || result.CC_BAIDU;
|
||||
result.CC_MINIGAME = result.CC_WECHAT || result.CC_ALIPAY || result.CC_XIAOMI || result.CC_BAIDU;
|
||||
result.CC_JSB = result.CC_NATIVE || result.CC_RUNTIME_BASED;
|
||||
result.CC_SUPPORT_JIT = !(result.CC_MINIGAMES || result.CC_RUNTIME_BASED);
|
||||
result.CC_SUPPORT_JIT = !(result.CC_MINIGAME || result.CC_RUNTIME_BASED);
|
||||
result.CC_PHYSICS_BUILTIN = false;
|
||||
result.CC_PHYSICS_CANNON = false;
|
||||
result.CC_PHYSICS_AMMO = false;
|
||||
|
||||
Reference in New Issue
Block a user