(define-macro (run-game . code)
- `(let ((game-function (lambda () (begin ,@code))))
+ `(let ((game-function ,(if (null? code)
+ `(lambda () #f)
+ `(lambda () ,@code))))
(init-video-mode)
(set-game-code game-function)
(cond ((not (game-running?))
(set! game-loop
(lambda ()
(set! running #t)
-; (do () ((quit?))
- (do () (#f)
+ (quit? #f)
+ (do () ((quit?))
(init-frame-time)
; (check-connections)
; (eval-from-clients)
-; (process-events)
-; (cond ((not (quit?))
- (cond ((not #f)
+ (process-events)
+ (cond ((not (quit?))
(glClear (+ GL_COLOR_BUFFER_BIT GL_DEPTH_BUFFER_BIT))
-; (to-origin)
+ (to-origin)
; (refresh-active-objects)
(if (procedure? game-code) (game-code))
; (render-objects)
(set! game-code game-function))))
(define (quit-game)
-; (free-all-resources)
(quit-audio)
(quit-video-mode)
; (quit-all-mobs)
; (kill-all-objects)
-; (clear-events)
-; (quit-events)
+; (clear-events)
+ (quit-events)
(quit-sdl))