luvcraft/tools/block-world.lisp
in-package#:luvcraft.tools
defuncommand-block-world
arguments
multiple-value-bind
positionalsoptions
parse-keyword-optionsarguments`
"--backend":backend,#'parse-backend-option
"--count":count,#'parse-integer-option
"--width":width,#'parse-integer-option
"--height":height,#'parse-integer-option
"--yaw-step":yaw-step,#'parse-real-option
unless
command-line-error"block-world expects exactly one TARGET pathname."
let
ifcount
dolist
pathname
luvcraft:capture-hidden-luvcraft-framestarget:countcount:widthwidth:heightheight:providerprovider:yaw-stepyaw-step
formatt"~A~%"pathname
formatt"~A~%"
defun command-block-world
(arguments)defun parse-keyword-options
(arguments specs)defun parse-backend-option
(string name)defun parse-integer-option
(string name)defun parse-real-option
(string name)define-arithmetic-operator =
Test whether two compatible scalars are equal.
define-arithmetic-operator or
Logical disjunction of tests and raw truth values.
defun make-backend-provider
(backend)defun capture-hidden-luvcraft-frames
(directory &key
(count 6)
(title "luv hidden block world")
(width 960) (height 640)
(yaw-step 0.35)
(forward-step 0.0)
day-start
(day-step 0.0)
difference-scale
(shadow-diagnostic-p nil)
(pathname-prefix "block-world")
(world (make-empty-little-block-world))
(mesher (make-instance 'exposed-face-mesher))
(camera (make-instance 'fly-camera))
(critters (make-instance 'critter-population))
(provider *gpu-provider*)
(sky-clock (make-instance 'sky-clock
:pinned-day-fraction 0.5))
(sky-profile (make-default-sky-profile)))Capture COUNT hidden block-world frames into DIRECTORY. Each frame reuses one hidden SDL canvas on PROVIDER, advances CAMERA's yaw by YAW-STEP, moves FORWARD-STEP world units along its initial heading, and moves the evaluated sky by DAY-STEP day fractions. DAY-START can replace the clock's initial time. When…
defun capture-hidden-luvcraft-screenshot
(pathname &key
(title "luv hidden block world")
(width 960) (height 640)
(world (make-empty-little-block-world))
(mesher (make-instance 'exposed-face-mesher))
(camera (make-instance 'fly-camera))
(critters (make-instance 'critter-population))
(provider *gpu-provider*)
(world-text-string nil)
(world-text-distance 8.0)
(world-text-lift 3.0)
(world-text-units-per-em 0.55)
(sky-clock (make-instance 'sky-clock
:pinned-day-fraction 0.5))
(sky-profile (make-default-sky-profile)))Open a hidden SDL canvas, render one block-world frame, and save it. The sky clock arrives pinned at noon so captures stay byte-deterministic; pass an unpinned clock to photograph another time of day. A capture never runs the frame simulation, so any animals it wants in shot arrive already placed in CRITTERS rather…