Update of /project/pal/cvsroot/pal/examples In directory clnet:/tmp/cvs-serv9369/examples
Modified Files: hello.lisp images.lisp Log Message: Fixed a few brainfarts in, mostly in pal-macros.lisp and examples/
--- /project/pal/cvsroot/pal/examples/hello.lisp 2007/10/31 12:51:23 1.10 +++ /project/pal/cvsroot/pal/examples/hello.lisp 2007/12/29 14:45:53 1.11 @@ -16,7 +16,7 @@ (/ (- (pal:get-screen-height) (pal:get-font-height font)) 2))))) - (pal:set-blend-color 0 0 0 255) + (pal:set-blend-color (pal:color 0 0 0 255)) (pal:draw-text "Hello from PAL" (pal:v+ midpoint (pal:v 5 5)) font) (pal:reset-blend) (pal:draw-text "Hello from PAL" midpoint font))) @@ -28,7 +28,7 @@ (defun hello-2 () (pal:with-pal (:fps 10000) (let ((angle 0f0)) - (pal:set-blend-color 0 255 0 255) + (pal:set-blend-color (pal:color 0 255 0 255)) (pal:event-loop () (pal:draw-rectangle (pal:v 0 0) (pal:get-screen-width) (pal:get-screen-height) @@ -42,7 +42,7 @@ (defun hello-3 () (pal:with-pal (:fps 10000) (pal:event-loop () - (pal:clear-screen 0 0 0) + (pal:clear-screen pal:+black+) (loop for x from 0 to 800 by (pal:get-text-size "Hello from PAL") do (loop for y from 20 to 600 by 10 --- /project/pal/cvsroot/pal/examples/images.lisp 2007/10/31 12:51:23 1.9 +++ /project/pal/cvsroot/pal/examples/images.lisp 2007/12/29 14:45:53 1.10 @@ -14,17 +14,18 @@ (truncate (+ 127 (* 128 (cos (/ (- x y) 10)))))))) ;; IMAGE-FROM-ARRAY builds an image from a 2d array of (list r g b &optional a) ;; Try setting the SMOOTHP parameter to T and see what happens. - image-2 (image-from-array nil #2A(((255 255 255 128) (0 0 0) (255 255 255)) - ((255 255 255) (255 255 0) (255 255 255)) - ((255 255 255) (0 0 0) (255 255 255 128)))) + image-2 (image-from-array #2A(((255 255 255 128) (0 0 0) (255 255 255)) + ((255 255 255) (255 255 0) (255 255 255)) + ((255 255 255) (0 0 0) (255 255 255 128))) + nil)
;; LOAD-IMAGE-TO-ARRAY does exactly what it says. Let's load the plane image and randomize the alpha values a bit. - image-3 (image-from-array nil - (let ((image (load-image-to-array "lego-plane.png"))) + image-3 (image-from-array (let ((image (load-image-to-array "lego-plane.png"))) (do-n (x (array-dimension image 0) y (array-dimension image 1)) (when (> (fourth (aref image x y)) 200) (setf (fourth (aref image x y)) (+ (random 128) 127)))) - image))) + image) + nil))
@@ -57,8 +58,8 @@
;; Press left mousebutton to capture part of the screen as a new cursor. ;; Note that altough the allocated images are released when PAL is closed we really should manually release - ;; the old cursor image with FREE-RESOURCE if we keep allocating lots of new images. + ;; the old cursor image with FREE-RESOURCE if we keep allocating lots of new images. (when (key-pressed-p :key-mouse-1) (set-cursor (image-from-array - nil - (screen-to-array (get-mouse-pos) 128 128))))))) \ No newline at end of file + (screen-to-array (get-mouse-pos) 128 128) + nil)))))) \ No newline at end of file