Skip to content

Commit

Permalink
Chunk to mesh converting
Browse files Browse the repository at this point in the history
  • Loading branch information
borodust committed Jan 4, 2017
1 parent 4816510 commit cda539e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
15 changes: 13 additions & 2 deletions resources/converters.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@
(defmethod chunk-asset-flow ((this animation-chunk) loader)
(value-flow (chunk->animation this)))

;;;
;;;
;;;
(defstruct mesh-asset
(mesh nil :read-only t)
(transform nil :read-only t)
(bones nil :read-only t))


(define-system-function chunk->mesh ge.gx:graphics-system (mesh-chunk)
(let* ((arrays (mesh-chunk-arrays mesh-chunk))
Expand All @@ -44,11 +52,14 @@

(defmethod chunk-asset-flow ((this mesh-chunk) loader)
(-> ((ge.gx:graphics) :important-p t) ()
(chunk->mesh this)))
(multiple-value-bind (mesh transform bones) (chunk->mesh this)
(make-mesh-asset :mesh mesh
:transform transform
:bones bones))))


(defmethod dispose-chunk-asset ((this mesh-chunk) asset loader)
(dispose asset))
(dispose (mesh-asset-mesh asset)))


(defun chunk->skeleton (chunk)
Expand Down
6 changes: 5 additions & 1 deletion resources/packages.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@
(defpackage :cl-bodge.resources
(:nicknames :ge.rsc)
(:use :cl :cl-bodge.utils :cl-bodge.engine :cl-bodge.assets)
(:export make-resource-loader))
(:export make-resource-loader

mesh-asset-mesh
mesh-asset-transform
mesh-asset-bones))

0 comments on commit cda539e

Please sign in to comment.