mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-11-24 11:29:44 +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
|
||||||
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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue