Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 7 commits into from
Jan 17, 2025

Conversation

dumganhar
Copy link
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
@@ -111,7 +109,7 @@ export default class Burst {
preFrameTime = (preFrameTime > 0.0) ? preFrameTime : 0.0;
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
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.

Copy link

github-actions bot commented Jan 14, 2025

👍 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;

let dirtyBits = 0;

while (i) {
child = dirtyNodes[--i];
childMat = child._mat;
childPos = child._pos;
Copy link
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
Copy link
Contributor

minggo commented Jan 14, 2025

-        set hideFlags(hideFlags: CCObject.Flags);
-        get hideFlags(): CCObject.Flags;
+        set hideFlags(hideFlags: CCObjectFlags);
+        get hideFlags(): CCObjectFlags;

It seems beak compatibility.

@dumganhar
Copy link
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
Contributor Author

@cocos-robot run test cases

Copy link

@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

Copy link

@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
Contributor Author

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

@dumganhar
Copy link
Contributor Author

@cocos-robot run test cases

Copy link

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

Task Details

Copy link

@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
12 checks passed
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