Move local var to appropriate scope

This commit is contained in:
Lars Mueller 2023-05-24 22:42:38 +02:00
parent 0b521bbb61
commit 741746613b

@ -1,17 +1,6 @@
local texmod = ...
local colorspec = modlib.minetest.colorspec
local transforms = {
[0] = {},
{rotation_deg = 90},
{rotation_deg = 180},
{rotation_deg = 270},
{flip_axis = "x"},
{flip_axis = "x", rotation_deg = 90},
{flip_axis = "y"},
{flip_axis = "y", rotation_deg = 90},
}
-- Generator readers
local gr = {}
@ -89,7 +78,18 @@ function pr.invert(r)
return channels
end
function pr.transform(r)
do
local transforms = {
[0] = {},
{rotation_deg = 90},
{rotation_deg = 180},
{rotation_deg = 270},
{flip_axis = "x"},
{flip_axis = "x", rotation_deg = 90},
{flip_axis = "y"},
{flip_axis = "y", rotation_deg = 90},
}
function pr.transform(r)
if r:match"I" then
return
end
@ -106,6 +106,7 @@ function pr.transform(r)
end
local transform = assert(transforms[r:int()], "out of range")
return transform.flip_axis, transform.rotation_deg
end
end
function pr.verticalframe(r)