diff options
author | colin <colin@cicadas.surf> | 2024-12-14 12:29:29 -0800 |
---|---|---|
committer | colin <colin@cicadas.surf> | 2024-12-14 12:29:29 -0800 |
commit | 543704f0f54cbb1de78754ad8a323c482ab6829c (patch) | |
tree | 7528c0105516a2a2800e432de9f4f1a6c3fe506e /src/interactive/frameset.lisp | |
parent | 3a2217263d581be9a7f629b10d75aa8e3d581890 (diff) |
Diffstat (limited to 'src/interactive/frameset.lisp')
-rw-r--r-- | src/interactive/frameset.lisp | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/src/interactive/frameset.lisp b/src/interactive/frameset.lisp index 65762c7..c6abb4b 100644 --- a/src/interactive/frameset.lisp +++ b/src/interactive/frameset.lisp @@ -36,21 +36,21 @@ (incf (frameset-next-time target) (frameset-wait-time target))))) (defmethod cleanup ((frameset frameset)) - (loop for frame across (frameset-frames frameset) do (cleanup frame))) + (loop :for frame :across (frameset-frames frameset) :do (cleanup frame))) (defmethod initialize-instance :after ((fs frameset) &key) (add-handler fs #'check-advance-frameset-index) (with-slots (index sequence count frames x y scale-x scale-y rotation) fs (setf index 0 count (length sequence)) - (loop for frame across frames - when frame - do (setf (unit-in-scene-p frame) fs - (x frame) x - (y frame) y - (scale-x frame) scale-x - (scale-y frame) scale-y - (rotation frame) rotation)))) + (loop :for frame :across frames + :when frame + :do (setf (unit-in-scene-p frame) fs + (x frame) x + (y frame) y + (scale-x frame) scale-x + (scale-y frame) scale-y + (rotation frame) rotation)))) (defun current-frame-unit (fs) "Returns the unit be currently displaayed as the animation's frame." @@ -63,16 +63,16 @@ (macrolet ((def-frameset-accessors (&rest accessor-names) (let ((defs - (loop for accessor-name in accessor-names - collect + (loop :for accessor-name :in accessor-names + :collect `(defmethod ,accessor-name ((fs frameset)) (,accessor-name (current-frame-unit fs))) - collect + :collect `(defmethod (setf ,accessor-name) (newval (fs frameset)) - (loop for frame across (frameset-frames fs) - when frame - do (setf (,accessor-name frame) newval)) + (loop :for frame :across (frameset-frames fs) + :when frame + :do (setf (,accessor-name frame) newval)) newval)))) `(progn ,@defs)))) @@ -86,16 +86,16 @@ (let* ((asset-names (remove-duplicates sequenced-assets :test #'equal)) (images - (loop for name in asset-names - collect + (loop :for name :in asset-names + :collect (make-instance - 'image - :texture (get-asset name :asset-args asset-args)))) + 'image + :texture (get-asset name :asset-args asset-args)))) (sequence - (loop for name in sequenced-assets - collect (position name asset-names :test #'equal)))) + (loop :for name :in sequenced-assets + :collect (position name asset-names :test #'equal)))) (make-instance - 'frameset - :frames (make-array (length images) :initial-contents images) - :sequence (make-array (length sequence) :initial-contents sequence) - :wait-time (/ 1000.0 fps)))) + 'frameset + :frames (make-array (length images) :initial-contents images) + :sequence (make-array (length sequence) :initial-contents sequence) + :wait-time (/ 1000.0 fps)))) |