Skip to content

[v3.8.6] Inline enums for CCObjectFlags.#18190

Merged
dumganhar merged 7 commits into
cocos:v3.8.6from
dumganhar:386-ccobjectflags-enum
Jan 17, 2025
Merged

[v3.8.6] Inline enums for CCObjectFlags.#18190
dumganhar merged 7 commits into
cocos:v3.8.6from
dumganhar:386-ccobjectflags-enum

Conversation

@dumganhar

Copy link
Copy Markdown
Contributor

Re: #

Changelog


Continuous Integration

This pull request:

  • needs automatic test cases check.

    Manual trigger with @cocos-robot run test cases afterward.

  • does not change any runtime related code or build configuration

    If any reviewer thinks the CI checks are needed, please uncheck this option, then close and reopen the issue.


Compatibility Check

This pull request:

  • changes public API, and have ensured backward compatibility with deprecated features.
  • affects platform compatibility, e.g. system version, browser version, platform sdk version, platform toolchain, language version, hardware compatibility etc.
  • affects file structure of the build package or build configuration which requires user project upgrade.
  • introduces breaking changes, please list all changes, affected features and the scope of violation.

@dumganhar dumganhar force-pushed the 386-ccobjectflags-enum branch from 15e14fc to bddf279 Compare January 14, 2025 08:59
Comment thread cocos/particle/burst.ts
const curFrameTime = repeat(psys.time - psys.startDelay.evaluate(0, 1), psys.duration);
if (this._curTime >= preFrameTime && this._curTime < curFrameTime) {
(psys as any).emit(this.count.evaluate(this._curTime / psys.duration, 1), dt - (curFrameTime - this._curTime));
psys.emit(this.count.evaluate(this._curTime / psys.duration, 1), dt - (curFrameTime - this._curTime));

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't convert to any since we're using Typescript, mark emit as public and engineInternal.

@github-actions

github-actions Bot commented Jan 14, 2025

Copy link
Copy Markdown

👍 Package size ⤵ -852 bytes, old: 5242908, new: 5242056

Interface Check Report

! WARNING this pull request has changed these public interfaces:

@@ -21467,8 +21467,34 @@
         }
         export let __props__: string[];
         export let __values__: string[];
     }
+    export enum CCObjectFlags {
+        Destroyed = 1,
+        RealDestroyed = 2,
+        ToDestroy = 4,
+        DontSave = 8,
+        EditorOnly = 16,
+        Dirty = 32,
+        DontDestroy = 64,
+        Destroying = 128,
+        Deactivating = 256,
+        LockedInEditor = 512,
+        HideInHierarchy = 1024,
+        IsOnEnableCalled = 2048,
+        IsEditorOnEnableCalled = 4096,
+        IsPreloadStarted = 8192,
+        IsOnLoadCalled = 16384,
+        IsOnLoadStarted = 32768,
+        IsStartCalled = 65536,
+        IsRotationLocked = 131072,
+        IsScaleLocked = 262144,
+        IsAnchorLocked = 524288,
+        IsSizeLocked = 1048576,
+        IsPositionLocked = 2097152,
+        PersistentMask = "Bad expression <-4192741>",
+        AllHideMasks = 1560
+    }
     /**
      * @en
      * Indicates that the editor should treat this property or array element as an Integer value.
      * @zh
@@ -46953,9 +46979,9 @@
          * @zh 获取最大的触发粒子数量。
          * @param psys @en Particle system to burst. @zh 要触发的粒子系统。
          * @returns @en burst max particle count. @zh 一次最多触发的粒子个数。
          */
-        getMaxCount(psys: any): number;
+        getMaxCount(psys: ParticleSystem): number;
     }
     export function loadWasmModuleBox2D(): Promise<void>;
     export const Physics2DUtils: {
         PolygonSeparator: typeof __private._cocos_physics_2d_framework_utils_polygon_separator;

Comment thread cocos/scene-graph/node.ts
while (i) {
child = dirtyNodes[--i];
childMat = child._mat;
childPos = child._pos;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid to invoke child._mat & child._pos many times here.

@dumganhar dumganhar requested a review from minggo January 14, 2025 09:30
@minggo

minggo commented Jan 14, 2025

Copy link
Copy Markdown
Contributor
-        set hideFlags(hideFlags: CCObject.Flags);
-        get hideFlags(): CCObject.Flags;
+        set hideFlags(hideFlags: CCObjectFlags);
+        get hideFlags(): CCObjectFlags;

It seems beak compatibility.

@dumganhar

Copy link
Copy Markdown
Contributor Author

@minggo Reverted hideFlags setter/getter and optimize the CCObject.Flags definition.

@dumganhar dumganhar requested a review from minggo January 15, 2025 03:10
@dumganhar

Copy link
Copy Markdown
Contributor Author

@cocos-robot run test cases

@github-actions

Copy link
Copy Markdown

@dumganhar, Please check the result of run test cases:

Task Details

Platform build boot runned crashScene FailScene
web-mobile FAIL FAIL
ios FAIL FAIL
mac FAIL FAIL

@github-actions

Copy link
Copy Markdown

@dumganhar, Please check the result of run test cases:

Task Details

Platform build boot runned crashScene FailScene
windows FAIL FAIL
android FAIL FAIL
wechatgame FAIL FAIL

@dumganhar dumganhar marked this pull request as draft January 15, 2025 03:57
@dumganhar

Copy link
Copy Markdown
Contributor Author

PR test failed because editor doesn't update ccbuild. I will update the editor version as soon as possible.

@dumganhar

Copy link
Copy Markdown
Contributor Author

@cocos-robot run test cases

@github-actions

Copy link
Copy Markdown

@dumganhar, Please check the result of run test cases:

Task Details

@github-actions

Copy link
Copy Markdown

@dumganhar, Please check the result of run test cases:

Task Details

@dumganhar dumganhar marked this pull request as ready for review January 17, 2025 03:43
@dumganhar dumganhar merged commit b0b7dfb into cocos:v3.8.6 Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants