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 bit = 16
local af = Def.ActorFrame{
	Name='pixel',
	InitializeCommand=function(self) self:zoom(3):aux(bit) end
}

for i = 1, sw/bit do
	for j = 1, sh/bit do
		af[#af+1] = paraph.AMVQuad({
			Width = bit,
			Height = bit,
			uv1 = {(i-0.5)/(sw/bit)*wratio,(j-0.5)/(sh/bit)*hratio},
			uv2 = {(i+0.5)/(sw/bit)*wratio,(j+0.5)/(sh/bit)*hratio},
		})..{
			Name=i..j,
			InitializeCommand=function(self)
				local x = -scx+bit/2+(i-1)*bit
				local y = -scy+bit/2+(j-1)*bit
				self:xy(x,y)
				self:SetTexture(self:GetParent():GetParent():GetChild('Texture'):GetTexture())
			end
		}
	end
end

return af