local base_param = ...
local sw,sh,scx,scy,songdir,rr,am,bt,hs,pe,hr,ease,wratio,hratio,paraph = base_param.sw,base_param.sh,base_param.scx,base_param.scy,base_param.songdir,base_param.rr,base_param.am,base_param.bt,base_param.hs,base_param.pe,base_param.hr,base_param.ease,base_param.wratio,base_param.hratio,base_param.paraph

local num = 3
local uv = pe[1] and {(scx-155*1.5)/sw, (scx+(155+68)*1.5)/sw} or {(scx-(155+68)*1.5)/sw, (scx+155*1.5)/sw}
local FG

local af = Def.ActorFrame{
	Name='lanes',
	InitCommand=function(self) self:rotationz(-30) FG = self:GetParent():GetParent():GetParent():GetParent():GetParent() end,
}
local res = 64
local rad = sh/2

for id = 1, num do
	local af2 = Def.ActorFrame{Name='lanes'..id, InitializeCommand=function(self) self:rotationz(360/num*id) end}
	af2[#af2+1] = Def.ActorMultiVertex{
		Name='lane'..id,
		InitializeCommand=function(self)
			local v = {}
			for i = 0, res do
				v[#v+1] = {
					{rad*math.cos(math.rad(180-(360/num)*i/res)),rad*math.sin(math.rad(180-(360/num)*i/res)),sh/2},
					{1,1,1,1},
					{(uv[1]*(res-i)+uv[2]*i)/res*wratio,hratio}
				}
				v[#v+1] = {
					{rad*math.cos(math.rad(180-(360/num)*i/res)),rad*math.sin(math.rad(180-(360/num)*i/res)),-sh*1.5},
					{1,1,1,0},
					{(uv[1]*(res-i)+uv[2]*i)/res*wratio,0}
				}
			end
			self:SetDrawState{First=1,Num=-1,Mode='DrawMode_QuadStrip'}
			self:SetVertices(v):SetTexture(FG:GetChild('PlayerAFT'):GetTexture())
		end
	}
	af[#af+1] = af2
end

return af