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

Fix compiler errors in particle-2d module and optimize TIFFReader usage. #18230

Merged
merged 6 commits into from
Jan 23, 2025

Conversation

dumganhar
Copy link
Contributor

@dumganhar dumganhar commented Jan 21, 2025

Re: #18222

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 requested a review from minggo January 21, 2025 15:04
Copy link

github-actions bot commented Jan 21, 2025

👍 Package size ⤵ -964 bytes, old: 5230226, new: 5229262

Interface Check Report

! WARNING this pull request has changed these public interfaces:

@@ -46213,9 +46213,9 @@
         _initTextureWithDictionary(dict: any): boolean;
         /**
          * @deprecated since v3.5.0, this is an engine private interface that will be removed in the future.
          */
-        _initWithDictionary(dict: any): boolean;
+        _initWithDictionary(dict: Record<string, number>): boolean;
         /**
          * @deprecated since v3.5.0, this is an engine private interface that will be removed in the future.
          */
         _syncAspect(): void;
@@ -59863,8 +59863,120 @@
             node: ____private._cocos_animation_marionette_pose_graph_pose_node__PoseNode,
             graph: _PoseGraph,
             ...root: _editor_src_marionette_visit_visit_pose_node__PoseNodeLocationRoot
         ];
+        export const _cocos_particle_2d_tiff_reader__fieldTypeNames: {
+            readonly 1: "BYTE";
+            readonly 2: "ASCII";
+            readonly 3: "SHORT";
+            readonly 4: "LONG";
+            readonly 5: "RATIONAL";
+            readonly 6: "SBYTE";
+            readonly 7: "UNDEFINED";
+            readonly 8: "SSHORT";
+            readonly 9: "SLONG";
+            readonly 10: "SRATIONAL";
+            readonly 11: "FLOAT";
+            readonly 12: "DOUBLE";
+        };
+        export type _cocos_particle_2d_tiff_reader__FieldTypeNamesKey = keyof typeof _cocos_particle_2d_tiff_reader__fieldTypeNames;
+        export type _cocos_particle_2d_tiff_reader__FieldTypeNamesValue = (typeof _cocos_particle_2d_tiff_reader__fieldTypeNames)[_cocos_particle_2d_tiff_reader__FieldTypeNamesKey];
+        export const _cocos_particle_2d_tiff_reader__fieldTagNames: {
+            readonly 315: "Artist";
+            readonly 258: "BitsPerSample";
+            readonly 265: "CellLength";
+            readonly 264: "CellWidth";
+            readonly 320: "ColorMap";
+            readonly 259: "Compression";
+            readonly 33432: "Copyright";
+            readonly 306: "DateTime";
+            readonly 338: "ExtraSamples";
+            readonly 266: "FillOrder";
+            readonly 289: "FreeByteCounts";
+            readonly 288: "FreeOffsets";
+            readonly 291: "GrayResponseCurve";
+            readonly 290: "GrayResponseUnit";
+            readonly 316: "HostComputer";
+            readonly 270: "ImageDescription";
+            readonly 257: "ImageLength";
+            readonly 256: "ImageWidth";
+            readonly 271: "Make";
+            readonly 281: "MaxSampleValue";
+            readonly 280: "MinSampleValue";
+            readonly 272: "Model";
+            readonly 254: "NewSubfileType";
+            readonly 274: "Orientation";
+            readonly 262: "PhotometricInterpretation";
+            readonly 284: "PlanarConfiguration";
+            readonly 296: "ResolutionUnit";
+            readonly 278: "RowsPerStrip";
+            readonly 277: "SamplesPerPixel";
+            readonly 305: "Software";
+            readonly 279: "StripByteCounts";
+            readonly 273: "StripOffsets";
+            readonly 255: "SubfileType";
+            readonly 263: "Threshholding";
+            readonly 282: "XResolution";
+            readonly 283: "YResolution";
+            readonly 326: "BadFaxLines";
+            readonly 327: "CleanFaxData";
+            readonly 343: "ClipPath";
+            readonly 328: "ConsecutiveBadFaxLines";
+            readonly 433: "Decode";
+            readonly 434: "DefaultImageColor";
+            readonly 269: "DocumentName";
+            readonly 336: "DotRange";
+            readonly 321: "HalftoneHints";
+            readonly 346: "Indexed";
+            readonly 347: "JPEGTables";
+            readonly 285: "PageName";
+            readonly 297: "PageNumber";
+            readonly 317: "Predictor";
+            readonly 319: "PrimaryChromaticities";
+            readonly 532: "ReferenceBlackWhite";
+            readonly 339: "SampleFormat";
+            readonly 559: "StripRowCounts";
+            readonly 330: "SubIFDs";
+            readonly 292: "T4Options";
+            readonly 293: "T6Options";
+            readonly 325: "TileByteCounts";
+            readonly 323: "TileLength";
+            readonly 324: "TileOffsets";
+            readonly 322: "TileWidth";
+            readonly 301: "TransferFunction";
+            readonly 318: "WhitePoint";
+            readonly 344: "XClipPathUnits";
+            readonly 286: "XPosition";
+            readonly 529: "YCbCrCoefficients";
+            readonly 531: "YCbCrPositioning";
+            readonly 530: "YCbCrSubSampling";
+            readonly 345: "YClipPathUnits";
+            readonly 287: "YPosition";
+            readonly 37378: "ApertureValue";
+            readonly 40961: "ColorSpace";
+            readonly 36868: "DateTimeDigitized";
+            readonly 36867: "DateTimeOriginal";
+            readonly 34665: "Exif IFD";
+            readonly 36864: "ExifVersion";
+            readonly 33434: "ExposureTime";
+            readonly 41728: "FileSource";
+            readonly 37385: "Flash";
+            readonly 40960: "FlashpixVersion";
+            readonly 33437: "FNumber";
+            readonly 42016: "ImageUniqueID";
+            readonly 37384: "LightSource";
+            readonly 37500: "MakerNote";
+            readonly 37377: "ShutterSpeedValue";
+            readonly 37510: "UserComment";
+            readonly 33723: "IPTC";
+            readonly 34675: "ICC Profile";
+            readonly 700: "XMP";
+            readonly 42112: "GDAL_METADATA";
+            readonly 42113: "GDAL_NODATA";
+            readonly 34377: "Photoshop";
+        };
+        export type _cocos_particle_2d_tiff_reader__FieldTagNamesKey = keyof typeof _cocos_particle_2d_tiff_reader__fieldTagNames;
+        export type _cocos_particle_2d_tiff_reader__FieldTagNamesValue = (typeof _cocos_particle_2d_tiff_reader__fieldTagNames)[_cocos_particle_2d_tiff_reader__FieldTagNamesKey];
         export type _cocos_serialization_compiled_builtin_value_type__ValueTypeData = [
             typeIndex: number,
             ...values: number[]
         ];

