From f9f6c3a75e5e16998c8bd82b8326aecf7e722ebd Mon Sep 17 00:00:00 2001 From: ne_mene Date: Sun, 29 Mar 2026 15:26:32 +0200 Subject: load image data as well --- src/textures.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/textures.lua') diff --git a/src/textures.lua b/src/textures.lua index b58f762..9ed789c 100644 --- a/src/textures.lua +++ b/src/textures.lua @@ -10,6 +10,7 @@ local default_anim = { } local img_bank = {} +local img_data_bank = {} local anim_bank = {} local function load_ase(path) @@ -73,7 +74,9 @@ function load_textures_from(path) load_textures_from(filepath) else if is_filetype(filepath, {"png"}) then - img_bank[filepath] = lg.newImage(filepath) + local data = li.newImageData(filepath) + img_data_bank[filepath] = data + img_bank[filepath] = lg.newImage(data) elseif filepath:match("%.ase$") then load_ase(filepath) end @@ -85,6 +88,10 @@ function get_tex(name) return img_bank[name] end +function get_tex_data(name) + return img_data_bank[name] +end + function get_anim(name) return anim_bank[name] or default_anim end -- cgit v1.3-2-g0d8e