346 Commits

Author SHA1 Message Date
hyde zhou 6ccf1cf9a8 Reapply "Feat/plugin support, allow third_party feat(spine) to create plugin f…" (#403) (#424)
This reverts commit 5bcfb9fa04.
2026-11-16 16:33:05 +08:00
hyde zhou 5bcfb9fa04 Revert "Feat/plugin support, allow third_party feat(spine) to create plugin f…" (#403)
This reverts commit a56706c9ad.
2026-11-10 17:04:32 +08:00
Tianze-Chen a56706c9ad Feat/plugin support, allow third_party feat(spine) to create plugin for creator. (#306)
* Add UIMesh component for custom 2D mesh rendering

- Add UIMesh component consuming pre-baked vertex/index/segment data, enabling custom renderers (e.g. spine plugin) to batch through the 2D batcher.
- Export UIMesh from the 2d components index.
- Validate setMeshData input at the boundary (stride, buffer lengths, index values, segment ranges, accessor caps) via engine-standard errorIDs 9010-9017, documented in EngineErrorMap.md.
- Expose StaticVBAccessor per-chunk caps as maxVertexCount/maxIndexCount getters and clamp the 10% reserve to them, so meshes that fit (e.g. 30000 vertices) allocate instead of silently failing.
- Add tests/ui/ui-mesh.test.ts covering the 32767 cap boundary, setMeshData validation, and accessor lifetime.

Also takes over node transform and cascaded opacity: vertices are now always
node-local — UIMesh applies the node's world matrix (unbatched via the
per-draw GPU transform the 2D batcher already maintains for middleware,
batched by baking into the shared chunk copy so draws still merge) and folds
the cascaded UIOpacity into the copied vertex colors itself. The legacy
switches (USE_LOCAL / useLocalData / RenderEntity.setUseLocal) are all derived
internally; consumers never touch them. A JSB staleness poll re-prepares the
native draw infos in the same frame on transform/opacity changes, and a
premultipliedAlpha format declaration drives the opacity fold and the builtin
material's blend factors.

Follow-ups folded in: the opacity fold reads the light color at byte offset 20
(the pos*3f + uv*2f header is 20 bytes), not 16; and UIMesh notifies data
producers through the new onPremultipliedAlphaChanged() hook so subclasses
(e.g. the spine plugin) forward the declared format to their baker instead of
redeclaring the field.

Co-Authored-By: Claude Code <noreply@anthropic.com>

* Disable built-in spine by default; minor editor/build fixes

- Default the built-in Spine feature (spine-3.8) to off in feature cropping, so it is only included when enabled in the editor.
- Recognize scale as a valid spine atlas page attribute in the texture inspector.
- Skip incomplete platform dirs when bundling runtime adapters.

Co-Authored-By: Claude <noreply@anthropic.com>
(cherry picked from commit 7f7922aaf42ff1857f0a6d38970a75d303032f57)

* Export WebAssembly interface under cc.wasm namespace

- Add exports/webassembly.ts re-exporting pal/wasm (instantiateWasm, fetchBuffer, fetchUrl, ensureWasmModuleReady) as the public cc.wasm namespace, so extensions/game code can load their own .wasm files through the engine's platform-adaptive path.
- Expose it as a croppable feature rather than an unconditional export from exports/base.ts: cc.config.json declares a `webassembly` feature and editor/engine-features/render-config.json adds the panel entry (default on, required), so it appears under Project Settings -> Feature Cropping. The label/description are plain text on purpose — i18n:ENGINE.* keys live in the editor package and a custom engine cannot add them.

(cherry picked from commit 92003ab4a21b6ee753cf3ba2ca0f4767658e9cdc)

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* feat(simulator): generic native plugin discovery opt-in

The generic plugin discovery chain (cc_gen_plugin_cmake_hook ->
plugins_parser.js -> Pre-AutoLoadPlulgins.cmake -> find_package ->
plugin_registry) already exists and is what native device builds use; the
simulator never invoked it. Wire it in behind an opt-in cache variable, with
no plugin names or plugin logic in the engine — the plugin set is always just
the scan result:

- templates/cmake/common.cmake: cc_gen_plugin_cmake_hook()'s scan roots
  (CC_PLUGIN_PATH) may now be pre-set by the caller; the native-build
  project-layout defaults are unchanged when nobody pre-defines it
- simulator runtime-src CMakeLists.txt: -DSIMULATOR_PLUGIN_SCAN_DIRS="<dir>
  [;<dir>]" scans those roots for cc_plugin.json through the same chain as
  device builds (CC_PROJECT_DIR points into the build tree so the generated
  hook lands there, satisfying the parser's output-dir invariant); unset
  keeps the stock plugin-less simulator, and a cache variable means plain
  `cmake --build` reuses the configured scan
- simulator Game.cpp: call cc_load_all_plugins() after init, mirroring
  BaseGame::init(), so registered plugins' JSB bindings exist before any
  script runs (no-op when no plugins are linked)
- libsimulator protobuf config.h: skip the <hash_map>/<hash_set> defines on
  MSVC >= 1950 (headers removed); stubs fall back to the std::map emulation
  path

Verified end-to-end: a project extensions/ tree scanned at configure time
produces a simulator exe whose plugins register their JSB bindings at startup
(observed live in the simulator's JS context).

Co-Authored-By: Claude Code <noreply@anthropic.com>

---------

Co-authored-by: Developer <developer@cocos.com>
Co-authored-by: Claude Code <noreply@anthropic.com>
Co-authored-by: Engineer <engineer@cocos.com>
2026-11-04 16:41:54 +08:00
llsansun 2157fd176d Multithreading (#322)
* worker pool

* opt

* backup

* worker and worker backend

* worker fallback

* opt

* opt

* remove meta

* opt

* worker export

* testcase fix

* worker js template

* worker pal

* worker opt

* test

* Replace error messages with error codes

* Package size reduction

* Package size reduction

* revert

* Restore editor asset .meta files to the base branch state

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014HAtWwr4dy5azfpccweh1g

* bugfix

* Split into two features: Worker and Worker Pool

* worker option

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 16:35:14 +08:00
ChiaNing 2c632d6dd6 fix(2d): serialize custom font families and restore native font aliases (#382)
* refactor(2d): share font family and descriptor helpers

Extract the existing TTF and CHAR font family selection and font description
construction into shared helpers. Preserve raw family values, the Arial
fallback, and the existing size and style formatting.

* fix(2d): serialize custom font families at CSS boundaries

Quote and escape raw custom font names before Canvas and DOM consumption,
while preserving system family expressions. Keep Web-loaded aliases raw
and share the serialized expression across registration and loading.

Carry CssFontFamily through Label consumers and cover serialization,
TTF/CHAR selection, EditBox styles, and Web FontFaceSet loading in tests.

* fix(2d): preserve font names during scaling and refresh load metrics

Build CHAR draw descriptors from the scaled size and serialized family,
so unit-like substrings in font names are not rewritten by scaling.

Set the font before baseline measurement and read live Canvas metrics
during Web font polling instead of reusing cached fallback widths.
Add regression tests for the actual CHAR draw path and load completion.

* refactor(native): extract canvas font parsing

Move the existing platform-specific parsing into an internal helper and
return the family, size, and style flags to CanvasRenderingContext2D.
Preserve the existing matching rules, conversions, fallbacks, and update order.

Validated 12,650 comparisons with the original setFont implementation
across five platform macro variants.

* fix(native): restore serialized font aliases within legacy policy

Decode a single quoted CSS family into the descriptor used before TS
serialization. Adopt the result only when the existing platform parser
recognizes the complete registered alias; retain legacy fallbacks otherwise.

Cover existing aliases, escaped encodings, platform name restrictions,
style and size policies, and malformed inputs without expanding font support.

* fix(native): preserve size when a quoted font name falls back

Keep a valid requested px size when a well-formed quoted font family is
rejected on Apple or QNX, while retaining the existing fallback font and
style flags. Leave malformed prefixes, lists, and unsafe sizes unchanged.

Preserve the existing size conversion on other native platforms.

* fix(2d): resolve font family types in bundled declarations

* test(2d): cover explicit native font alias compatibility

* fix(2d): resolve font CI lint diagnostics

Allow implicit move of the native font parsing result and wrap EditBox placeholder CSS without changing its output.

Validation: targeted clang-tidy check, ESLint with zero warnings, 13 native parser tests, and 2062 font policy comparisons.
2026-10-27 10:06:11 +08:00
yangchao 469614cf0b fix ios build problem (#292) 2026-08-23 12:01:54 +08:00
hyde zhou db5462603e Move pal directory to private repository (#191) (#254)
Co-authored-by: qiuguohua <qiuguohua111@126.com>
2026-08-08 16:20:49 +08:00
hyde zhou 4a6f83bd6d Revert "refactor platforms (#126)" (#128) 2026-04-28 23:12:10 +08:00
hyde zhou 910865bd8b refactor platforms (#126) 2026-04-28 18:53:46 +08:00
hyde zhou 5f4d70d989 Update version check (#67) 2026-02-03 11:09:12 +08:00
Knox 478adbb5fb add skipLibCheck fix npm run build native-pack-tool, (#33) 2025-10-23 22:41:04 +08:00
qiuguohua b8ebe3322c Add web adapters and engine adapters for the Node.js platform. (#5) 2025-09-12 17:00:39 +08:00
hyde zhou 58b7419c45 V4.0.0 init (#3) 2025-09-11 17:09:12 +08:00
bofeng-song 2e4778fede Reapply "Use PROP_ENABLE_COMPRESS_SO to control whether dynamic libraries are compressed in Android build outputs. (#18819)" (#18822) (#18999) 2025-09-09 14:51:28 +08:00
qiuguohua 3e6618d9b0 The HarmonyOS Next platform adds device type attributes (#18885)
Co-authored-by: qiuguohua <guohua.qiu@cocos.com>
2025-08-21 14:02:55 +08:00
媛媛 847de3763e 完善 pack tool 返回值 (#18924) 2025-08-21 11:14:38 +08:00
媛媛 e18ce8160b Merge pull request #18879 from yanOO1497/6_4_open_with_ide_
Open the project using IDE (#16405)
2025-08-19 16:48:09 +08:00
bofeng-song f6d5707fd1 Integrate the Alipay adaptation layer's builtin.js source code files into the engine. (#18663) 2025-04-25 15:46:15 +08:00
qiuguohua f80ca2cceb Implementation of google play auto login, achievements, PGS Recall API (#18416) 2025-03-09 23:34:12 +08:00
lanbinqiang 5d5ec6084d modify the runtime base build adapter process (#18426)
Co-authored-by: lbq <563294062@qq.com>
2025-03-07 17:26:51 +08:00
qiuguohua a20bb447a0 Fix cross threading issue when calling callStatic Method (#18316)
* Fix cross threading issue when calling callStatic Method

* Rename AsyncCallParam to CallParam

---------

Co-authored-by: qiuguohua <guohua.qiu@cocos.com>
2025-02-11 16:46:31 +08:00
James Chen aca53d2817 Fix deprecated String.substr, use String.substring instead. (#18272) 2025-02-05 13:47:05 +08:00
qiuguohua fd7270c886 Synchronize HarmonyOS Next platform from cocos creator 2.4.14 (#18247)
* Synchronize the HarmonyOS Next platform update for 2.4.14
2025-01-24 13:48:35 +08:00
minggo 7251fd3efc merge v3.8.5 2024-12-23 10:34:45 +08:00
qiuguohua eb949c6022 Fix google play platform build appBundle failure issue (#18063)
Co-authored-by: qiuguohua <guohua.qiu@cocos.com>
2024-12-20 10:37:43 +08:00
qiuguohua 2e4a9d57e0 Fix the incorrect orientation of the gravity sensor and JSVM crash issue in HarmonyOS Next (#18041)
* 1.Fix the problem of incorrect rotation direction of openharmony screen
2.Remove redundant files

# Conflicts:
#	templates/harmonyos-next/entry/src/main/ets/cocos/jsb-adapter/sys-ability-polyfill.js

* Fix the issue of JSVM running crash

---------

Co-authored-by: qiuguohua <guohua.qiu@cocos.com>
2024-12-17 10:43:39 +08:00
Max 970e91c0e1 fix runtime web adapter fetch error (#18020)
Co-authored-by: zhiming.wu <zhiming.wu@cocos.com>
2024-12-11 10:18:15 +08:00
qiuguohua deba073213 Integrate the Google Play Billing Library into engine (#17918) 2024-11-29 11:18:48 +08:00
qiuguohua 7611668235 Change openharmony to harmonyos-next (#17988)
Co-authored-by: qiuguohua <guohua.qiu@cocos.com>
2024-11-29 09:15:33 +08:00
James Chen f4ccf3a8bb [v3.8.5] Support inline enum and mangle private variables to reduce engine size. (#17703) 2024-10-15 10:17:16 +08:00
hyde zhou e9da7e2309 add legacy pipeline (#17250) 2024-07-01 13:57:21 +08:00
媛媛 b634293aa8 Fix Huawei agc platform not updating configurations when creating new build tasks for secondary builds. (#17054) 2024-05-29 17:27:34 +08:00
James Chen 3520efd7b9 Remove typedoc-plugin (#17053) 2024-05-28 17:59:15 +08:00
James Chen 163d0e1d99 [v3.8.5] [Bug] Fix some definition errors, cherry-pick from #16471 (#17008)
* [Bug] Fix some definition errors

# Conflicts:
#	cocos/spine/lib/spine-core.d.ts
#	package.json

---------

Co-authored-by: Sijie <devhacker520@hotmail.com>
Co-authored-by: SijieWang <itharbors@outlook.com>
2024-05-20 14:05:26 +08:00
James Chen c32c66c511 Remove "@cocos/build-engine" module, its functionality was moved to "@cocos/ccbuild". (#16755)
* Remove "@cocos/build-engine" module, its functionality was moved to "@cocos/ccbuild".

* Remove scripts/build-engine directory.

* Update package.json

* Remove unused run-build-engine.yml file
2024-02-23 14:31:26 +08:00
James Chen 4db86876dd Update ccbuild to 2.2.3 and some minor fixes (#16698)
* Update ccbuild to 2.2.3 and some minor fixes

* Update package-lock.json
2024-01-23 16:19:34 +08:00
媛媛 1bdd90b5d3 fix compressZip in invaild in native platform (#16596) 2023-12-13 09:31:06 +08:00
qiuguohua 52568c04fb Using the build directory as a condition for determining if it's the first build or not (#16558)
Co-authored-by: qiuguohua <guohua.qiu@cocos.com>
2023-12-05 11:27:21 +08:00
SijieWang 409b540b80 [Bug] Fix the error that occurs when executing clear on an empty warehouse (#16507)
Fix the error that occurs when executing clear on an empty warehouse
2023-11-14 16:31:43 +08:00
SijieWang c41807c4f6 [Optimize] Simplify workflow (#16503)
* [Optimize] Simplify workflow
2023-11-13 09:31:40 +08:00
James Chen 59038ba8b8 Fix rollup visualizer plugin not working in build-engine and add publish-build-engine.yml ci action. (#16495)
* Fix rollup visualizer plugin not working in build-engine.

* Update package.json & package-lock.json

* Add publish-build-engine.yml ci action.

* Update yml

* Update run-build-engine.yml

* Update run-build-engine.yml
2023-11-10 15:55:00 +08:00
SijieWang 88c3fdf082 Optimize workflow - typedoc and filename (#16455) 2023-10-31 15:41:36 +08:00
媛媛 ce246ce36a Fix build windows error when editor path contains spaces (#16424) 2023-10-18 16:16:48 +08:00
minggo 36a2933f6c Merge branch 'v3.8.1' into v3.8.2-merge-v3.8.1
Conflicts:
	.github/workflows/native-compile-platforms.yml
	cocos/physics/framework/deprecated.ts
	cocos/rendering/custom/executor.ts
	native/cocos/renderer/pipeline/custom/FrameGraphDispatcher.cpp
2023-10-09 14:15:51 +08:00
qiuguohua d75fb4e1b5 OpenHarmony platform modification configuration update rules (#16320)
* 1.Rules for modifying configuration changes
2.Update app name

* Modify variable name
2023-09-25 09:59:59 +08:00
PP f7cf786e83 fix: gulp-build-h5-source (#16277)
* fix: gulp-build-h5-source

* update lock
2023-09-20 09:47:19 +08:00
minggo 554598643a Merge branch 'v3.8.1' into v3.8.2-merge-v3.8.1 2023-09-08 14:34:24 +08:00
SijieWang 51dc67e1c0 Fix an issue where node_modules was not removed when clearing the cache. (#16193) 2023-09-06 11:07:41 +08:00
bofeng-song cdca5b07b8 Fix orientation does not work normaly on huawei-agc platform (#16180) 2023-09-04 16:56:58 +08:00
PP c76dc6cf74 fix linking build engine (#16141) 2023-08-31 09:47:19 +08:00