@ringozz/godot 4.7.1-9 → 4.7.2-579
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.
- package/README.md +12 -7
- package/gen/classes/AnimationNode.ts +1 -1
- package/gen/classes/AnimationNodeBlendSpace2D.ts +1 -1
- package/gen/classes/ArrayOccluder3D.ts +3 -2
- package/gen/classes/AudioStreamMP3.ts +1 -1
- package/gen/classes/AudioStreamOggVorbis.ts +1 -1
- package/gen/classes/AudioStreamWAV.ts +2 -2
- package/gen/classes/BitMap.ts +1 -1
- package/gen/classes/CPUParticles2D.ts +3 -3
- package/gen/classes/CPUParticles3D.ts +3 -3
- package/gen/classes/CSGPolygon3D.ts +2 -1
- package/gen/classes/CharFXTransform.ts +1 -1
- package/gen/classes/CodeEdit.ts +6 -6
- package/gen/classes/CodeHighlighter.ts +3 -3
- package/gen/classes/CollisionPolygon2D.ts +1 -1
- package/gen/classes/CollisionPolygon3D.ts +2 -2
- package/gen/classes/ColorPalette.ts +2 -1
- package/gen/classes/Compositor.ts +1 -1
- package/gen/classes/ConcavePolygonShape2D.ts +2 -1
- package/gen/classes/ConcavePolygonShape3D.ts +2 -1
- package/gen/classes/Control.ts +4 -4
- package/gen/classes/ConvexPolygonShape2D.ts +2 -1
- package/gen/classes/ConvexPolygonShape3D.ts +2 -1
- package/gen/classes/DPITexture.ts +1 -1
- package/gen/classes/DisplayServer.ts +3 -4
- package/gen/classes/FileDialog.ts +1 -1
- package/gen/classes/Font.ts +1 -1
- package/gen/classes/FontFile.ts +2 -2
- package/gen/classes/FontVariation.ts +4 -4
- package/gen/classes/GLTFAccessor.ts +2 -2
- package/gen/classes/GLTFMesh.ts +2 -2
- package/gen/classes/GLTFNode.ts +1 -1
- package/gen/classes/GLTFObjectModelProperty.ts +2 -2
- package/gen/classes/GLTFSkeleton.ts +4 -4
- package/gen/classes/GLTFSkin.ts +7 -7
- package/gen/classes/GLTFState.ts +19 -19
- package/gen/classes/Gradient.ts +2 -2
- package/gen/classes/GraphEdit.ts +2 -2
- package/gen/classes/HeightMapShape3D.ts +1 -1
- package/gen/classes/Image.ts +1 -1
- package/gen/classes/Label.ts +2 -2
- package/gen/classes/Label3D.ts +1 -1
- package/gen/classes/Light3D.ts +4 -2
- package/gen/classes/LightmapGIData.ts +5 -5
- package/gen/classes/Line2D.ts +1 -1
- package/gen/classes/LineEdit.ts +1 -1
- package/gen/classes/LinkButton.ts +1 -1
- package/gen/classes/MultiMesh.ts +6 -6
- package/gen/classes/NavigationMesh.ts +2 -2
- package/gen/classes/NavigationMeshSourceGeometryData2D.ts +3 -3
- package/gen/classes/NavigationMeshSourceGeometryData3D.ts +3 -3
- package/gen/classes/NavigationObstacle2D.ts +1 -1
- package/gen/classes/NavigationObstacle3D.ts +1 -1
- package/gen/classes/NavigationPathQueryParameters2D.ts +2 -2
- package/gen/classes/NavigationPathQueryParameters3D.ts +2 -2
- package/gen/classes/NavigationPathQueryResult2D.ts +5 -4
- package/gen/classes/NavigationPathQueryResult3D.ts +5 -4
- package/gen/classes/NavigationPolygon.ts +3 -3
- package/gen/classes/OccluderPolygon2D.ts +2 -1
- package/gen/classes/OggPacketSequence.ts +2 -2
- package/gen/classes/OpenXRAction.ts +1 -1
- package/gen/classes/OpenXRActionMap.ts +2 -2
- package/gen/classes/OpenXRActionSet.ts +1 -1
- package/gen/classes/OpenXRIPBinding.ts +2 -2
- package/gen/classes/OpenXRInteractionProfile.ts +2 -2
- package/gen/classes/PhysicsPointQueryParameters2D.ts +1 -1
- package/gen/classes/PhysicsPointQueryParameters3D.ts +1 -1
- package/gen/classes/PhysicsRayQueryParameters2D.ts +1 -1
- package/gen/classes/PhysicsRayQueryParameters3D.ts +1 -1
- package/gen/classes/PhysicsShapeQueryParameters2D.ts +1 -1
- package/gen/classes/PhysicsShapeQueryParameters3D.ts +1 -1
- package/gen/classes/PhysicsTestMotionParameters2D.ts +2 -2
- package/gen/classes/PhysicsTestMotionParameters3D.ts +2 -2
- package/gen/classes/Polygon2D.ts +5 -5
- package/gen/classes/PolygonOccluder3D.ts +2 -1
- package/gen/classes/PolygonPathFinder.ts +1 -1
- package/gen/classes/RDFramebufferPass.ts +4 -4
- package/gen/classes/RDPipelineColorBlendState.ts +1 -1
- package/gen/classes/RDPipelineMultisampleState.ts +1 -1
- package/gen/classes/RDPipelineShader.ts +1 -1
- package/gen/classes/RDShaderSPIRV.ts +10 -10
- package/gen/classes/RandomNumberGenerator.ts +2 -2
- package/gen/classes/ResourcePreloader.ts +1 -1
- package/gen/classes/RichTextLabel.ts +3 -3
- package/gen/classes/Shortcut.ts +1 -1
- package/gen/classes/SplitContainer.ts +1 -1
- package/gen/classes/SpriteFrames.ts +1 -1
- package/gen/classes/StreamPeerBuffer.ts +1 -1
- package/gen/classes/SystemFont.ts +1 -1
- package/gen/classes/TextEdit.ts +1 -1
- package/gen/classes/TextMesh.ts +1 -1
- package/gen/classes/TileMapLayer.ts +1 -1
- package/gen/classes/Translation.ts +1 -1
- package/gen/classes/VisualShaderNode.ts +2 -2
- package/gen/classes/VisualShaderNodeFrame.ts +1 -1
- package/gen/classes/VisualShaderNodeIntParameter.ts +1 -1
- package/gen/classes/WebSocketMultiplayerPeer.ts +2 -2
- package/gen/classes/WebSocketPeer.ts +2 -2
- package/gen/classes/Window.ts +1 -1
- package/gen/classes/XRFaceTracker.ts +1 -1
- package/gen/heap-types/GodotArray.ts +4 -1
- package/gen/heap-types/GodotDictionary.ts +6 -1
- package/package.json +16 -10
- package/src/assets.d.ts +14 -0
- package/src/boot.browser.ts +5 -3
- package/src/boot.ts +3 -2
- package/src/debug.ts +236 -118
- package/src/index.ts +15 -3
- package/src/load.ts +23 -2
- package/src/preload.ts +19 -1
- package/src/runtime.ts +17 -4
package/src/preload.ts
CHANGED
|
@@ -36,7 +36,7 @@ const FORMATS: Record<string, { cls?: string; scan?: boolean; native?: boolean }
|
|
|
36
36
|
jpeg: { cls: 'CompressedTexture2D' },
|
|
37
37
|
png: { cls: 'CompressedTexture2D' },
|
|
38
38
|
webp: { cls: 'CompressedTexture2D' },
|
|
39
|
-
svg: { cls: '
|
|
39
|
+
svg: { cls: 'CompressedTexture2D' },
|
|
40
40
|
exr: { cls: 'TextureLayered' },
|
|
41
41
|
hdr: { cls: 'TextureLayered' },
|
|
42
42
|
wav: { cls: 'AudioStreamWAV' },
|
|
@@ -44,6 +44,8 @@ const FORMATS: Record<string, { cls?: string; scan?: boolean; native?: boolean }
|
|
|
44
44
|
mp3: { cls: 'AudioStreamMP3' },
|
|
45
45
|
tres: { cls: 'Resource', scan: true, native: true },
|
|
46
46
|
po: { cls: 'Translation', native: true },
|
|
47
|
+
ttf: { cls: 'FontFile' },
|
|
48
|
+
otf: { cls: 'FontFile' },
|
|
47
49
|
mtl: { scan: true },
|
|
48
50
|
};
|
|
49
51
|
|
|
@@ -175,6 +177,22 @@ const assetPlugin: BunPlugin = {
|
|
|
175
177
|
name: 'godot-assets',
|
|
176
178
|
setup(build) {
|
|
177
179
|
build.onResolve({ filter: ASSET_RE }, (args) => {
|
|
180
|
+
// Only JS module imports of Godot source assets become `godot`
|
|
181
|
+
// modules. `Bun.build` reports JS imports as `import-statement`
|
|
182
|
+
// (and `dynamic-import`/`require-*`) but HTML asset references
|
|
183
|
+
// (<link>/<img>) and CSS url() refs as `internal`/`url-token` —
|
|
184
|
+
// those fall through so Bun copies/hashes the file normally. The
|
|
185
|
+
// runtime preload (bun run / bun test) reports JS imports with no
|
|
186
|
+
// kind (`undefined`), so treat that as a JS import too.
|
|
187
|
+
if (
|
|
188
|
+
args.kind !== undefined &&
|
|
189
|
+
args.kind !== 'import-statement' &&
|
|
190
|
+
args.kind !== 'dynamic-import' &&
|
|
191
|
+
args.kind !== 'require-call' &&
|
|
192
|
+
args.kind !== 'require-resolve'
|
|
193
|
+
) {
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
178
196
|
const importerAbs = args.importer?.startsWith(`${NS}:`)
|
|
179
197
|
? args.importer.slice(NS.length + 1)
|
|
180
198
|
: args.importer;
|
package/src/runtime.ts
CHANGED
|
@@ -3,11 +3,21 @@
|
|
|
3
3
|
***********************************************************************/
|
|
4
4
|
|
|
5
5
|
/** Shared runtime: platform-specific native-module selection lives in
|
|
6
|
-
* `boot.ts` (desktop) / `boot.browser.ts` (web, via the
|
|
7
|
-
* `browser`
|
|
8
|
-
* `module.exports` or the wasm module's `.default`.
|
|
6
|
+
* `boot.ts` (desktop) / `boot.browser.ts` (web, via the `exports` `./boot`
|
|
7
|
+
* entry's `browser` condition). `_mod` is the native module — the desktop
|
|
8
|
+
* addon's `module.exports` or the wasm module's `.default`.
|
|
9
|
+
*
|
|
10
|
+
* The boot leaf is imported by **package self-reference** (`@ringozz/godot/boot`),
|
|
11
|
+
* not by relative path: a bare specifier resolves through this package's own
|
|
12
|
+
* `exports` map (whose `./boot` entry's `browser` condition selects
|
|
13
|
+
* `boot.browser.ts` on web) exactly like the entrypoint's
|
|
14
|
+
* `import { preloadGodot } from '@ringozz/godot/boot'`, so both sides land on the
|
|
15
|
+
* same absolute path and share ONE `boot.browser.ts` module instance. (A relative
|
|
16
|
+
* `./boot.ts` import would let a consumer's bundler realpath it into
|
|
17
|
+
* `node_modules/.bun/...` while the entrypoint keeps the `node_modules/@ringozz/godot`
|
|
18
|
+
* path — two instances, and the preload handoff below would read `null`.)
|
|
9
19
|
*/
|
|
10
|
-
import { getNativeModule } from '
|
|
20
|
+
import { getNativeModule } from '@ringozz/godot/boot';
|
|
11
21
|
const { default: _mod } = getNativeModule() as any;
|
|
12
22
|
|
|
13
23
|
/** Godot instance */
|
|
@@ -69,3 +79,6 @@ export function _P(signal: any, onfulfilled?: any, onrejected?: any) {
|
|
|
69
79
|
if (res !== 0) reject(new Error('Failed to connect signal: error code ' + res));
|
|
70
80
|
}).then(onfulfilled, onrejected);
|
|
71
81
|
}
|
|
82
|
+
|
|
83
|
+
/** Cleanup callbacks run once by `runGodot` just before the engine is freed; may be async. */
|
|
84
|
+
export const cleanupHooks: Set<() => void | Promise<void>> = new Set();
|