Skip to content

Commit

Permalink
Merge branch 'v3.8.2' of https://github.com/cocos/cocos-engine into v…
Browse files Browse the repository at this point in the history
…3.8.3

# Conflicts:
#	package-lock.json
#	package.json
  • Loading branch information
dumganhar committed Jan 11, 2024
2 parents ee3bbcf + ddd45f9 commit 118e50c
Show file tree
Hide file tree
Showing 81 changed files with 1,365 additions and 787 deletions.
2 changes: 1 addition & 1 deletion cocos/2d/assembler/label/letter-font.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const letterFont = js.mixin(bmfontUtils, {
shareLabelInfo.isOutlined = true;
shareLabelInfo.margin = comp.outlineWidth;
shareLabelInfo.out = comp.outlineColor.clone();
shareLabelInfo.out.a = comp.outlineColor.color.a * comp.color.a / 255.0;
shareLabelInfo.out.a = comp.outlineColor.a * comp.color.a / 255.0;
} else {
shareLabelInfo.isOutlined = false;
shareLabelInfo.margin = 0;
Expand Down
7 changes: 5 additions & 2 deletions cocos/2d/assembler/label/text-processing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -752,8 +752,11 @@ export class TextProcessing {
letterDef = shareLabelInfo.fontAtlas!.getLetterDefinitionForChar(character, shareLabelInfo);
if (!letterDef) {
this._recordPlaceholderInfo(letterIndex, character);
log(`Can't find letter definition in texture atlas ${
style.fntConfig!.atlasName} for letter:${character}`);
if (style.fntConfig != null) {
log(`Can't find letter definition in texture atlas ${style.fntConfig.atlasName} for letter:${character}`);
} else {
log(`Can't find letter definition in font family ${style.fontFamily} for letter:${character}`);
}
continue;
}

Expand Down
14 changes: 7 additions & 7 deletions cocos/2d/components/deprecated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,28 +127,28 @@ replaceProperty(MaskType, 'MaskType', [
},
]);

markAsWarning(LabelOutline.prototype, 'LabelOutline.prototype', [
markAsWarning(LabelOutline.prototype, 'LabelOutline', [
{
name: 'width',
suggest: 'Please use Label.prototype.outlineWidth instead.',
suggest: 'Please use Label.outlineWidth instead.',
},
{
name: 'color',
suggest: 'Please use Label.prototype.outlineColor instead.',
suggest: 'Please use Label.outlineColor instead.',
},
]);

markAsWarning(LabelShadow.prototype, 'LabelShadow.prototype', [
markAsWarning(LabelShadow.prototype, 'LabelShadow', [
{
name: 'color',
suggest: 'Please use Label.prototype.shadowColor instead.',
suggest: 'Please use Label.shadowColor instead.',
},
{
name: 'offset',
suggest: 'Please use Label.prototype.shadowOffset instead.',
suggest: 'Please use Label.shadowOffset instead.',
},
{
name: 'blur',
suggest: 'Please use Label.prototype.shadowBlur instead.',
suggest: 'Please use Label.shadowBlur instead.',
},
]);
3 changes: 2 additions & 1 deletion cocos/3d/reflection-probe/reflection-probe-component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,8 @@ export class ReflectionProbe extends Component {
this.probe.cubemap = val;
ReflectionProbeManager.probeManager.onUpdateProbes();
}

@type(TextureCube)
@visible(false)
get cubemap (): TextureCube | null {
return this._cubemap;
}
Expand Down
38 changes: 30 additions & 8 deletions cocos/core/math/color.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,16 +126,38 @@ export class Color extends ValueType {
}
/**
* @en Converts the hexadecimal formal color into rgb formal and save the results to out color.
* the argument `hex` could be hex-string or hex-number (8-digit or 6-digit).
* the hex-string should be like : '#12345678' '#123456', '123456', '12345678'.
* the hex-number should be like : 0x12345678, 0x123456 .
* @zh 从十六进制颜色字符串中读入颜色到 out 中
*/
public static fromHEX<Out extends IColorLike> (out: Out, hexString: string): Out {
hexString = (hexString.indexOf('#') === 0) ? hexString.substring(1) : hexString;
out.r = parseInt(hexString.substr(0, 2), 16) || 0;
out.g = parseInt(hexString.substr(2, 2), 16) || 0;
out.b = parseInt(hexString.substr(4, 2), 16) || 0;
const a = parseInt(hexString.substr(6, 2), 16);
out.a = !Number.isNaN(a) ? a : 255;
* 参数 hex 支持 16进制字符串 或者 16进制数值 (8位数字 或者 6位数字).
* 16进制字符串的格式应该类似: '#12345678' '#123456', '123456', '12345678'.
* 16进制数值的格式应该类似: 0x12345678, 0x123456 .
*/
public static fromHEX<Out extends IColorLike> (out: Out, hex: string | number): Out {
let hexNumber: number;
if (typeof hex === 'string') {
hex = hex[0] === '#' ? hex.substring(1) : hex;
if (hex.length === 6) {
hex += 'FF';
} else if (hex.length === 3) {
hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2] + 'FF';
} else if (hex.length === 4) {
hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2] + hex[3] + hex[3];
}
hexNumber = Number('0x' + hex);
} else {
if (hex < 0x1000000) {
hex = (hex << 8) + 0xff;
}
hexNumber = hex;
}
out.r = hexNumber >>> 24;
out.g = (hexNumber & 0x00ff0000) >>> 16;
out.b = (hexNumber & 0x0000ff00) >>> 8;
out.a = hexNumber & 0x000000ff;
out._val = ((out.a << 24) >>> 0) + (out.b << 16) + (out.g << 8) + out.r;

return out;
}

Expand Down
15 changes: 12 additions & 3 deletions cocos/gi/light-probe/light-probe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,20 @@ export class LightProbesData {
}

public updateProbes (points: Vec3[]): void {
this._probes.length = 0;
this._probes.length = points.length;

const pointCount = points.length;
const pointCount = this._probes.length;
for (let i = 0; i < pointCount; i++) {
this._probes.push(new Vertex(points[i]));
let probe = this._probes[i];
if (!probe) {
probe = new Vertex(points[i]);
for (let j = 0; j < SH.getBasisCount(); j++) {
probe.coefficients[j] = Vec3.ZERO;
}
this._probes[i] = probe;
} else {
probe.position.set(points[i]);
}
}
}

Expand Down
Loading

0 comments on commit 118e50c

Please sign in to comment.