X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=src%2Fassimp.scm;h=11a3d091d67188be4b36ee003c546aa3bc1d2ca6;hb=HEAD;hp=fcb9492fd1750e32e59ca704e232d7b1badbac16;hpb=21dab003aaf4e3d42bf5a7c2fe8a64e1fcec6192;p=guile-assimp.git diff --git a/src/assimp.scm b/src/assimp.scm index fcb9492..11a3d09 100644 --- a/src/assimp.scm +++ b/src/assimp.scm @@ -15,7 +15,7 @@ ;;; along with this program. If not, see . -(define-module (assimp assimp) +(define-module (assimp) #:use-module (assimp low-level) #:use-module (assimp low-level cimport) #:use-module (assimp low-level color) @@ -169,24 +169,24 @@ (pkey (string->pointer (car color-type))) (type (cadr color-type)) (index (caddr color-type)) - (pout (make-c-struct (make-list max float) '(0))) - (pmax (make-c-struct (list unsigned-int) (list max)))) + (pout (bytevector->pointer (list->f32vector (make-list max 0)))) + (pmax (bytevector->pointer (list->u32vector (list max))))) (let ((res (aiGetMaterialFloatArray pmat pkey type index pout pmax))) (if (< res 0) res - (parse-c-struct pout (make-list max float)))))) + (f32vector->list (pointer->bytevector pout max 0 'f32)))))) (define-public (ai-get-material-integer-array mat color-type max) (let ((pmat (unwrap-ai-material mat)) (pkey (string->pointer (car color-type))) (type (cadr color-type)) (index (caddr color-type)) - (pout (make-c-struct (make-list max int) '(0))) - (pmax (make-c-struct (list unsigned-int) (list max)))) + (pout (bytevector->pointer (list->s32vector (make-list max 0)))) + (pmax (bytevector->pointer (list->u32vector (list max))))) (let ((res (aiGetMaterialIntegerArray pmat pkey type index pout pmax))) (if (< res 0) res - (parse-c-struct pout (make-list max int)))))) + (s32vector->list (pointer->bytevector pout max 0 's32)))))) ;;; Faces