merge ws/engines

This commit is contained in:
4DBug committed 2026-11-01 20:14:34 -06:00
commit 8bd15840d8
66 files changed
+31751 -1331

No files matched your search

+36
View File
@@ -2172,3 +2172,39 @@ do
assert(BspFmt.decode(Bytes.reader(bsp)))
end)
end
-- ws-engines: text scene / level formats, MB/s of file text: Godot .tscn (Godot's own main.tscn with a 2210-vertex
-- sphere and base64 surfaces; codecs/text/GodotVariant + ArrayMesh surfaces), an LDtk sample project, 3ds Max ASE
-- (assimp's MotionCaptureROM.ase); fixtures tools/fixtures/godot.py, ldtk.py, ase.py
do
local Godot = require("@rosetta/model/godot")
local Ldtk = require("@rosetta/vector/ldtk")
local Ase = require("@rosetta/model/ase")
local Bytes = require("@rosetta/core/Bytes")
local GF = require("@tests/gen/godot")
local LF = require("@tests/gen/ldtk")
local AF = require("@tests/gen/ase_cases")
local main = buffer.fromstring(GF.cases[2].data)
local files = GF.cases[2].files
bench("godot tscn decode", 5, buffer.len(main), function()
assert(Godot.decode(Bytes.reader(main), { resolve = function(p: string): buffer?
return if files[p] then buffer.fromstring(files[p]) else nil
end }))
end)
local scene = assert(Godot.decode(Bytes.reader(main)))
bench("godot tscn encode", 5, buffer.len(main), function()
assert(Godot.encode(scene))
end)
local ld = buffer.fromstring(LF.cases[2].data)
bench("ldtk decode (" .. LF.cases[2].name .. ")", 3, buffer.len(ld), function()
assert(Ldtk.decode(Bytes.reader(ld)))
end)
for _, c in AF do
if string.find(c.name, "MotionCaptureROM", 1, true) then
local b = buffer.fromstring(c.data)
bench("ase decode (MotionCaptureROM)", 3, buffer.len(b), function()
assert(Ase.decode(Bytes.reader(b)))
end)
end
end
end