Skip to content

Commit

Permalink
Make shader entities issue an event for changed classes
Browse files Browse the repository at this point in the history
  • Loading branch information
Shinmera committed Oct 31, 2018
1 parent 396db1f commit ed31827
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion context.lisp
Expand Up @@ -154,7 +154,7 @@
this context *context*))))))

(defmethod handle (event (global (eql T)))
(unless (boundp *context*)
(when (boundp '*context*)
(handle event (handler *context*))))

(defclass resize (event)
Expand Down
2 changes: 0 additions & 2 deletions entity.lisp
Expand Up @@ -20,5 +20,3 @@

(defmethod matches (a (b entity))
(matches b a))

;; FIXME: send out redefinition signals
5 changes: 3 additions & 2 deletions shader-entity.lisp
Expand Up @@ -83,11 +83,12 @@
(unless (c2mop:class-finalized-p super)
(c2mop:finalize-inheritance super)))
(setf (effective-shaders class) (compute-effective-shaders class))
(setf (effective-shader-class class) (compute-effective-shader-class class)))
(setf (effective-shader-class class) (compute-effective-shader-class class))
(handle (make-instance 'class-changed :changed-class class) T))

(defmethod (setf direct-shaders) :after (value (class shader-entity-class))
(when (c2mop:class-finalized-p class)
(reinitialize-instance class)))
(c2mop:finalize-inheritance class)))

(defmethod effective-shaders ((class symbol))
(effective-shaders (find-class class)))
Expand Down

0 comments on commit ed31827

Please sign in to comment.