Skip to content

Commit

Permalink
Fix some issues related to dynamic insertion (being inserted into wro…
Browse files Browse the repository at this point in the history
…ng passes, wrong prior)
  • Loading branch information
Shinmera committed Apr 8, 2021
1 parent df2c85c commit b3fe075
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
5 changes: 2 additions & 3 deletions entity.lisp
Expand Up @@ -54,9 +54,8 @@
(when valid-p (flare-queue:value last))))

(defmethod enter* ((thing entity) (container container))
(let ((preceding (preceding-entity thing container)))
(enter thing container)
(compile-into-pass thing preceding *scene*)))
(compile-into-pass thing container *scene*)
(enter thing container))

(defmethod leave* ((thing entity) (container (eql T)))
(leave* thing (container thing)))
Expand Down
3 changes: 2 additions & 1 deletion layered-container.lisp
Expand Up @@ -37,7 +37,8 @@
for head = (flare-queue::head set)
for last = (flare-queue::left (flare-queue::tail set))
do (loop until (or (eq last head)
(typep (flare-queue:value last) 'renderable))
(and (typep (flare-queue:value last) 'renderable)
(not (eq (flare-queue:value last) thing))))
do (setf last (flare-queue::left last)))
(unless (eq last head)
(return (setf preceding (flare-queue:value last)))))
Expand Down
7 changes: 7 additions & 0 deletions shader-pass.lisp
Expand Up @@ -292,6 +292,13 @@
(flare-queue:remove-cells start end)
(remhash entity (group-pointers pass)))))

(defmethod compile-into-pass :around ((entity entity) previous (pass scene-pass))
(when (object-renderable-p entity pass)
(call-next-method)))

(defmethod compile-into-pass ((entity entity) (container container) (pass scene-pass))
(compile-into-pass entity (preceding-entity entity container) pass))

(defmethod compile-into-pass ((entity entity) (previous entity) (pass scene-pass))
(destructuring-bind (start . end) (gethash previous (group-pointers pass))
(declare (ignore start))
Expand Down

0 comments on commit b3fe075

Please sign in to comment.