luvcraft/main.lisp
Run luvcraft until its native window closes.
Native close begins orderly teardown beside SDL's event loop; that teardown closes the canvas last. Keep the executable alive until the native loop has observed that final close.
Native teardown reports through the controller rather than from its worker thread. Surface that exact result in the executable.
Started inside a playing game's terminal wall: be its child.
Logical conjunction of tests and raw truth values.
Test whether one compatible scalar is at most another.
(pathname pid port)(pathname pid port)(function)(&optional (stream *standard-output*))(&key provider tracy-p fullscreen-p birthday-p
(world-pathname
(default-luvcraft-world-pathname)))(&key
(title "luv little block world — click, look, walk")
;; NIL means "as much of this display as
;; comfortably fits"; a capture asks for the
;; exact frame it intends to write out. A
;; KMSDRM console can only present at a real
;; display mode, so the environment may pin
;; the canvas to the panel's native size.
(width (let ((value (uiop:getenv "LUVCRAFT_WIDTH")))
(and value (parse-integer value))))
(height (let ((value (uiop:getenv "LUVCRAFT_HEIGHT")))
(and value (parse-integer value))))
(frames-per-second 60)
(visible-p t)
(fullscreen-p nil)
(high-pixel-density-p t)
(world (make-empty-little-block-world))
(mesher (make-instance
'exposed-face-mesher))
(camera (make-instance 'fly-camera))
player
(selected-block *stone-block*)
(inventory (make-block-inventory))
quit-function
;; A hidden capture wanting animals in frame
;; hands in a population it has already
;; placed; the ordinary game grows its own
;; around the player as it plays.
(critters
(make-instance 'critter-population))
checkpoint-writer
(provider *gpu-provider*)
(sky-clock (make-instance 'sky-clock))
(sky-profile (make-default-sky-profile))
(shadow-diagnostic-p nil)
;; The world-text banner is a proof of the
;; Slug path, not scenery: a caller that
;; wants one asks for it, and the ordinary
;; game sky stays empty.
(world-text-string nil)
(world-text-font-pathname
(cl-dejavu:font-pathname "DejaVuSans.ttf"))
(world-text-distance 8.0)
(world-text-lift 3.0)
(world-text-units-per-em 0.55)
(video-pathname nil)
(video-distance 13.0)
(video-lift 4.5)
(video-height 5.0)
(residency-radius 6)
(publication-limit 2)
(load-schedule-limit 4)
(mesh-capture-limit 1))Open a little CPU-meshed block world. Click to capture the pointer, look with the mouse, walk with WASD, and jump with Space. Once captured, left click removes the block at the centre of view and right click places the selected block. Number keys select materials, middle click picks the targeted material, Shift…
()Start Tracy for luvcraft and answer whether the profiler is running. Nothing is recorded until a viewer connects, so this is safe to leave on. Call it before starting a session if you want the production workers to appear under their own names: a thread can only introduce itself to a profiler that is already running,…
(&key name age fullscreen-p
(provider luv:*gpu-provider*)
(visible-p t) width height
(frames-per-second 60)
(register-p t)
(sky-hour *party-sky-hour*))Throw the party: open the birthday meadow and decorate it. Loads or creates the party world under its own save file, raises the gazebo, ties on the balloons, calls in the gnomes, scatters the funny balls, hangs the greeting in the air, pins the sky at dusk, and starts the fireworks. Returns the session;…
Logical disjunction of tests and raw truth values.
If you're lucky, someone has bound this to a working GPU-PROVIDER.
(&key (provider luv:*gpu-provider*) tracy-p fullscreen-p
(video-pathname *video-pathname*)
(world-pathname (default-luvcraft-world-pathname)))Open the ordinary persistent game in this Lisp and return the session. Load or create WORLD-PATHNAME, restore its saved camera and player, start checkpointing, and open the visible game window, on the whole display when FULLSCREEN-P. *SESSION* names the live game for later SLY evaluations. STOP-PLAYING checkpoints…
The live game session in this Lisp, or NIL.
(controller)(controller)()Checkpoint and close the game PLAY opened, releasing its resources. *SESSION* is cleared whether or not the release succeeds, so a failed teardown cannot leave the image believing a game is still playing. The failure itself is not swallowed: STOP-LUVCRAFT closes the window first and then signals what went wrong, and…
(arguments)Test whether two compatible scalars are equal.
(pathname &optional provider)(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…
(pathname)(pathname &key (provider *gpu-provider*))Render a native-resolution close-up of the world Slug text proof. The wide viewport and enlarged world-space text make outline, band-selection, and coverage defects visible without scaling up a smaller raster afterward. #9G0Z19
(argument)(argument)(argument)(&optional frame-count pathname scenario density)(&key (frame-count 120) (warmup-count 30)
(width 960) (height 640)
(world (make-empty-little-block-world :seed 121))
(camera (make-instance 'fly-camera))
(scenario :steady) (high-pixel-density-p nil)
csv-pathname (stream *standard-output*))Measure steady or streaming world frames through the real Metal path. The streaming scenario moves one chunk in +X after warmup and records the entire asynchronous load, mesh, and owner-publication transition. #887PO7 The hidden demand-clock canvas avoids the application's 60 Hz scheduler, but CAMetalLayer may…
(arguments)(&key (path (luvcraft-parent-socket-path))
(screen (or (uiop:getenv "LUVCRAFT_PARENT_SCREEN") "-")))(function)Call FUNCTION where synchronous SDL canvas work can use the native main thread. On Darwin, a batch Lisp normally evaluates its toplevel form on the process main thread. Opening a canvas from that continuation would let Cocoa replace the continuation with its durable event loop. This boundary moves FUNCTION to a…
Start before
start-luvcraftcreates the producer. Tracy thread names are emitted by the threads themselves as they begin, so attaching later would leave an otherwise useful worker lane anonymous.