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.1 #16377

Closed
wants to merge 11 commits into from
Closed

V3.8.1 #16377

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/native-bindings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ jobs:
ndk-version: r21e
add-to-path: false
- name: Generate decorators
env:
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
run: |
cd native
echo "Generate compile_commands.json & ninja target"
Expand Down
31 changes: 25 additions & 6 deletions .github/workflows/native-compile-platforms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ jobs:
COCOS_ENGINE_DEV: 1
run: |
NATIVE_ROOT=$GITHUB_WORKSPACE/native
ANDORID_NDK=$ANDROID_NDK_LATEST_HOME
ANDROID_NDK=${{ steps.setup-ndk.outputs.ndk-path }}
NATIVE_DIR=$GITHUB_WORKSPACE/templates/android-template
echo "Compiling Android ... "
cd $GITHUB_WORKSPACE/templates/
Expand All @@ -111,7 +111,7 @@ jobs:

ASSET_DIR=$GITHUB_WORKSPACE/templates/android/build/build-android/

sed -i "s@^PROP_NDK_PATH.*@PROP_NDK_PATH=$ANDORID_NDK@g" gradle.properties
sed -i "s@^PROP_NDK_PATH.*@PROP_NDK_PATH=$ANDROID_NDK@g" gradle.properties
sed -i "s@^APPLICATION_ID.*@APPLICATION_ID=com.cocos.android@g" gradle.properties
sed -i "s@^RES_PATH.*@RES_PATH=$ASSET_DIR@g" gradle.properties
sed -i "s@^COCOS_ENGINE_PATH.*@COCOS_ENGINE_PATH=$NATIVE_ROOT@g" gradle.properties
Expand All @@ -122,7 +122,7 @@ jobs:
sed -i "s@^PROP_APP_ABI.*@PROP_APP_ABI=arm64-v8a@g" gradle.properties

echo "Compile Android - cmake ..."
echo "ANDORID_NDK ${ANDROID_NDK} or ${ANDROID_NDK_HOME}"
echo "ANDROID_NDK ${ANDROID_NDK} or ${ANDROID_NDK_HOME}"
# ./gradlew :CocosGame:assembleDebug --quiet
./gradlew :CocosGame:assembleRelease --quiet
echo "Compile Android Debug Done!"
Expand All @@ -133,6 +133,25 @@ jobs:
(! contains(github.event.pull_request.body, '[X] does not change any runtime related code or build configuration'))
runs-on: ubuntu-latest
steps:
- name: Before free space
run: |
df -h

- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@d5af243ce7bacb67384aa6c5b1fc5f169e30903e
with:
tool-cache: true
android: false
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true

- name: After free space
run: |
df -h

- uses: actions/checkout@v2
- name: Download external libraries
shell: bash
Expand All @@ -154,7 +173,7 @@ jobs:
COCOS_ENGINE_DEV: 1
run: |
NATIVE_ROOT=$GITHUB_WORKSPACE/native
ANDORID_NDK=$ANDROID_NDK_LATEST_HOME
ANDROID_NDK=${{ steps.setup-ndk.outputs.ndk-path }}
NATIVE_DIR=$GITHUB_WORKSPACE/templates/android-template
echo "Compiling Android ... "
cd $GITHUB_WORKSPACE/templates/
Expand Down Expand Up @@ -185,7 +204,7 @@ jobs:

ASSET_DIR=$GITHUB_WORKSPACE/templates/android/build/build-android/

sed -i "s@^PROP_NDK_PATH.*@PROP_NDK_PATH=$ANDORID_NDK@g" gradle.properties
sed -i "s@^PROP_NDK_PATH.*@PROP_NDK_PATH=$ANDROID_NDK@g" gradle.properties
sed -i "s@^APPLICATION_ID.*@APPLICATION_ID=com.cocos.android@g" gradle.properties
sed -i "s@^RES_PATH.*@RES_PATH=$ASSET_DIR@g" gradle.properties
sed -i "s@^COCOS_ENGINE_PATH.*@COCOS_ENGINE_PATH=$NATIVE_ROOT@g" gradle.properties
Expand All @@ -196,7 +215,7 @@ jobs:
sed -i "s@^PROP_APP_ABI.*@PROP_APP_ABI=armeabi-v7a:arm64-v8a@g" gradle.properties

