This commit is contained in:
MihailRis 2026-10-06 21:31:02 +03:00
parent d4d6235b2b
commit 0b52369ed9

View file

@ -62,25 +62,15 @@ local function parse_simple_frames(line, node)
end end
end end
local function parse_track(root) local function parse_directive(node, raw_track)
local raw_track = {
duration = math.huge,
fps = DEFAULT_FPS,
linesets = {},
curves = {},
}
local linesets = raw_track.linesets local linesets = raw_track.linesets
for i, node in ipairs(root) do
if type(node) == "string" then
goto continue
end
local tag = node['#'] local tag = node['#']
if tag == "configure" then if tag == "configure" then
parse_configure(raw_track, node) parse_configure(raw_track, node)
goto continue return
elseif tag == "curve" then elseif tag == "curve" then
raw_track.curves[node.name] = node raw_track.curves[node.name] = node
goto continue return
end end
local target_type = nil local target_type = nil
@ -118,7 +108,19 @@ local function parse_track(root)
end end
table.insert(lineset.lines, line) table.insert(lineset.lines, line)
::continue:: end
local function parse_track(root)
local raw_track = {
duration = math.huge,
fps = DEFAULT_FPS,
linesets = {},
curves = {},
}
for i, node in ipairs(root) do
if type(node) == 'table' then
parse_directive(node, raw_track)
end
end end
return raw_track return raw_track
end end