diff options
Diffstat (limited to 'src/textures.lua')
| -rw-r--r-- | src/textures.lua | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/textures.lua b/src/textures.lua index 9ed789c..05a00a3 100644 --- a/src/textures.lua +++ b/src/textures.lua @@ -5,8 +5,9 @@ local default_anim = { frame_count = 1, default_tag = "default", tags = { - default = {from=1, to=1, duration=1}, + default = {from=1, to=1}, }, + frame_durations = {0.1} } local img_bank = {} @@ -20,6 +21,7 @@ local function load_ase(path) local height = ase.header.height local frames = {} + local durations = {} local tags = {} local default_tag @@ -30,6 +32,7 @@ local function load_ase(path) local buf = love.data.decompress("data", "zlib", cel.data) local data = love.image.newImageData(cel.width, cel.height, "rgba8", buf) local img = lg.newImage(data) + table.insert(durations, frame.frame_duration / 1000) table.insert(frames, {img=img, x=cel.x, y=cel.y}) elseif chunk.type == 0x2018 then for i, tag in ipairs(chunk.data.tags) do @@ -41,7 +44,6 @@ local function load_ase(path) from = tag.from + 1, to = tag.to + 1, -- this is placed wrong but idc - duration = (tag.frame_duration or 100) / 1000, } end end @@ -60,6 +62,7 @@ local function load_ase(path) frame_count = #frames, default_tag = default_tag, tags = tags, + frame_durations = durations, } end |
