aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/application.lisp
diff options
context:
space:
mode:
Diffstat (limited to 'src/application.lisp')
-rw-r--r--src/application.lisp28
1 files changed, 17 insertions, 11 deletions
diff --git a/src/application.lisp b/src/application.lisp
index f33bb9f..8c86fad 100644
--- a/src/application.lisp
+++ b/src/application.lisp
@@ -88,27 +88,33 @@
focus-table blur-table perframe-table))
(defmethod cleanup ((app application))
- (loop for asset being the hash-value of (application-assets app)
- do (cleanup asset))
+ ;; run cleanup on assets
+ (loop :for asset :being :the :hash-value :of (application-assets app)
+ :do (cleanup asset))
+
;; drop all current handlers
(let ((listener (listener app)))
(dolist (table +listener-table-slot-names+)
(setf (slot-value listener table) (make-hash-table :synchronized t))))
- (loop for unit across (application-scene app)
- do
- (drop-unit unit)
- (cleanup unit))
+
+ ;; then cleanup units
+ (loop :for unit :across (application-scene app) :do
+ (drop-unit unit)
+ (cleanup unit))
+
+ ;; finally run the exit hooks
(pre-exit-hooks))
(defun run-perframe (app)
"Runs all of the handlers objects listening for perframe events if they are in the scene."
(let ((table (perframe-table (listener app)))
(time (sdl2:get-ticks)))
- (loop for target being the hash-key of table
- for handlers = (slot-value (listener target) 'perframe)
+ (loop :for target :being :the :hash-key :of table
+ :for handlers := (slot-value (listener target) 'perframe)
;; only fire perframe when target is in scene
- when (or (eq app target) (unit-in-scene-p target))
- do (loop for handler in handlers do (funcall handler target time)))))
+ :when (or (eq app target) (unit-in-scene-p target))
+ :do (loop :for handler :in handlers
+ :do (funcall handler target time)))))
(defmethod render ((app application))
(run-perframe app)
@@ -119,7 +125,7 @@
(gl:blend-func :src-alpha :one-minus-src-alpha )
(with-slots (scene) app
(when (plusp (length scene))
- (loop for unit across scene do (render unit))))
+ (loop :for unit :across scene :do (render unit))))
(sdl2:gl-swap-window (application-window app))
(sleep (frame-wait app)))