mirror of
https://cheapiesystems.com/git/digiscreen
synced 2024-12-04 20:53:44 +01:00
Performance improvements, for real this time
This commit is contained in:
parent
18b293cec8
commit
8472cc3178
7
init.lua
7
init.lua
@ -22,7 +22,12 @@ local function generateTexture(pos,serdata)
|
|||||||
for y=1,16,1 do
|
for y=1,16,1 do
|
||||||
if type(data[y]) ~= "table" then data[y] = {} end
|
if type(data[y]) ~= "table" then data[y] = {} end
|
||||||
for x=1,16,1 do
|
for x=1,16,1 do
|
||||||
bincolors = bincolors..minetest.colorspec_to_bytes(data[y][x] or "000000")
|
local colorspec = 0
|
||||||
|
if data[y][x] then
|
||||||
|
colorspec = tonumber(data[y][x],16) or 0
|
||||||
|
end
|
||||||
|
colorspec = 0xFF000000 + colorspec
|
||||||
|
bincolors = bincolors..minetest.colorspec_to_bytes(colorspec)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
local img = minetest.encode_png(16,16,bincolors,0)
|
local img = minetest.encode_png(16,16,bincolors,0)
|
||||||
|
Loading…
Reference in New Issue
Block a user