0x0107: 'Threshholding',
0x011A: 'XResolution',
0x011B: 'YResolution',
0x013B: 'Artist' as const,
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the effect to add as const?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

WeChatb59a3e1824e59997a702679e2083afbe

Make the type more precisely.

}
// Bilevel or Grayscale
// BlackIsZero
case 1:
Copy link
Contributor

Choose a reason for hiding this comment

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

Please fix eslint error.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Could not fix it since we don't know whether it was designed like that.
The lint said case 0 should have a break but I don't know whether it was designed like that or a mistake.
This is the code first committed in cocos2d-html5.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

And it's not this PR cause the eslint issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added comment and ignore the eslint check.

@dumganhar dumganhar marked this pull request as draft January 22, 2025 02:48
@dumganhar dumganhar marked this pull request as ready for review January 22, 2025 02:54
@dumganhar dumganhar marked this pull request as draft January 22, 2025 03:09
@dumganhar dumganhar marked this pull request as ready for review January 22, 2025 07:03
@dumganhar
Copy link
Contributor Author

@cocos-robot run test cases

@dumganhar
Copy link
Contributor Author

Particle 2d resource using PNGReader :
Flower.plist.zip
Particle 2d resource using TIFFReader :
BoilingFoam.plist.zip
Screenshot 2025-01-22 at 15 16 48

…ticleSystem2D, and reset the tiff reader after decoding to avoid memory cached in it.
@dumganhar dumganhar changed the title Fix compiler errors in particle-2d module Fix compiler errors in particle-2d module and optimize TIFFReader usage. Jan 22, 2025
Copy link

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

Task Details

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

Copy link

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

Task Details

@minggo minggo merged commit 75a70a5 into cocos:v3.8.6 Jan 23, 2025
12 checks passed
cocos-robot pushed a commit to cocos-robot/engine that referenced this pull request Jan 23, 2025
minggo pushed a commit that referenced this pull request Jan 23, 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