diff options
| author | ne_mene <[email protected]> | 2026-03-29 15:26:32 +0200 |
|---|---|---|
| committer | ne_mene <[email protected]> | 2026-03-29 15:26:32 +0200 |
| commit | f9f6c3a75e5e16998c8bd82b8326aecf7e722ebd (patch) | |
| tree | ab8bb6704aec9893adb7d379cca311a5104a57f2 /src/textures.lua | |
| parent | da8eebb2d8ed8594f51ea7b45db44ad91d9c0810 (diff) | |
load image data as well
Diffstat (limited to 'src/textures.lua')
| -rw-r--r-- | src/textures.lua | 9 |
1 files changed, 8 insertions, 1 deletions
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 |
