Permalink
Browse files

Closed #59. Metaballs should now work.

  • Loading branch information...
Balooga committed Apr 2, 2017
1 parent f95dcf4 commit 74138c33910fcce3ce1c11e6ded882d31f968372
@@ -353,8 +353,8 @@
(:mouse-button-up-event ()
(setf mb-pressed? nil))
(:mouse-motion-event (:x x :y y)
(when mb-pressed?
(handle-mouse-moved x y (first meta-balls))))
(when t ;;mb-pressed?
(handle-mouse-moved x y (first meta-balls))))
(:idle ()
(if *draw-gridp*
(sdl:blit-surface grid sdl:*default-display*)
@@ -365,7 +365,8 @@
;; Optimization; Draw the font each frame,
;; but only render the font once every 100 frames.
(draw-fps (format nil "FPS : ~2$" (sdl:average-fps))
10 10 sdl:*default-font* sdl:*default-display*
(funcall 100-frames-p))
#-sbcl(draw-fps (format nil "FPS : ~2$" (sdl:average-fps))
10 10 sdl:*default-font* sdl:*default-display*
(funcall 100-frames-p))
(sdl:update-display)))))))
@@ -5,50 +5,50 @@
(in-package #:lispbuilder-sdl-examples-system)
(defsystem lispbuilder-sdl-examples
:description "Examples for the lispbuilder-sdl package."
:version "0.9.2"
:author "Lispbuilder Mailing List <lispbuilder@googlegroups.com>"
:maintainer "Lispbuilder Mailing List <lispbuilder@googlegroups.com>"
:license "MIT"
:depends-on (lispbuilder-sdl)
:components
((:module "examples"
:components
((:file "package")
(:file "globals" :depends-on ("package"))
(:file "utils" :depends-on ("package"))
(:file "simple-font-demo" :depends-on ("package"))
(:file "bmp-sample" :depends-on ("package"))
(:file "flood-fill" :depends-on ("package"))
(:file "pixels" :depends-on ("package"))
(:file "recursive-rects" :depends-on ("package"))
(:file "mouse-painter" :depends-on ("package"))
(:file "random-rects" :depends-on ("package"))
(:file "mandelbrot" :depends-on ("package"))
(:file "line-drawing" :depends-on ("package"))
(:file "vertices" :depends-on ("package"))
(:file "bezier" :depends-on ("package"))
(:file "setup-and-draw" :depends-on ("package"))
(:file "width-height" :depends-on ("package"))
(:file "objects" :depends-on ("package"))
(:file "points-and-lines" :depends-on ("package"))
(:file "distance-2D" :depends-on ("package"))
#-sbcl(:file "metaballs" :depends-on ("package"))
(:file "inbuilt-fonts" :depends-on ("package"))
(:file "circle" :depends-on ("package"))
(:file "stroke" :depends-on ("package"))
(:file "mouse-2d" :depends-on ("package"))
(:file "joystick" :depends-on ("package"))
(:file "particles" :depends-on ("package"))
(:file "fireworks" :depends-on ("package"))
(:file "raw-audio-test" :depends-on ("package"))
(:file "input-util" :depends-on ("package"))
(:file "functional-geometry" :depends-on ("package"))
(:file "audio-mixer" :depends-on ("package"))
(:file "squashed" :depends-on ("package"))
(:file "keys" :depends-on ("package"))
(:file "alpha-example" :depends-on ("package"))
(:file "active" :depends-on ("package"))
(:file "explosion" :depends-on ("package"))
(:file "image-example" :depends-on ("package")))
:serial t)))
:description "Examples for the lispbuilder-sdl package."
:version "0.9.2"
:author "Lispbuilder Mailing List <lispbuilder@googlegroups.com>"
:maintainer "Lispbuilder Mailing List <lispbuilder@googlegroups.com>"
:license "MIT"
:depends-on (lispbuilder-sdl)
:components
((:module "examples"
:components
((:file "package")
(:file "globals" :depends-on ("package"))
(:file "utils" :depends-on ("package"))
(:file "simple-font-demo" :depends-on ("package"))
(:file "bmp-sample" :depends-on ("package"))
(:file "flood-fill" :depends-on ("package"))
(:file "pixels" :depends-on ("package"))
(:file "recursive-rects" :depends-on ("package"))
(:file "mouse-painter" :depends-on ("package"))
(:file "random-rects" :depends-on ("package"))
(:file "mandelbrot" :depends-on ("package"))
(:file "line-drawing" :depends-on ("package"))
(:file "vertices" :depends-on ("package"))
(:file "bezier" :depends-on ("package"))
(:file "setup-and-draw" :depends-on ("package"))
(:file "width-height" :depends-on ("package"))
(:file "objects" :depends-on ("package"))
(:file "points-and-lines" :depends-on ("package"))
(:file "distance-2D" :depends-on ("package"))
(:file "metaballs" :depends-on ("package"))
(:file "inbuilt-fonts" :depends-on ("package"))
(:file "circle" :depends-on ("package"))
(:file "stroke" :depends-on ("package"))
(:file "mouse-2d" :depends-on ("package"))
(:file "joystick" :depends-on ("package"))
(:file "particles" :depends-on ("package"))
(:file "fireworks" :depends-on ("package"))
(:file "raw-audio-test" :depends-on ("package"))
(:file "input-util" :depends-on ("package"))
(:file "functional-geometry" :depends-on ("package"))
(:file "audio-mixer" :depends-on ("package"))
(:file "squashed" :depends-on ("package"))
(:file "keys" :depends-on ("package"))
(:file "alpha-example" :depends-on ("package"))
(:file "active" :depends-on ("package"))
(:file "explosion" :depends-on ("package"))
(:file "image-example" :depends-on ("package")))
:serial t)))
@@ -152,21 +152,22 @@ lot of consing because it uses PUSH/POP as the stack. This function is fast.
(< *ff-stack-pointer* 0))
(defun ff-push(x y)
(declare (type fixnum x y)
(optimize (speed 3)(safety 0)))
;; (declare (type fixnum x y)
;; ;; (optimize (speed 3)(safety 0))
;; )
(if (< (1- *ff-stack-pointer*))
(progn
(incf *ff-stack-pointer*)
(setf (svref *ff-stack* *ff-stack-pointer*)
(the fixnum (+ (the fixnum (* x *ff-max-height*)) y))))
(+ (* x *ff-max-height*) y)))
nil))
(defun ff-pop()
(declare (optimize (speed 3)(safety 0)))
;;(declare (optimize (speed 3)(safety 0)))
(when (>= *ff-stack-pointer* 0)
(let ((x (truncate (the fixnum (/ (the fixnum (svref *ff-stack* *ff-stack-pointer*)) *ff-max-height*))))
(y (mod (the fixnum (svref *ff-stack* *ff-stack-pointer*)) *ff-max-height*)))
(declare (type fixnum x y))
(let ((x (truncate (/ (svref *ff-stack* *ff-stack-pointer*) *ff-max-height*)))
(y (mod (svref *ff-stack* *ff-stack-pointer*) *ff-max-height*)))
;; (declare (type fixnum x y))
(decf *ff-stack-pointer*)
(values x y))))

0 comments on commit 74138c3

Please sign in to comment.