diff options
author | Colin Okay <colin@cicadas.surf> | 2022-07-22 11:58:16 -0500 |
---|---|---|
committer | Colin Okay <colin@cicadas.surf> | 2022-07-22 11:58:16 -0500 |
commit | 00841605110612f6e7f3bbfc054ceff980bf25be (patch) | |
tree | 1f16b86d5c555eea22e60cb2d36f88682bd9023b /src/interactive | |
parent | 6d9b8b48423dba99ecdba004f260c30e6717b6a6 (diff) |
[version] [refactor] [redesign] removed containers
Diffstat (limited to 'src/interactive')
-rw-r--r-- | src/interactive/canvas.lisp | 2 | ||||
-rw-r--r-- | src/interactive/frameset.lisp | 2 | ||||
-rw-r--r-- | src/interactive/image.lisp | 2 | ||||
-rw-r--r-- | src/interactive/interactive.lisp | 15 | ||||
-rw-r--r-- | src/interactive/sprite.lisp | 2 | ||||
-rw-r--r-- | src/interactive/text.lisp | 2 |
6 files changed, 5 insertions, 20 deletions
diff --git a/src/interactive/canvas.lisp b/src/interactive/canvas.lisp index 7f24d89..aef8ebb 100644 --- a/src/interactive/canvas.lisp +++ b/src/interactive/canvas.lisp @@ -151,7 +151,7 @@ e.g., drawing a line in a particular color." (gl:bind-buffer :array-buffer 0) (gl:bind-vertex-array 0)) -(defclass/std canvas (affine interactive pixels) +(defclass/std canvas (unit interactive pixels) ((fbo :with :r :doc "framebuffer object for use in off-screen-rendering of this canvas to a texture") (texture :with :a :doc "texture instance"))) diff --git a/src/interactive/frameset.lisp b/src/interactive/frameset.lisp index 3ffbc18..25812f0 100644 --- a/src/interactive/frameset.lisp +++ b/src/interactive/frameset.lisp @@ -37,7 +37,7 @@ count (length sequence)) (loop for frame across frames when frame - do (setf (unit-container frame) fs)))) + do (setf (unit-in-scene-p frame) fs)))) (defun current-frame-unit (fs) "Returns the unit be currently displaayed as the animation's frame." diff --git a/src/interactive/image.lisp b/src/interactive/image.lisp index 7c84df3..0089f57 100644 --- a/src/interactive/image.lisp +++ b/src/interactive/image.lisp @@ -21,7 +21,7 @@ count and destroys shader-program if necessary." (gl:delete-program *image-shader-program*) (setf *image-shader-program* nil)))) -(defclass/std image (affine interactive) +(defclass/std image (unit interactive) ((texture :ri :std (error "A image requires a texture.")))) (defmethod initialize-instance :after ((image image) &key) diff --git a/src/interactive/interactive.lisp b/src/interactive/interactive.lisp index 83910c7..6152c3e 100644 --- a/src/interactive/interactive.lisp +++ b/src/interactive/interactive.lisp @@ -42,18 +42,3 @@ ON-* Macros." (remhash interactive (listener-table-for (listener interactive) event-type)))))) -(defmethod drop-unit :before ((unit interactive)) - (when (unit-container unit) - (when-let (handlers (get-handlers-for unit 'before-dropped)) - (dolist (handler handlers) - (funcall handler unit))))) - -(defmethod add-unit :before ((container container) (unit interactive)) - (when-let (handlers (get-handlers-for unit 'before-added)) - (dolist (handler handlers) - (funcall handler container unit)))) - -(defmethod add-unit :after ((container container) (unit interactive)) - (when-let (handlers (get-handlers-for unit 'after-added)) - (dolist (handler handlers) - (funcall handler container unit)))) diff --git a/src/interactive/sprite.lisp b/src/interactive/sprite.lisp index 22c6be4..68f8a8d 100644 --- a/src/interactive/sprite.lisp +++ b/src/interactive/sprite.lisp @@ -14,7 +14,7 @@ (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-container fs) sprite)) + do (setf (unit-in-scene-p fs) sprite)) (unless frameset-key (setf frameset-key (first framesets))))) diff --git a/src/interactive/text.lisp b/src/interactive/text.lisp index a7c0582..dd99653 100644 --- a/src/interactive/text.lisp +++ b/src/interactive/text.lisp @@ -2,7 +2,7 @@ (in-package #:wheelwork) -(defclass/std text (affine interactive) +(defclass/std text (unit interactive) ((font :with :ri :std (error "A font is required") :type font) (content :with :ri :std "") (color :with :std #(1.0 1.0 1.0 1.0)) |