mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-11-25 03:49:45 +00:00
cleanup
This commit is contained in:
parent
d4d6235b2b
commit
0b52369ed9
1 changed files with 50 additions and 48 deletions
|
|
@ -62,25 +62,15 @@ local function parse_simple_frames(line, node)
|
|||
end
|
||||
end
|
||||
|
||||
local function parse_track(root)
|
||||
local raw_track = {
|
||||
duration = math.huge,
|
||||
fps = DEFAULT_FPS,
|
||||
linesets = {},
|
||||
curves = {},
|
||||
}
|
||||
local function parse_directive(node, raw_track)
|
||||
local linesets = raw_track.linesets
|
||||
for i, node in ipairs(root) do
|
||||
if type(node) == "string" then
|
||||
goto continue
|
||||
end
|
||||
local tag = node['#']
|
||||
if tag == "configure" then
|
||||
parse_configure(raw_track, node)
|
||||
goto continue
|
||||
return
|
||||
elseif tag == "curve" then
|
||||
raw_track.curves[node.name] = node
|
||||
goto continue
|
||||
return
|
||||
end
|
||||
|
||||
local target_type = nil
|
||||
|
|
@ -118,7 +108,19 @@ local function parse_track(root)
|
|||
end
|
||||
|
||||
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
|
||||
return raw_track
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue