Skip to content

lispbuilder-sdl: bug in surfaces.lisp #32

Description

@GoogleCodeExporter
I found a bug in lispbuilder-sdl/sdl/surfaces.lisp, function (setf cells) 
specialized on (integer sdl-surface). The code would make all cells share one 
rectangle object, so changes in one cell will be reflected in all others.

The fix (against latest SVN trunk):

diff --git a/lispbuilder-sdl/sdl/surfaces.lisp 
b/lispbuilder-sdl/sdl/surfaces.lisp
index c71c55f..e944617 100644
--- a/lispbuilder-sdl/sdl/surfaces.lisp
+++ b/lispbuilder-sdl/sdl/surfaces.lisp
@@ -152,7 +152,8 @@ Free using [FREE](#free)."))
          ,body-value))))

 (defmethod (setf cells) ((num integer) (self sdl-surface))
-  (setf (slot-value self 'cells) (make-array num :initial-element 
(get-rectangle-* self)))
+  (setf (slot-value self 'cells) (make-array num :initial-contents (loop 
repeat num
+                                                                         
collect (get-rectangle-* self))))
   (setf (cell-index self) 0))

 (defmethod (setf cells) ((rects list) (self sdl-surface))

Original issue reported on code.google.com by [email protected] on 19 Jun 2012 at 9:02

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions