From d0e2cdc7308eabc4727729f9ac085f2959696b90 Mon Sep 17 00:00:00 2001 From: jsancho Date: Sun, 2 Jan 2011 13:21:48 +0000 Subject: [PATCH] --- Makefile | 2 +- gacela.lisp | 6 +++--- gacela_GL.lisp | 8 ++++++++ gacela_objects.lisp | 4 +++- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index ec24457..a6d98a0 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ INC = -I/usr/include/FTGL -I/usr/include/freetype2 LIBS = -lSDL -lSDL_image -lSDL_mixer -lSDL_gfx -lGL -lGLU -lftgl OBJ = gacela.o gacela_misc.o gacela_SDL.o gacela_GL.o gacela_FTGL.o \ - gacela_draw.o gacela_ttf.o gacela_events.o gacela_mobs.o gacela_entities.o \ + gacela_draw.o gacela_ttf.o gacela_events.o gacela_mobs.o gacela_objects.o \ gacela_widgets.o gacela_sound.o GCL_OBJ = $(OBJ:%.o=\"%.o\") diff --git a/gacela.lisp b/gacela.lisp index c6cdeb9..4197d22 100644 --- a/gacela.lisp +++ b/gacela.lisp @@ -288,9 +288,9 @@ (cond ((not (quit?)) (glClear (+ GL_COLOR_BUFFER_BIT GL_DEPTH_BUFFER_BIT)) (to-origin) - (refresh-visible-boxes) + (refresh-active-objects) (when (functionp game-code) (funcall game-code)) - (render-boxes) + (render-objects) (SDL_GL_SwapBuffers) (delay-frame)))) (setq running nil)) @@ -306,7 +306,7 @@ (quit-audio) (quit-video-mode) ; (quit-all-mobs) - (quit-all-boxes) + (kill-all-objects) ; (clear-events) ; (quit-events) (quit-sdl)) diff --git a/gacela_GL.lisp b/gacela_GL.lisp index b890c25..c17b049 100644 --- a/gacela_GL.lisp +++ b/gacela_GL.lisp @@ -203,6 +203,12 @@ (defcfun "void gacela_glOrtho (float left, float right, float bottom, float top, float near_val, float far_val)" 0 "glOrtho (left, right, bottom, top, near_val, far_val);") +(defcfun "void gacela_glPushMatrix (void)" 0 + "glPushMatrix ();") + +(defcfun "void gacela_glPopMatrix (void)" 0 + "glPopMatrix ();") + (defcfun "void gacela_gluPerspective (double fovy, double aspect, double zNear, double zFar)" 0 "gluPerspective (fovy, aspect, zNear, zFar);") @@ -241,6 +247,8 @@ (defentry glNormal3f (float float float) (void "gacela_glNormal3f")) (defentry glBlendFunc (int int) (void "gacela_glBlendFunc")) (defentry glOrtho (float float float float float float) (void "gacela_glOrtho")) +(defentry glPushMatrix () (void "gacela_glPushMatrix")) +(defentry glPopMatrix () (void "gacela_glPopMatrix")) (defentry gluPerspective (double double double double) (void "gacela_gluPerspective")) (defentry gluBuild2DMipmaps (int int int int int int int) (int "gacela_gluBuild2DMipmaps")) diff --git a/gacela_objects.lisp b/gacela_objects.lisp index e5d049d..178c4ac 100755 --- a/gacela_objects.lisp +++ b/gacela_objects.lisp @@ -87,7 +87,9 @@ (:get-attr attr) (:get-bhv bhv) (:set-bhv (setq bhv (car param))) - (:render ,@look)))) + (:render (glPushMatrix) + ,@(mapcar (lambda (x) (if (stringp x) `(draw-image ,x) x)) look) + (glPopMatrix))))) (add-object ',name) ',name)) -- 2.39.2