I believe this fixes the freezes.
This commit is contained in:
@@ -74,22 +74,31 @@
|
||||
(terminate [this screen entities]
|
||||
entities)
|
||||
(skip-type [this screen entities]
|
||||
:skip)))
|
||||
:none-but-arrow)))
|
||||
|
||||
(defmacro get-script [entities & forms]
|
||||
`(fn [starting-entities#]
|
||||
(let [~entities (atom starting-entities#)]
|
||||
(thread (do (change-script-state ~entities true)
|
||||
~@forms
|
||||
(change-script-state ~entities false)
|
||||
(utils/save @~entities))))))
|
||||
(put! (get-in starting-entities# [:actions :script-chan])
|
||||
(fn [starting-entities#]
|
||||
(let [~entities (atom starting-entities#)]
|
||||
(thread (do
|
||||
(try
|
||||
~@forms
|
||||
(finally
|
||||
(change-script-state ~entities false)
|
||||
(utils/save @~entities)
|
||||
)))))))))
|
||||
|
||||
(defmacro get-unsaved-script [entities & forms]
|
||||
`(fn [starting-entities#]
|
||||
(let [~entities (atom starting-entities#)]
|
||||
(thread (change-script-state ~entities true)
|
||||
~@forms
|
||||
(change-script-state ~entities false)))))
|
||||
(put! (get-in starting-entities# [:actions :script-chan])
|
||||
(fn [starting-entities#]
|
||||
(let [~entities (atom starting-entities#)]
|
||||
(thread (do
|
||||
(try
|
||||
~@forms
|
||||
(finally
|
||||
(change-script-state ~entities false))))))))))
|
||||
|
||||
(defn bound-to-camera [x length zoom]
|
||||
(min (- length (* length 0.5 zoom ))
|
||||
|
||||
Reference in New Issue
Block a user