mirror of
git://repo.or.cz/rocks.git
synced 2025-01-01 14:00:30 +01:00
Vein registration stuff.
This commit is contained in:
parent
1b318ccedc
commit
90718a30ee
@ -1,12 +1,45 @@
|
||||
-- experimental fast vein generator
|
||||
|
||||
rocks.veins={}
|
||||
local l=depositgen.l
|
||||
local print=l.print
|
||||
|
||||
table.insert(rocks.veins,{
|
||||
-- the public table of registered veins
|
||||
depositgen.veins={}
|
||||
local regs=depositgen.veins
|
||||
|
||||
depositgen.register_vein= function(descr)
|
||||
local vein={
|
||||
ymin=(descr.ymin or -10000),
|
||||
ymax=(descr.ymax or 200),
|
||||
scarcity=descr.scarcity,
|
||||
content={ name=descr.content },
|
||||
scatter={}
|
||||
}
|
||||
table.insert(depositgen.l.ToResolve,vein.content)
|
||||
for _,sc in pairs(descr.scatter) do
|
||||
local psc={
|
||||
scarcity=sc.scarcity,
|
||||
size=(sc.size or vein.width),
|
||||
density=sc.density,
|
||||
content={ name=sc.content }
|
||||
}
|
||||
table.insert(depositgen.l.ToResolve,psc.content)
|
||||
table.insert(vein.scatter,psc)
|
||||
end
|
||||
return table.insert(regs,vein)
|
||||
end
|
||||
|
||||
do
|
||||
local sample_vein_def={
|
||||
ymin=-200, ymax=-6,
|
||||
scarcity=80,
|
||||
|
||||
})
|
||||
|
||||
content="default:dirt",
|
||||
scatter={
|
||||
--{ scarcity=7, density=4, content="default:mese", size=2 }
|
||||
}
|
||||
}
|
||||
depositgen.register_vein(sample_vein_def)
|
||||
end
|
||||
|
||||
rocksl.genvein=function(minp,maxp,pr,vm,area)
|
||||
local t1 = os.clock()
|
Loading…
Reference in New Issue
Block a user