forked from hhrhhr/Lua-utils-for-Rebel-Galaxy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmake_ids_map.lua
More file actions
45 lines (37 loc) · 728 Bytes
/
Copy pathmake_ids_map.lua
File metadata and controls
45 lines (37 loc) · 728 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
local t, s = dofile(arg[1])
local w, h = 256, 128
local b = 4
local b_c = "128 "
local z_c = "0 "
local t_c = "255 "
io.write("P2\n")
io.write(b * 2 + w .. " ")
io.write(b * 2 + h .. "\n")
io.write("255\n")
local max = w * h
local b_h = (b * 2 + w) * (b)
for i = 1, b_h do
io.write(b_c)
end
local i = 0
for y = 1, h do
for x = -b, w+b-1 do
if x < 0 or x >= w then
io.write(b_c)
else
if i < 2^15 then
i = i + 1
if t[i] or s[i] then
io.write(t_c)
else
io.write(z_c)
end
end
end
end
print()
end
for i = 1, b_h do
io.write(b_c)
end
print()