Permalink
Browse files

Fix s0 usage

  • Loading branch information...
Shinmera committed Dec 16, 2018
1 parent b270ea0 commit e8b1cd2bd4f56999bb16a547d7298fa741434c97
Showing with 6 additions and 6 deletions.
  1. +1 −1 rails.lisp
  2. +2 −2 toolkit.lisp
  3. +3 −3 transforms.lisp
@@ -31,7 +31,7 @@
(let ((total (loop for i from 1 below (length points)
sum (vlength (v- (aref points i) (aref points (1- i))))))
(times (make-array (length points) :element-type 'single-float
:initial-element 0.0s0)))
:initial-element 0.0f0)))
(loop for i from 1 below (length points)
for v = (v- (aref points i) (aref points (1- i)))
for d = (vlength v) then (+ d (vlength v))
@@ -409,7 +409,7 @@
((:double :double-float)
(float thing 0.0d0))
((:float :single-float)
(float thing 0.0s0))
(float thing 0.0f0))
((:int)
(check-gl-type thing 32)
(values (round thing)))
@@ -430,7 +430,7 @@
((:double :double-float)
(lambda (thing) (float thing 0.0d0)))
((:float :single-float)
(lambda (thing) (float thing 0.0s0)))
(lambda (thing) (float thing 0.0f0)))
((:int)
(lambda (thing)
(check-gl-type thing 32)
@@ -103,13 +103,13 @@
(defun vec->screen (vec width height)
(let ((clip-pos (m* (projection-matrix) (view-matrix) (model-matrix) (vxyz_ vec))))
(let ((w (vw clip-pos)))
(if (= 0.0s0 w)
(if (= 0.0f0 w)
(vec -1 -1 0)
(let* ((norm-pos (nv+ (nv* (vxyz clip-pos) (/ 0.5s0 w)) 0.5s0)))
(let* ((norm-pos (nv+ (nv* (vxyz clip-pos) (/ 0.5f0 w)) 0.5f0)))
(vsetf norm-pos
(* width (vx norm-pos))
(* height (- 1 (vy norm-pos)))
0.0s0))))))
0.0f0))))))

(defun screen->vec (vec width height)
(let* ((x (- (* 2 (/ (vx vec) width)) 1))

0 comments on commit e8b1cd2

Please sign in to comment.