aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorne_mene <[email protected]>2026-03-29 15:26:32 +0200
committerne_mene <[email protected]>2026-03-29 15:26:32 +0200
commitf9f6c3a75e5e16998c8bd82b8326aecf7e722ebd (patch)
treeab8bb6704aec9893adb7d379cca311a5104a57f2 /src
parentda8eebb2d8ed8594f51ea7b45db44ad91d9c0810 (diff)
load image data as well
Diffstat (limited to 'src')
-rw-r--r--src/init.lua1
-rw-r--r--src/textures.lua9
2 files changed, 9 insertions, 1 deletions
diff --git a/src/init.lua b/src/init.lua
index 19acd59..4fd66dd 100644
--- a/src/init.lua
+++ b/src/init.lua
@@ -25,6 +25,7 @@ register_input("Dash", {{"key", "lshift"}})
register_input("Right_Click", {{"mouse", 2}})
register_input("Left_Click", {{"mouse", 1}})
+li = love.image
la = love.audio
lg = love.graphics
lf = love.filesystem
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