Currently broken, moving pcs

This commit is contained in:
Vivianne 2024-03-10 17:53:14 -04:00
parent c44a009d7a
commit f1c2d204cd
3 changed files with 19 additions and 7 deletions

View File

@ -23,7 +23,8 @@ SUFFIXES = .scm .go
.scm.go:
$(AM_V_GEN)$(top_builddir)/pre-inst-env $(GUILE_TOOLS) compile $(GUILE_TARGET) $(GUILE_WARNINGS) -o "$@" "$<"
SOURCES = gaart.scm
SOURCES = gaart.scm \
gaart/draw.scm
TESTS =

View File

@ -9,7 +9,7 @@
#:export (gaart?
gaart-w
gaart-h
draw
gaart-draw
blank
text
place-at
@ -45,9 +45,6 @@
(h gaart-h)
(draw gaart-draw))
(define (draw buffer g)
"Draw a gaart to the provided buffer"
)
(define* (blank #:optional (w 0) (h 1))
(gaart w h (λ (okay? blit! rpos cpos) #f)))
@ -166,6 +163,7 @@
(or (draw-x okay? blit! rpos cpos)
(blit! cursor-rpos cursor-cpos #f))))))
;; figure out "invalid keyword" error
(define* (*vappend2 y x #:key (reverse? #f))
(match-let ((($ <gaart> xw xh draw-x) x)
(($ <gaart> yw yh draw-y) y))
@ -191,7 +189,7 @@
(define new-width (max xw yw))
(define x-paint (matte new-width xh #:halign halign x))
(define y-paint (matte new-width yh #:halign halign y))
(*vappend2 #:reverse? reverse? y-paint x-paint)))))
(*vappend2 y-paint x-paint #:reverse? reverse?)))))
(define* (vappend r1 #:key (halign #f) (reverse? #f) . rs)
(fold (λ (a d) (vappend2 a d #:halign halign #:reverse? reverse?)) r1 rs))
@ -223,7 +221,7 @@
(define new-height (max xh yh))
(define x-paint (matte xw new-height #:valign valign x))
(define y-paint (matte yw new-height #:valign valign y))
(*happend2 #:reverse? reverse? y-paint x-paint)))))
(*happend2 y-paint x-paint #:reverse? reverse?)))))
(define* (happend r1 #:key (valign #f) (reverse? #f) . rs)

13
gaart/draw.scm Normal file
View File

@ -0,0 +1,13 @@
(define-module (gaart draw)
#:use-module (gaart)
#:use-module (termenv screen)
#:export (draw))
(define (draw buffer ga)
"Draw a gaart to the provided buffer"
;; TODO: better okay and use buffer
((gaart-draw ga) (λ (width height rpos cpos) #t) blit! 0 0))
(define (blit! rpos cpos ch)
(move-cursor rpos cpos)
(display ch))