X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;ds=sidebyside;f=gacela.lisp;h=4197d22d077e2b488fc7f692d48285aced148848;hb=6a3d1ffb69036e6d4f1c239fd7d52f9bfc48d50c;hp=cc875b4c8109fb082ed818ed53757ca90f9fe3c0;hpb=6b6a4339ce465b8fed0fd017c981d0b5953a5175;p=gacela.git diff --git a/gacela.lisp b/gacela.lisp index cc875b4..4197d22 100644 --- a/gacela.lisp +++ b/gacela.lisp @@ -275,25 +275,24 @@ (init-video-mode) (set-game-code game-function) (cond ((not (game-running?)) - (init-frame-time) - (process-events) (game-loop))))) (let (running game-code) (defun game-loop () (setq running t) (do () ((quit?)) - (glClear (+ GL_COLOR_BUFFER_BIT GL_DEPTH_BUFFER_BIT)) - (to-origin) - (refresh-visible-boxes) - (when (functionp game-code) (funcall game-code)) - (render-boxes) - (SDL_GL_SwapBuffers) - (delay-frame) (init-frame-time) (check-connections) (eval-from-clients) - (process-events)) + (process-events) + (cond ((not (quit?)) + (glClear (+ GL_COLOR_BUFFER_BIT GL_DEPTH_BUFFER_BIT)) + (to-origin) + (refresh-active-objects) + (when (functionp game-code) (funcall game-code)) + (render-objects) + (SDL_GL_SwapBuffers) + (delay-frame)))) (setq running nil)) (defun game-running? () @@ -307,7 +306,7 @@ (quit-audio) (quit-video-mode) ; (quit-all-mobs) - (quit-all-boxes) + (kill-all-objects) ; (clear-events) ; (quit-events) (quit-sdl))