@threenative/runtime-native 0.3.13 → 0.3.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@threenative/runtime-native",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.16",
|
|
4
4
|
"description": "ThreeNative-owned native host for desktop and Android",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"threenative",
|
|
@@ -80,15 +80,15 @@
|
|
|
80
80
|
"publint": "0.3.22",
|
|
81
81
|
"three": "0.187.0",
|
|
82
82
|
"vitest": "4.1.10",
|
|
83
|
-
"@threenative/playtest": "0.3.
|
|
83
|
+
"@threenative/playtest": "0.3.16"
|
|
84
84
|
},
|
|
85
85
|
"dependencies": {
|
|
86
86
|
"pngjs": "7.0.0",
|
|
87
87
|
"esbuild": "0.27.0",
|
|
88
88
|
"typescript": "npm:@typescript/typescript6@6.0.2",
|
|
89
|
-
"@threenative/
|
|
90
|
-
"@threenative/
|
|
91
|
-
"@threenative/
|
|
89
|
+
"@threenative/three-native": "0.3.16",
|
|
90
|
+
"@threenative/core": "0.3.16",
|
|
91
|
+
"@threenative/assets": "0.3.17"
|
|
92
92
|
},
|
|
93
93
|
"scripts": {
|
|
94
94
|
"deps:download": "node scripts/download-deps.mjs",
|
|
@@ -103,6 +103,7 @@
|
|
|
103
103
|
"native:physics:cross": "node scripts/build-native-physics.mjs",
|
|
104
104
|
"native:physics:measure": "node scripts/measure-physics-divergence.mjs",
|
|
105
105
|
"native:physics:parity": "pnpm --dir ../.. exec vitest run packages/physics/__tests__/parity.spec.ts && cargo test --manifest-path native/physics/Cargo.toml --lib --test parity -- --nocapture",
|
|
106
|
+
"native:physics:web-parity": "node scripts/build-native-physics.mjs --web && node --test tests/physics-web-parity.node.mjs",
|
|
106
107
|
"native:physics:parity:device": "node scripts/verify-android-physics-parity.mjs",
|
|
107
108
|
"native:qualify:physical": "node scripts/qualify-physical-mobile.mjs",
|
|
108
109
|
"native:verify:desktop": "node scripts/verify-desktop-audio.mjs && node scripts/verify-desktop-stability.mjs && node scripts/verify-desktop-core.mjs && node scripts/verify-desktop-physics.mjs && sh ../../scripts/xvfb.sh node scripts/verify-native-contracts.mjs && pnpm --dir ../playtest build && sh ../../scripts/xvfb.sh node scripts/verify-desktop-loading.mjs && sh ../../scripts/xvfb.sh node scripts/verify-desktop-ui-frame.mjs && vitest run --config vitest.config.ts tests/external-bundle-discovery.test.mjs tests/host-cli.test.mjs tests/host-window.test.mjs",
|
|
@@ -12,9 +12,10 @@ const PLAYER = "tn-native-engine-player-v8";
|
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* The launcher: the window opens with the game's title and size, the player takes the game's CPU priority
|
|
15
|
-
* (`display.priority`, PRD-859),
|
|
15
|
+
* (`display.priority`, PRD-859), the player opens fullscreen unless the game sets `display.fullscreen: false`,
|
|
16
|
+
* and every argument reaches the player (`--windowed` and `--fullscreen` included).
|
|
16
17
|
*/
|
|
17
|
-
export function launcher(width, height, title, priority = "game") {
|
|
18
|
+
export function launcher(width, height, title, priority = "game", fullscreen = true) {
|
|
18
19
|
if (priority !== "game" && priority !== "normal") throw new Error(`TN_ENGINE_PACKAGE_ARGS: --priority must be game or normal, got ${priority}`);
|
|
19
20
|
return [
|
|
20
21
|
"#!/bin/sh",
|
|
@@ -23,7 +24,8 @@ export function launcher(width, height, title, priority = "game") {
|
|
|
23
24
|
`: "\${TN_PLAYER_WIDTH:=${width}}"`,
|
|
24
25
|
`: "\${TN_PLAYER_HEIGHT:=${height}}"`,
|
|
25
26
|
`: "\${TN_PLAYER_PRIORITY:=${priority}}"`,
|
|
26
|
-
"
|
|
27
|
+
`: "\${TN_PLAYER_FULLSCREEN:=${fullscreen ? 1 : 0}}"`,
|
|
28
|
+
"export TN_PLAYER_WIDTH TN_PLAYER_HEIGHT TN_PLAYER_PRIORITY TN_PLAYER_FULLSCREEN",
|
|
27
29
|
`exec "$DIR/${PLAYER}" "$DIR/game.js" "$@"`,
|
|
28
30
|
"",
|
|
29
31
|
].join("\n");
|
|
@@ -34,7 +36,7 @@ export function launcher(width, height, title, priority = "game") {
|
|
|
34
36
|
* and, for a web UI, `ui/`. `bundle` and `cook` are the engine bundler's, injectable for the unit test.
|
|
35
37
|
*/
|
|
36
38
|
export async function packageEngineDesktop(
|
|
37
|
-
{ project, entry, player, ui, output, buildReceipt, width = 1280, height = 720, title, priority },
|
|
39
|
+
{ project, entry, player, ui, output, buildReceipt, width = 1280, height = 720, title, priority, fullscreen },
|
|
38
40
|
{ bundle = bundleNativeEngine, cook = cookNativeEngineAssets } = {},
|
|
39
41
|
) {
|
|
40
42
|
if (!player || !existsSync(player)) {
|
|
@@ -55,7 +57,7 @@ export async function packageEngineDesktop(
|
|
|
55
57
|
cpSync(ui, join(output, "ui"), { recursive: true });
|
|
56
58
|
}
|
|
57
59
|
const start = join(output, basename(output));
|
|
58
|
-
writeFileSync(start, launcher(width, height, title, priority));
|
|
60
|
+
writeFileSync(start, launcher(width, height, title, priority, fullscreen));
|
|
59
61
|
chmodSync(start, 0o755);
|
|
60
62
|
if (buildReceipt) {
|
|
61
63
|
const receipt = JSON.parse(readFileSync(buildReceipt, "utf8"));
|
|
@@ -84,7 +86,7 @@ if (process.argv[1] && import.meta.url === pathToFileURL(resolve(process.argv[1]
|
|
|
84
86
|
const args = process.argv.slice(2);
|
|
85
87
|
const flags = new Map();
|
|
86
88
|
for (let i = 0; i < args.length; i += 2) {
|
|
87
|
-
if (!["--project", "--entry", "--player", "--ui", "--output", "--build-receipt", "--width", "--height", "--title", "--priority"].includes(args[i]) || !args[i + 1] || flags.has(args[i]))
|
|
89
|
+
if (!["--project", "--entry", "--player", "--ui", "--output", "--build-receipt", "--width", "--height", "--title", "--priority", "--fullscreen"].includes(args[i]) || !args[i + 1] || flags.has(args[i]))
|
|
88
90
|
throw new Error(`TN_ENGINE_PACKAGE_ARGS: invalid or repeated option ${args[i]}`);
|
|
89
91
|
flags.set(args[i], args[i + 1]);
|
|
90
92
|
}
|
|
@@ -100,6 +102,7 @@ if (process.argv[1] && import.meta.url === pathToFileURL(resolve(process.argv[1]
|
|
|
100
102
|
height: flags.has("--height") ? Number(flags.get("--height")) : undefined,
|
|
101
103
|
title: flags.get("--title"),
|
|
102
104
|
priority: flags.get("--priority"),
|
|
105
|
+
fullscreen: flags.has("--fullscreen") ? flags.get("--fullscreen") !== "false" : undefined,
|
|
103
106
|
});
|
|
104
107
|
} catch (error) {
|
|
105
108
|
console.error(error instanceof Error ? error.message : String(error));
|