Skip to content

Commit

Permalink
Editor: Fewer gui endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
matgis committed Dec 9, 2024
1 parent 283e096 commit dac6d19
Showing 1 changed file with 30 additions and 16 deletions.
46 changes: 30 additions & 16 deletions defold-spine/editor/src/spineguiext.clj
Original file line number Diff line number Diff line change
Expand Up @@ -147,28 +147,42 @@
(output spine-skin-ids gui/GuiResourceNames (g/fnk [spine-scene-element-ids spine-scene]
(:spine-skin-ids (or (spine-scene-element-ids spine-scene)
(spine-scene-element-ids "")))))
(output spine-scene-scene g/Any (g/fnk [spine-scene-infos spine-scene]
(:spine-scene-scene (or (spine-scene-infos spine-scene)
(spine-scene-infos "")))))
(output spine-scene-bones g/Any (g/fnk [spine-scene-infos spine-scene]
(:spine-bones (or (spine-scene-infos spine-scene)
(spine-scene-infos "")))))

(output spine-scene-pb g/Any (g/fnk [spine-scene-infos spine-scene]
(:spine-scene-pb (or (spine-scene-infos spine-scene)
(spine-scene-infos "")))))
(output spine-scene-scene g/Any
(g/fnk [costly-gui-scene-info spine-scene]
(let [spine-scene-infos (:spine-scene-infos costly-gui-scene-info)
spine-scene-info (or (get spine-scene-infos spine-scene)
(get spine-scene-infos ""))]
(:spine-scene-scene spine-scene-info))))
(output spine-scene-bones g/Any
(g/fnk [costly-gui-scene-info spine-scene]
(let [spine-scene-infos (:spine-scene-infos costly-gui-scene-info)
spine-scene-info (or (get spine-scene-infos spine-scene)
(get spine-scene-infos ""))]
(:spine-bones spine-scene-info))))
(output spine-scene-pb g/Any
(g/fnk [costly-gui-scene-info spine-scene]
(let [spine-scene-infos (:spine-scene-infos costly-gui-scene-info)
spine-scene-info (or (get spine-scene-infos spine-scene)
(get spine-scene-infos ""))]
(:spine-scene-pb spine-scene-info))))

;; The handle to the C++ resource
(output spine-data-handle g/Any (g/fnk [spine-scene-infos spine-scene]
(:spine-data-handle (or (spine-scene-infos spine-scene)
(spine-scene-infos "")))))
(output spine-data-handle g/Any
(g/fnk [costly-gui-scene-info spine-scene]
(let [spine-scene-infos (:spine-scene-infos costly-gui-scene-info)
spine-scene-info (or (get spine-scene-infos spine-scene)
(get spine-scene-infos ""))]
(:spine-data-handle spine-scene-info))))

(output spine-vertex-buffer g/Any :cached (g/fnk [spine-scene spine-data-handle spine-skin spine-default-animation]
(produce-local-vertices spine-data-handle spine-skin spine-default-animation 0.0)))

(output aabb g/Any (g/fnk [spine-scene-infos spine-scene spine-skin pivot]
(or (get-in spine-scene-infos [spine-scene :spine-skin-aabbs (if (= spine-skin "") "default" spine-skin)])
geom/empty-bounding-box)))
(output aabb g/Any
(g/fnk [costly-gui-scene-info spine-scene spine-skin]
(let [spine-scene-infos (:spine-scene-infos costly-gui-scene-info)
spine-skin-name (if (= spine-skin "") "default" spine-skin)]
(or (get-in spine-scene-infos [spine-scene :spine-skin-aabbs spine-skin-name])
geom/empty-bounding-box))))

; Overloaded outputs from VisualNode
(output gpu-texture TextureLifecycle (g/constantly nil))
Expand Down

0 comments on commit dac6d19

Please sign in to comment.