(bind-func add-density-v
(lambda (v:Vector4* amt:double)
(let ((xs (* (* 320.0 0.5) scale-x))
(xy (* (* 360.0 0.5) scale-y))
(xx (dtoi64 (range-limit (+ offset-x xs (* xs (ftod (tref v 0)))) 0.0 320.0)))
(yy (dtoi64 (range-limit (+ offset-y xy (* xy (ftod (tref v 1)))) 0.0 360.0))))
(set! amt (* 1.0 amt))
(if (< yy 180)
(add-density-1 xx yy amt)
(add-density-2 xx (- yy 180) amt)))
void))