-
-;;; Game Properties
-
-(define set-game-properties! #f)
-(define get-game-properties #f)
-
-;; (let ((ptitle *title*) (pwidth *width-screen*) (pheight *height-screen*) (pbpp *bpp-screen*) (pfps *frames-per-second*) (pmode *mode*))
-;; (set! set-game-properties!
-;; (lambda* (#:key title width height bpp fps mode)
-;; ; (init-video-mode)
-;; (if title
-;; (begin
-;; (set! ptitle title)
-;; (if (video-mode-on?) (SDL_WM_SetCaption title ""))))
-;; (if (or width height bpp)
-;; (begin
-;; (if width (set! pwidth width))
-;; (if height (set! pheight height))
-;; (if bpp (set! pbpp bpp))
-;; (if (video-mode-on?) (resize-screen pwidth pheight pbpp))))
-;; (if fps
-;; (begin
-;; (set! pfps fps)
-;; (set-frames-per-second fps)))
-;; (if mode
-;; (begin
-;; (set! pmode mode)
-;; (if (video-mode-on?)
-;; (if (eq? mode '3d) (set-3d-mode) (set-2d-mode)))))
-;; (get-game-properties)))
-
-;; (set! get-game-properties
-;; (lambda ()
-;; `((title . ,ptitle) (width . ,pwidth) (height . ,pheight) (bpp . ,pbpp) (fps . ,pfps) (mode . ,pmode)))))
-
-
-;;; Main Loop
-
-(define loop-flag #f)
-(define game-code #f)
-
-(define-macro (game . code)
- `(let ((game-function ,(if (null? code)
- `(lambda () #f)
- `(lambda () ,@code))))
- (set-game-code game-function)
- (cond ((not (game-running?))
- (game-loop)))))
-
-(define (init-gacela)
- (call-with-new-thread (lambda () (game))))
-
-(define (quit-gacela)
- (set! loop-flag #f))
-
-(define (game-loop)
-; (refresh-active-mobs)
- (set! loop-flag #t)
- (init-video 640 480 32)
- (while loop-flag
- (init-frame-time)
-; (check-connections)
- (process-events)
- (cond ((not (quit?))
- (clear-screen)
- (to-origin)
-; (refresh-active-mobs)
- (if (procedure? game-code)
- (catch #t
- (lambda () (game-code))
- (lambda (key . args) #f)))
-; (run-mobs)
- (flip-screen)
- (delay-frame))))
- (quit-video))
-
-(define (game-running?)
- loop-flag)
-
-(define (set-game-code game-function)
- (set! game-code game-function))