Move spite to use generated sdl2-image library

This commit is contained in:
retropikzel 2026-04-16 13:09:20 +03:00
parent 5db788c38d
commit c51c1aad4e
2 changed files with 2 additions and 10 deletions

View File

@ -10,15 +10,6 @@
(define draw-color-g 0) (define draw-color-g 0)
(define draw-color-b 0) (define draw-color-b 0)
(define draw-color-a 255) (define draw-color-a 255)
(define-c-library sdl2-image*
'("SDL2/SDL_image.h")
"SDL2_image-2.0"
`((additional-paths ("retropikzel/spite"
"snow/retropikzel/spite"))
(additional-versions ("0"))))
(define-c-procedure sdl-img-load-texture sdl2-image* 'IMG_LoadTexture 'pointer '(pointer pointer))
(define window* #f) (define window* #f)
(define renderer* #f) (define renderer* #f)
(define event* (make-c-bytevector 4000)) (define event* (make-c-bytevector 4000))
@ -144,7 +135,7 @@
(when (not spite-inited?) (error "Can not load images until spite is inited." path)) (when (not spite-inited?) (error "Can not load images until spite is inited." path))
(when (not (string? path)) (error "Load path must be string" path)) (when (not (string? path)) (error "Load path must be string" path))
(when (not (file-exists? path)) (error (string-append "Could not load image, no such file: " path))) (when (not (file-exists? path)) (error (string-append "Could not load image, no such file: " path)))
(make-image (sdl-img-load-texture renderer* (string->c-bytevector path)) path))) (make-image (IMG_LoadTexture renderer* (string->c-bytevector path)) path)))
(define draw-image (define draw-image
(lambda (image x y width height) (lambda (image x y width height)

View File

@ -12,6 +12,7 @@
(c2foreign-c sdl2 render) (c2foreign-c sdl2 render)
(c2foreign-c sdl2 events) (c2foreign-c sdl2 events)
(c2foreign-c sdl2 keyboard) (c2foreign-c sdl2 keyboard)
(c2foreign-c sdl2-image)
(foreign c)) (foreign c))
(export spite-init (export spite-init
spite-start spite-start