global("PRELOAD")

function preload()
    if cuz.params("platform") == 'web' then return end
	if PRELOAD == nil then return end

	for _,fname in pairs(str_split(PRELOAD,"\n")) do
		fname = str_clean(fname)
		local parts = str_split(fname,".")
		if #parts == 2 then
			-- print('preload:'..fname..' '..parts[2])
			local name = parts[1]
			local ext = parts[2]
			if ext == "wav" then cuz.sample_play(name,0.0) end
			if ext == "png" then cuz.image_draw(name,0,0,1,1) end
		end
	end

	PRELOAD = nil
end

PRELOAD = [[

]]
