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/sprite.lisp | |
parent | 3a2217263d581be9a7f629b10d75aa8e3d581890 (diff) |
Diffstat (limited to 'src/interactive/sprite.lisp')
-rw-r--r-- | src/interactive/sprite.lisp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/interactive/sprite.lisp b/src/interactive/sprite.lisp index dd9b2a1..c212418 100644 --- a/src/interactive/sprite.lisp +++ b/src/interactive/sprite.lisp @@ -15,8 +15,9 @@ (defmethod initialize-instance :after ((sprite sprite) &key) (with-slots (framesets frameset-key) sprite - (loop for (name fs . more) on framesets by #'cddr - do (setf (unit-in-scene-p fs) sprite)) + (loop :for (name fs . more) :on framesets :by #'cddr :do + (setf (unit-in-scene-p fs) sprite)) + (unless frameset-key (setf frameset-key (first framesets))))) @@ -30,15 +31,15 @@ (macrolet ((def-sprite-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 ((sprite sprite)) (,accessor-name (current-frameset sprite))) - collect + :collect `(defmethod (setf ,accessor-name) (newval (sprite sprite)) - (loop for (key fs . more) on (sprite-framesets sprite) by #'cddr - do (setf (,accessor-name fs) newval)) + (loop :for (key fs . more) :on (sprite-framesets sprite) :by #'cddr + :do (setf (,accessor-name fs) newval)) newval)))) `(progn ,@defs)))) |