echo "Compile Android - cmake ..."
echo "ANDORID_NDK ${ANDROID_NDK} or ${ANDROID_NDK_HOME}"
echo "ANDROID_NDK ${ANDROID_NDK} or ${ANDROID_NDK_HOME}"
./gradlew :CocosGame:assembleDebug --quiet
echo "Compile Android Debug Done!"

Expand Down
8 changes: 8 additions & 0 deletions EngineErrorMap.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,14 @@ Expected 'data' dict, but not found. Config file: %s

Please load the resource first : %s

### 1102

Effect settings not found, effects will not be imported.

### 1103

Success to load scene: %s

### 1200

cocos2d: Director: Error in gettimeofday
Expand Down
4 changes: 2 additions & 2 deletions cocos/core/platform/macro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -987,9 +987,9 @@ interface Macro {

/**
* @en
* Used to set float output, the default value is false.
* Used to set float output render target, more accurate multiple light sources, fog, and translucent effects, custom pipeline only, the default value is false.
* @zh
* 用于开启浮点格式的输出, 默认值为 false。
* 用于开启浮点格式的RT输出, 更精确的多光源、雾化和半透明效果, 仅用于自定义管线, 默认值为 false。
* @default false
*/
ENABLE_FLOAT_OUTPUT: boolean;
Expand Down
36 changes: 22 additions & 14 deletions cocos/game/game.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import { findCanvas, loadJsFile } from 'pal/env';
import { Pacer } from 'pal/pacer';
import { ConfigOrientation } from 'pal/screen-adapter';
import assetManager, { IAssetManagerOptions } from '../asset/asset-manager/asset-manager';
import { EventTarget, AsyncDelegate, sys, macro, VERSION, cclegacy, screen, Settings, settings, assert, garbageCollectionManager, DebugMode, warn, log, _resetDebugSetting } from '../core';
import { EventTarget, AsyncDelegate, sys, macro, VERSION, cclegacy, screen, Settings, settings, assert, garbageCollectionManager, DebugMode, warn, log, _resetDebugSetting, errorID, logID } from '../core';
import { input } from '../input';
import { deviceManager, LegacyRenderMode } from '../gfx';
import { SplashScreen } from './splash-screen';
Expand Down Expand Up @@ -723,6 +723,7 @@ export class Game extends EventTarget {
})
.then((): void => {
if (DEBUG) {
// eslint-disable-next-line no-console
console.time('Init Base');
}
const debugMode = config.debugMode || DebugMode.NONE;
Expand All @@ -735,6 +736,7 @@ export class Game extends EventTarget {
.then((): Promise<void> => settings.init(config.settingsPath, config.overrideSettings))
.then((): Promise<void[]> => {
if (DEBUG) {
// eslint-disable-next-line no-console
console.timeEnd('Init Base');
}
this.emit(Game.EVENT_POST_BASE_INIT);
Expand All @@ -748,6 +750,7 @@ export class Game extends EventTarget {
})
.then((): void => {
if (DEBUG) {
// eslint-disable-next-line no-console
console.time('Init Infrastructure');
}
macro.init();
Expand All @@ -769,6 +772,7 @@ export class Game extends EventTarget {
Layers.init();
this.initPacer();
if (DEBUG) {
// eslint-disable-next-line no-console
console.timeEnd('Init Infrastructure');
}
})
Expand All @@ -795,27 +799,36 @@ export class Game extends EventTarget {
}
const data = effectSettings.data;
if (data === null) {
console.error('Effect settings not found, effects will not be imported.');
errorID(1102);
return;
}
cclegacy.rendering.init(deviceManager.gfxDevice, data);
})
.then((): Promise<any[]> => {
const scriptPackages = settings.querySettings<string[]>(Settings.Category.SCRIPTING, 'scriptPackages');
if (scriptPackages) {
return Promise.all(scriptPackages.map((pack): Promise<any> => import(pack)));
}
return Promise.resolve([]);
})
.then((): Promise<void> => {
if (DEBUG) {
// eslint-disable-next-line no-console
console.time('Init SubSystem');
}
director.init();
return builtinResMgr.loadBuiltinAssets();
})
.then((): Promise<void[]> => {
if (DEBUG) {
// eslint-disable-next-line no-console
console.timeEnd('Init SubSystem');
}
this.emit(Game.EVENT_POST_SUBSYSTEM_INIT);
return this.onPostSubsystemInitDelegate.dispatch();
})
.then((): void => {
console.log(`Cocos Creator v${VERSION}`);
log(`Cocos Creator v${VERSION}`);
this.emit(Game.EVENT_ENGINE_INITED);
this._engineInited = true;
})
Expand All @@ -827,6 +840,7 @@ export class Game extends EventTarget {
})
.then((): Promise<void> => {
if (DEBUG) {
// eslint-disable-next-line no-console
console.time('Init Project');
}
const jsList = settings.querySettings<string[]>(Settings.Category.PLUGINS, 'jsList');
Expand All @@ -838,13 +852,6 @@ export class Game extends EventTarget {
}
return promise;
})
.then((): Promise<any[]> => {
const scriptPackages = settings.querySettings<string[]>(Settings.Category.SCRIPTING, 'scriptPackages');
if (scriptPackages) {
return Promise.all(scriptPackages.map((pack): Promise<any> => import(pack)));
}
return Promise.resolve([]);
})
.then((): Promise<any[]> => this._loadProjectBundles())
.then((): Promise<void> => this._loadCCEScripts())
.then((): void | Promise<void> => this._setupRenderPipeline())
Expand All @@ -855,6 +862,7 @@ export class Game extends EventTarget {
})
.then((): Promise<void[]> => {
if (DEBUG) {
// eslint-disable-next-line no-console
console.timeEnd('Init Project');
}
this.emit(Game.EVENT_POST_PROJECT_INIT);
Expand Down Expand Up @@ -1013,11 +1021,11 @@ export class Game extends EventTarget {
SplashScreen.instance.update(this._calculateDT(false));
} else if (this._shouldLoadLaunchScene) {
this._shouldLoadLaunchScene = false;
const launchScene = settings.querySettings(Settings.Category.LAUNCH, 'launchScene');
const launchScene = settings.querySettings(Settings.Category.LAUNCH, 'launchScene') as string;
if (launchScene) {
// load scene
director.loadScene(launchScene, (): void => {
console.log(`Success to load scene: ${launchScene}`);
logID(1103, launchScene);
this._initTime = performance.now();
director.startAnimation();
this.onStart?.();
Expand Down Expand Up @@ -1098,7 +1106,7 @@ export class Game extends EventTarget {
}

private _setupRenderPipeline (): void | Promise<void> {
const renderPipeline = settings.querySettings(Settings.Category.RENDERING, 'renderPipeline');
const renderPipeline = settings.querySettings(Settings.Category.RENDERING, 'renderPipeline') as string;
if (!renderPipeline) {
return this._setRenderPipeline();
}
Expand All @@ -1124,7 +1132,7 @@ export class Game extends EventTarget {
this._safeEmit(Game.EVENT_RENDERER_INITED);
}

private _safeEmit (event): void {
private _safeEmit (event: string | number): void {
if (EDITOR) {
try {
this.emit(event);
Expand Down
10 changes: 10 additions & 0 deletions cocos/gfx/base/framebuffer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,19 @@ export abstract class Framebuffer extends GFXObject {
return this._depthStencilTexture;
}

public get width (): number {
return this._width;
}

public get height (): number {
return this._height;
}

protected _renderPass: RenderPass | null = null;
protected _colorTextures: (Texture | null)[] = [];
protected _depthStencilTexture: Texture | null = null;
protected _width: number = 0;
protected _height: number = 0;

constructor () {
super(ObjectType.FRAMEBUFFER);
Expand Down
2 changes: 2 additions & 0 deletions cocos/gfx/webgl/webgl-framebuffer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ export class WebGLFramebuffer extends Framebuffer {
};

WebGLCmdFuncCreateFramebuffer(WebGLDeviceManager.instance, this._gpuFramebuffer);
this._width = this._gpuFramebuffer.width;
this._height = this._gpuFramebuffer.height;
}

public destroy (): void {
Expand Down
2 changes: 2 additions & 0 deletions cocos/gfx/webgl2/webgl2-framebuffer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ export class WebGL2Framebuffer extends Framebuffer {
};

WebGL2CmdFuncCreateFramebuffer(WebGL2DeviceManager.instance, this._gpuFramebuffer);
this._width = this._gpuFramebuffer.width;
this._height = this._gpuFramebuffer.height;
}

public destroy (): void {
Expand Down
6 changes: 0 additions & 6 deletions cocos/physics/framework/deprecated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,6 @@ removeProperty(RigidBody.prototype, 'RigidBody.prototype', [
},
]);

removeProperty(EConstraintType, 'EConstraintType.prototype', [
{
name: 'CONE_TWIST',
},
]);

/**
* Alias of [[RigidBody]]
* @deprecated Since v1.2
Expand Down
8 changes: 0 additions & 8 deletions cocos/physics/framework/physics-enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,14 +270,6 @@ export enum EConstraintType {
* 铰链约束。
*/
HINGE,
/**
* @en
* Cone twist constraint.
* @zh
* 锥形扭转约束。
* @deprecated coneTwist is deprecated, please use configurable instead
*/
CONE_TWIST,
/**
* @en
* Fixed constraint.
Expand Down
17 changes: 2 additions & 15 deletions cocos/physics/framework/physics-selector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
/* eslint-disable @typescript-eslint/restrict-template-expressions */
/* eslint-disable @typescript-eslint/no-unsafe-return */
import { EDITOR, TEST } from 'internal:constants';
import { IBaseConstraint, IPointToPointConstraint, IHingeConstraint, IConeTwistConstraint, IFixedConstraint,
import { IBaseConstraint, IPointToPointConstraint, IHingeConstraint, IFixedConstraint,
IConfigurableConstraint } from '../spec/i-physics-constraint';
import {
IBoxShape, ISphereShape, ICapsuleShape, ITrimeshShape, ICylinderShape,
Expand Down Expand Up @@ -58,10 +58,6 @@ interface IPhysicsWrapperObject {
PlaneShape?: Constructor<IPlaneShape>,
PointToPointConstraint?: Constructor<IPointToPointConstraint>,
HingeConstraint?: Constructor<IHingeConstraint>,
/**
* @deprecated cone twist constraint is deprecated, please use configurable instead
*/
ConeTwistConstraint?: Constructor<IConeTwistConstraint>,
FixedConstraint?: Constructor<IFixedConstraint>,
ConfigurableConstraint?: Constructor<IConfigurableConstraint>,
}
Expand Down Expand Up @@ -236,10 +232,6 @@ enum ECheckType {
// JOINT //
PointToPointConstraint,
HingeConstraint,
/**
* @deprecated cone twist constraint is deprecated, please use configurable instead
*/
ConeTwistConstraint,
FixedConstraint,
ConfigurableConstraint,
// CHARACTER CONTROLLER //
Expand Down Expand Up @@ -422,7 +414,7 @@ function initColliderProxy (): void {

const CREATE_CONSTRAINT_PROXY = { INITED: false };

interface IEntireConstraint extends IPointToPointConstraint, IHingeConstraint, IConeTwistConstraint, IFixedConstraint, IConfigurableConstraint { }
interface IEntireConstraint extends IPointToPointConstraint, IHingeConstraint, IFixedConstraint, IConfigurableConstraint { }
const ENTIRE_CONSTRAINT: IEntireConstraint = {
impl: null,
initialize: FUNC,
Expand Down Expand Up @@ -488,11 +480,6 @@ function initConstraintProxy (): void {
return new selector.wrapper.HingeConstraint!();
};

CREATE_CONSTRAINT_PROXY[EConstraintType.CONE_TWIST] = function createConeTwistConstraint (): IConeTwistConstraint {
if (check(selector.wrapper.ConeTwistConstraint, ECheckType.ConeTwistConstraint)) { return ENTIRE_CONSTRAINT; }
return new selector.wrapper.ConeTwistConstraint!();
};

CREATE_CONSTRAINT_PROXY[EConstraintType.FIXED] = function createFixedConstraint (): IFixedConstraint {
if (check(selector.wrapper.FixedConstraint, ECheckType.FixedConstraint)) { return ENTIRE_CONSTRAINT; }
return new selector.wrapper.FixedConstraint!();
Expand Down
5 changes: 0 additions & 5 deletions cocos/physics/spec/i-physics-constraint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,3 @@ export interface IConfigurableConstraint extends IBaseConstraint {
setBreakForce(v: number): void;
setBreakTorque(v: number): void;
}

/**
* @deprecated ConeTwistConstraint is deprecated, please use ConfigurableConstraint instead
*/
export type IConeTwistConstraint = IBaseConstraint
Loading
Loading