Wait till we finish drawing and watching to commit state
This commit is contained in:
parent
a2f53900f9
commit
0732d473b7
@ -84,17 +84,15 @@
|
|||||||
(let [config (:config @game-config)]
|
(let [config (:config @game-config)]
|
||||||
(try
|
(try
|
||||||
(doseq [buf @buffered-objs] (snapshot! buf))
|
(doseq [buf @buffered-objs] (snapshot! buf))
|
||||||
(swap! game-state #(update config %))
|
(let [updated-state (update config @game-state)]
|
||||||
|
(rl/with-drawing!
|
||||||
|
(draw config updated-state)
|
||||||
|
(w/watch! (watch-fn config updated-state))
|
||||||
|
(swap! game-state updated-state)
|
||||||
(catch Throwable t
|
(catch Throwable t
|
||||||
(doseq [buf @buffered-objs]
|
(doseq [buf @buffered-objs]
|
||||||
(restore! buf))
|
(restore! buf))
|
||||||
(report-exception! t)))
|
(report-exception! t))))))))
|
||||||
(rl/with-drawing!
|
|
||||||
(try
|
|
||||||
(draw config @game-state)
|
|
||||||
(w/watch! (watch-fn config @game-state))
|
|
||||||
(catch Throwable t
|
|
||||||
(report-exception! t)))))))
|
|
||||||
(try
|
(try
|
||||||
(when unload
|
(when unload
|
||||||
(doseq [[_ tex] @texture-cache]
|
(doseq [[_ tex] @texture-cache]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user