mirror of
https://github.com/appgurueu/modlib.git
synced 2024-10-05 17:23:08 +02:00
Move local var to appropriate scope
This commit is contained in:
parent
0b521bbb61
commit
741746613b
@ -1,17 +1,6 @@
|
|||||||
local texmod = ...
|
local texmod = ...
|
||||||
local colorspec = modlib.minetest.colorspec
|
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
|
-- Generator readers
|
||||||
|
|
||||||
local gr = {}
|
local gr = {}
|
||||||
@ -89,6 +78,17 @@ function pr.invert(r)
|
|||||||
return channels
|
return channels
|
||||||
end
|
end
|
||||||
|
|
||||||
|
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)
|
function pr.transform(r)
|
||||||
if r:match"I" then
|
if r:match"I" then
|
||||||
return
|
return
|
||||||
@ -107,6 +107,7 @@ function pr.transform(r)
|
|||||||
local transform = assert(transforms[r:int()], "out of range")
|
local transform = assert(transforms[r:int()], "out of range")
|
||||||
return transform.flip_axis, transform.rotation_deg
|
return transform.flip_axis, transform.rotation_deg
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function pr.verticalframe(r)
|
function pr.verticalframe(r)
|
||||||
r:expect":"
|
r:expect":"
|
||||||
|
Loading…
Reference in New Issue
Block a user