trying to limit memory.

This commit is contained in:
Bryce Covert
2016-08-05 17:03:53 -07:00
parent 58540cfbbe
commit 02a76a4263

View File

@@ -77,10 +77,9 @@
(exec func {})) (exec func {}))
([func options] ([func options]
(when func (when func
(let [screen-map (merge @screen options) (let [old-entities @entities]
old-entities @entities]
(some->> (with-meta (some->> (with-meta
#(normalize (func screen-map old-entities)) #(normalize (func @screen old-entities options))
(meta func)) (meta func))
(wrapper screen) (wrapper screen)
(reset-changed! entities old-entities) (reset-changed! entities old-entities)
@@ -116,8 +115,11 @@
(update-fn! assoc :contact-listener) (update-fn! assoc :contact-listener)
update-screen!)) update-screen!))
:render (fn [d] :render (fn [d]
(swap! screen update-in [:total-time] #(+ (or %1 0) %2) d) (swap! screen (fn [s]
(execute-fn! on-render (assoc @screen :delta-time d))) (-> s
(assoc :delta-time d)
(update-in [:total-time] #(+ (or %1 0) d)))))
(execute-fn! on-render @screen))
:hide #(execute-fn! on-hide) :hide #(execute-fn! on-hide)
:pause #(execute-fn! on-pause) :pause #(execute-fn! on-pause)
:resize (fn [w h] :resize (fn [w h]