X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=gacela.lisp;h=4197d22d077e2b488fc7f692d48285aced148848;hb=d0e2cdc7308eabc4727729f9ac085f2959696b90;hp=31fe8abada40e5140ebbe26211e557660dbe5995;hpb=fd0956a0072b3db8808880bd3d4dbf17d941265d;p=gacela.git diff --git a/gacela.lisp b/gacela.lisp index 31fe8ab..4197d22 100644 --- a/gacela.lisp +++ b/gacela.lisp @@ -154,6 +154,12 @@ (defun make-resource-font (&key filename encoding) `(:type font :filename ,filename :enconding ,encoding)) +(defun make-resource-sound (&key filename) + `(:type sound :filename ,filename)) + +(defun make-resource-music (&key filename) + `(:type music :filename ,filename)) + (defmacro get-rtime (key) `(resource-time (gethash ,key resources-table))) @@ -269,23 +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) - (when (functionp game-code) (funcall game-code)) - (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? () @@ -298,7 +305,8 @@ (free-all-resources) (quit-audio) (quit-video-mode) - (quit-all-mobs) +; (quit-all-mobs) + (kill-all-objects) ; (clear-events) ; (quit-events) (quit-sdl))