aboutsummaryrefslogtreecommitdiff
path: root/src/textures.lua
diff options
context:
space:
mode:
Diffstat (limited to 'src/textures.lua')
-rw-r--r--src/textures.lua9
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