diff options
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)))) |