Skip to content

Commit

Permalink
Merge tag '3.8.3' into revenge
Browse files Browse the repository at this point in the history
  • Loading branch information
tungd committed Sep 16, 2024
2 parents 33b27bd + 7087c23 commit c239521
Show file tree
Hide file tree
Showing 337 changed files with 16,271 additions and 32,534 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/gen_decorators.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ const BUILD_CONFIG = {
options: {
engine: engineDir,
platform: 'HTML5',
moduleFormat: 2,
moduleFormat: 'system',
compress: false,
split: false,
ammoJsWasm: 'fallback',
nativeCodeBundleMode: 'both',
assetURLFormat: 'runtime-resolved',
noDeprecatedFeatures: false,
engineName: 'cocos-js',
sourceMaps: false,
sourceMap: false,
features: [
'2d', '3d',
'animation', 'audio',
Expand Down Expand Up @@ -89,9 +89,9 @@ const BUILD_CONFIG = {

process.env.ENGINE_PATH = engineDir;

const buildEngine = require(`${engineDir}/scripts/build-engine/dist/index.js`);
const { buildEngine } = require('@cocos/ccbuild');

buildEngine.build(BUILD_CONFIG.options).then((result) => {
buildEngine(BUILD_CONFIG.options).then((result) => {
console.log('done!!!');

console.log(result);
Expand Down
7 changes: 0 additions & 7 deletions .github/workflows/native-bindings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,10 @@ jobs:
ninja -C build genbindings
cd ..
npm install
cd scripts/build-engine
echo "Installing babel dependencies ..."
npm install
echo "Build typescripts ... "
npm run build
cd ../..
echo " parsing ..."
node .github/workflows/gen_decorators.js
echo " generate done!"
git checkout HEAD package.json package-lock.json
git checkout HEAD scripts # revert all changes within build-engine/
- name: Update auto-gen source files
run: |
Expand Down
32 changes: 0 additions & 32 deletions .github/workflows/run-build-engine.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/run_test_cases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ jobs:
- name: npm install
run: |
npm -v
npm install --registry https://registry.npm.taobao.org
npm install --registry https://registry.npmmirror.com
- name: Checkout test-projects
shell: bash
run: |
Expand Down Expand Up @@ -250,7 +250,7 @@ jobs:
- name: npm install
run: |
npm -v
npm install --registry https://registry.npm.taobao.org
npm install --registry https://registry.npmmirror.com
- name: Checkout test-projects
shell: bash
run: |
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"typescript"
],
"editor.codeActionsOnSave": {
"source.fixAll": true,
"source.fixAll": "explicit",
},
"files.associations": {
"iterator": "cpp"
Expand Down
2 changes: 1 addition & 1 deletion @types/pal/wasm.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ declare module 'pal/wasm' {
* @param wasmUrl the url of wasm, this should be a url relative from build output chunk.
* @param importObject the standard `WebAssembly.Imports` instance
*/
export function instantiateWasm (wasmUrl: string, importObject: WebAssembly.Imports): Promise<any>;
export function instantiateWasm (wasmUrl: string, importObject: WebAssembly.Imports): Promise<WebAssembly.WebAssemblyInstantiatedSource>;

/**
* Fetch binary data from wasm url or js mem url.
Expand Down
8 changes: 4 additions & 4 deletions EngineErrorMap.md
Original file line number Diff line number Diff line change
Expand Up @@ -1510,7 +1510,7 @@ CCClass %s have conflict between its ctor and __ctor__.
### 3650

<!-- DEPRECATED -->
No need to specifiy "%s" attribute for "%s" property in "%s" class.
No need to specify "%s" attribute for "%s" property in "%s" class.

### 3651

Expand All @@ -1525,7 +1525,7 @@ Please ensure the constructor can be called during the script's initialization.

### 3653

Please do not specifiy "default" attribute in decorator of "%s" property in "%s" class.
Please do not specify "default" attribute in decorator of "%s" property in "%s" class.
Default value must be initialized at their declaration:

```
Expand All @@ -1544,7 +1544,7 @@ myProp = null; // <--

### 3654

Please specifiy a default value for "%s.%s" property at its declaration:
Please specify a default value for "%s.%s" property at its declaration:

```
// Before:
Expand All @@ -1557,7 +1557,7 @@ myProp = 0;

### 3655

Can not specifiy "get" or "set" attribute in decorator for "%s" property in "%s" class.
Can not specify "get" or "set" attribute in decorator for "%s" property in "%s" class.
Please use:

```
Expand Down
28 changes: 6 additions & 22 deletions cc.config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"$schema": "./cc.config.schema.json",

"features": {
"base": {
"modules": ["base"],
Expand Down Expand Up @@ -210,6 +209,9 @@
"websocket-server": {
"modules": [],
"isNativeOnly": true
},
"meshopt": {
"modules": []
}
},
"moduleOverrides": [{
Expand Down Expand Up @@ -650,28 +652,10 @@
"value": false,
"internal": true
},
"WASM_SUPPORT_MODE": {
"comment": "Whether support wasm, here we provide 3 options:\n0: The platform doesn't support WASM\n1: The platform supports WASM\n2: The platform may support WASM, especially on Web platform",
"NATIVE_CODE_BUNDLE_MODE": {
"comment": "Native code (wasm/asmjs) bundle mode, 0: asmjs, 1: wasm, 2: both",
"type": "number",
"value": "$HTML5 ? 2 : ($NATIVE ? (($OPEN_HARMONY||$IOS)?0:1): ($MINIGAME? ($WECHAT?1:0) :0))",
"internal": true
},
"FORCE_BANNING_BULLET_WASM": {
"comment": "Whether force banning using bullet wasm and use asmjs instead.\nThis is an internal constant to be compatible with the editor's physical build option.",
"type": "boolean",
"value": false,
"internal": true
},
"CULL_ASM_JS_MODULE": {
"comment": "Whether cull the asm js module.\nThe external modules ending with '.asm.js'. or '.js.mem' is culled if this constant is true.",
"type": "boolean",
"value": false,
"internal": true
},
"WASM_FALLBACK": {
"comment": "An internal constant to indicate whether need a fallback of wasm.\nIf true, we build a wasm fallback module for the compatibility of wasm files compiled by different version of emscripten.\nThis is useful when we use wasm on different version of Safari browsers.",
"type": "boolean",
"value": "$HTML5",
"value": 2,
"internal": true
},
"WASM_SUBPACKAGE": {
Expand Down
20 changes: 15 additions & 5 deletions cocos/2d/assembler/label/bmfontUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,16 @@ export const bmfontUtils = {
// TextProcessing
processing.processingString(true, style, layout, outputLayoutData, comp.string);
// generateVertex
this.resetRenderData(comp);
outputRenderData.quadCount = 0;
processing.generateRenderInfo(true, style, layout, outputLayoutData, outputRenderData,
comp.string, this.generateVertexData);

renderData.dataLength = outputRenderData.quadCount;
renderData.resize(renderData.dataLength, renderData.dataLength / 2 * 3);
let isResized = false;
if (renderData.dataLength !== outputRenderData.quadCount) {
this.resetRenderData(comp);
renderData.dataLength = outputRenderData.quadCount;
renderData.resize(renderData.dataLength, renderData.dataLength / 2 * 3);
isResized = true;
}
const datalist = renderData.data;
for (let i = 0, l = outputRenderData.quadCount; i < l; i++) {
datalist[i] = outputRenderData.vertexBuffer[i];
Expand All @@ -136,7 +139,14 @@ export const bmfontUtils = {
_comp.actualFontSize = style.actualFontSize;
_uiTrans.setContentSize(outputLayoutData.nodeContentSize);
this.updateUVs(comp);// dirty need
this.updateColor(comp); // dirty need
// It is reasonable that the '_comp.node._uiProps.colorDirty' interface should be used.
// But this function is not called when just modifying the opacity.
// So the value of '_comp.node._uiProps.colorDirty' does not change.
// And _uiProps.colorDirty is synchronized with renderEntity.colorDirty.
if (_comp.renderEntity.colorDirty || isResized) {
this.updateColor(comp); // dirty need
_comp.node._uiProps.colorDirty = false;
}

renderData.vertDirty = false;
_comp = null;
Expand Down
10 changes: 5 additions & 5 deletions cocos/2d/assembler/label/font-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
*/

import { FontAtlas } from '../../assets/bitmap-font';
import { Color, macro, warnID } from '../../../core';
import { Color, macro, log, warnID } from '../../../core';
import { ImageAsset, Texture2D } from '../../../asset/assets';
import { PixelFormat } from '../../../asset/assets/asset-enum';
import { BufferTextureCopy } from '../../../gfx';
import { safeMeasureText, BASELINE_RATIO, MIDDLE_RATIO, getBaselineOffset } from '../../utils/text-utils';
import { safeMeasureText, BASELINE_RATIO, MIDDLE_RATIO, getBaselineOffset, getSymbolCodeAt } from '../../utils/text-utils';
import { director, Director } from '../../../game/director';
import { ccwindow } from '../../../core/global-exports';

Expand Down Expand Up @@ -133,7 +133,7 @@ class LetterTexture {
constructor (char: string, labelInfo: ILabelInfo) {
this.char = char;
this.labelInfo = labelInfo;
this.hash = `${char.charCodeAt(0)}${labelInfo.hash}`;
this.hash = `${getSymbolCodeAt(char, 0)}${labelInfo.hash}`;
}

public updateRenderData (): void {
Expand Down Expand Up @@ -251,7 +251,7 @@ export class LetterRenderTexture extends Texture2D {

const gfxDevice = this._getGFXDevice();
if (!gfxDevice) {
console.warn('Unable to get device');
log('Unable to get device');
return;
}

Expand Down Expand Up @@ -400,7 +400,7 @@ export class LetterAtlas {
}

public getLetterDefinitionForChar (char: string, labelInfo: ILabelInfo): any {
const hash = char.charCodeAt(0) + labelInfo.hash;
const hash = getSymbolCodeAt(char, 0) + labelInfo.hash;
let letter = this.fontDefDictionary.letterDefinitions[hash];
if (!letter) {
const temp = new LetterTexture(char, labelInfo);
Expand Down
Loading

0 comments on commit c239521

Please sign in to comment.