[pal-cvs] CVS pal

tneste tneste at common-lisp.net
Thu Nov 29 23:26:51 UTC 2007


Update of /project/pal/cvsroot/pal
In directory clnet:/tmp/cvs-serv14930

Modified Files:
	ffi.lisp pal.lisp todo.txt vector.lisp 
Log Message:
DATA-PATH should now always return a truename.

--- /project/pal/cvsroot/pal/ffi.lisp	2007/10/24 18:07:03	1.22
+++ /project/pal/cvsroot/pal/ffi.lisp	2007/11/29 23:26:51	1.23
@@ -435,6 +435,7 @@
 (defvar *resources* () "List of currently loaded resources.")
 
 (defstruct image
+  (file "")
   (texture 0 :type u11)                 ; "GL texture id for image."
   (texture-width 0 :type u11) ; "Actual (rounded up to power of two) width of texture."
   (texture-height 0 :type u11) ; "Actual (rounded up to power of two) height of texture."
@@ -444,14 +445,17 @@
   (width 0 :type u11))             ; "Width of textures visible part."
 
 (defstruct font
+  (file "")
   (image nil :type (or boolean image))
   (glyphs nil :type (or boolean (simple-vector 255)))
   (height 0 :type u11))
 
 (defstruct music
+  file
   music)
 
 (defstruct sample
+  file
   chunk)
 
 
--- /project/pal/cvsroot/pal/pal.lisp	2007/11/14 00:04:34	1.41
+++ /project/pal/cvsroot/pal/pal.lisp	2007/11/29 23:26:51	1.42
@@ -158,8 +158,9 @@
   "Find a FILE from the search paths."
   (let ((result nil))
     (dolist (i *data-paths* result)
-      (when (probe-file (merge-pathnames file i))
-        (setf result (namestring (merge-pathnames file i)))))
+      (let ((truename (probe-file (merge-pathnames file i))))
+        (when truename
+          (setf result (namestring (merge-pathnames truename i))))))
     (if result
         result
         (error "Data file not found: ~a" file))))
@@ -524,7 +525,7 @@
         (ty1 (if vmirror (pal-ffi:image-ty2 image) 0f0))
         (tx2 (if hmirror 0f0 (pal-ffi:image-tx2 image)))
         (ty2 (if vmirror 0f0 (pal-ffi:image-ty2 image))))
-   (if (or angle scale valign halign)
+    (if (or angle scale valign halign)
         (with-transformation ()
           (translate pos)
           (when angle
--- /project/pal/cvsroot/pal/todo.txt	2007/10/31 12:51:23	1.21
+++ /project/pal/cvsroot/pal/todo.txt	2007/11/29 23:26:51	1.22
@@ -1,11 +1,12 @@
 TODO:
 
+- Make sure resources are loaded only once.
 
 - Fix offsets in draw-image.
 
 - Polygon smooth hint?
 
-- Add align, scale and angle options to DRAW-IMAGE*.
+- Add align, scale, mirror and angle options to DRAW-IMAGE*.
 
 - Better clipping.
 
@@ -17,7 +18,7 @@
 
 - As always, optimise GL state handling. Blitting in batches, possibly VOBs.
 
-- Implement image mirroring, tiles and animation.
+- Implement "tiles" and animation.
 
 - Box/box/line/circle etc. overlap functions, faster v-dist.
 
--- /project/pal/cvsroot/pal/vector.lisp	2007/11/14 00:04:34	1.11
+++ /project/pal/cvsroot/pal/vector.lisp	2007/11/29 23:26:51	1.12
@@ -265,7 +265,8 @@
         t nil)))
 
 
-(defun rectangles-overlap-p (a a-width a-height b b-width b-height)
+(defunct rectangles-overlap-p (a a-width a-height b b-width b-height)
+    (vec a component a-width component a-height vec b component b-width component b-height)
   (let ((ax (vx a))
         (ay (vy a))
         (bx (vx b))




More information about the Pal-cvs mailing list