rename: src/Formats -> src/Rosetta, @formats -> @rosetta requires, build/luajit/rosetta + rosetta._compat, build/roblox/Rosetta, ROSETTA_* env/globals, writer vendor strings

This commit is contained in:
4DBug committed 2026-11-01 01:19:16 -05:00
1 parent 2956576d7f
commit 22ddcd78fa
941 files changed
+3364 -3364

No files matched your search

+10 -10
View File
@@ -1,6 +1,6 @@
-- LÖVE smoke test / example for the LuaJIT build (tools/build.py luajit), run from the repo root:
-- love examples/love (a window: images, a voxel model, a tone)
-- FORMATS_SMOKE=1 xvfb-run love examples/love (headless: checks, a screenshot, then quits; exit code 1 on
-- ROSETTA_SMOKE=1 xvfb-run love examples/love (headless: checks, a screenshot, then quits; exit code 1 on
-- failure)
-- It decodes repo fixtures (PNG suite, a MagicaVoxel model, a glTF box), round-trips an image through PNG / JPEG /
-- WebP / GIF / QOI / BMP and a tone through FLAC / WAV / Vorbis / MP3, rasterizes an SVG, plays an animated GIF as a
@@ -8,13 +8,13 @@
-- the host's toImageData / toSoundData. docs/guide/README.md explains the API.
local root = (love.filesystem.getSource():gsub("/examples/love/?$", ""))
package.path = root .. "/build/luajit/?.lua;" .. root .. "/build/luajit/?/init.lua;" .. package.path
local F = require("formats")
require("formats._compat").install() -- buffer / bit32 globals for this file (the library itself does not need them)
local F = require("rosetta")
require("rosetta._compat").install() -- buffer / bit32 globals for this file (the library itself does not need them)
local SMOKE = os.getenv("FORMATS_SMOKE") == "1"
local SMOKE = os.getenv("ROSETTA_SMOKE") == "1"
if SMOKE then -- headless: print the error and exit instead of showing LÖVE's error screen
function love.errorhandler(msg)
print("formats-luau love smoke: ERROR " .. tostring(msg) .. "\n" .. debug.traceback())
print("rosetta love smoke: ERROR " .. tostring(msg) .. "\n" .. debug.traceback())
os.exit(1)
end
end
@@ -38,7 +38,7 @@ local function tile(name, img)
end
function love.load()
love.window.setTitle("formats-luau on LÖVE " .. table.concat({ love.getVersion() }, ".", 1, 3))
love.window.setTitle("rosetta on LÖVE " .. table.concat({ love.getVersion() }, ".", 1, 3))
check(F.host.name == "love", "host detected", F.host.name)
-- a decoded fixture
@@ -46,7 +46,7 @@ function love.load()
if check(png ~= nil and png.width == 32, "png fixture", errstr(e)) then tile("basn6a08.png", png) end
-- a generated image, saved and reloaded through every image writer
local Types = require("formats.Types")
local Types = require("rosetta.Types")
local img = Types.Image.new(96, 64, "rgba8")
for y = 0, 63 do
for x = 0, 95 do
@@ -164,9 +164,9 @@ function love.draw()
if SMOKE and frames == 3 then
check(videoFrames > 0, "video frames shown", videoFrames)
love.graphics.captureScreenshot(function(data)
data:encode("png", "formats_smoke.png")
print("screenshot: " .. love.filesystem.getSaveDirectory() .. "/formats_smoke.png")
print(failed == 0 and "formats-luau love smoke: all passed" or ("formats-luau love smoke: " .. failed .. " FAILED"))
data:encode("png", "rosetta_smoke.png")
print("screenshot: " .. love.filesystem.getSaveDirectory() .. "/rosetta_smoke.png")
print(failed == 0 and "rosetta love smoke: all passed" or ("rosetta love smoke: " .. failed .. " FAILED"))
love.event.quit(failed == 0 and 0 or 1)
end)
end