From 2fa15ac572e2fc1975e28b9dc6d8becf31f15534 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Thu, 15 Aug 2013 07:31:14 -0400 Subject: Fix freeimage-load procedure that was not passing enough arguments. This was a fucking pain to track down. freeimage-get-bits was randomly failing to load. Sometimes the program would run, sometimes it would crash with a null pointer dereference error. --- 2d/wrappers/freeimage.scm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to '2d') diff --git a/2d/wrappers/freeimage.scm b/2d/wrappers/freeimage.scm index e7b1605..ab037d4 100644 --- a/2d/wrappers/freeimage.scm +++ b/2d/wrappers/freeimage.scm @@ -138,13 +138,12 @@ (%freeimage-get-height bitmap) (%freeimage-get-bpp bitmap))))) -(define-foreign %freeimage-load '* "FreeImage_Load" (list unsigned-int '*)) +(define-foreign %freeimage-load '* "FreeImage_Load" (list unsigned-int '* unsigned-int)) +(define-foreign %freeimage-unload void "FreeImage_Unload" '(*)) (define (freeimage-load image-format filename) (wrap-freeimage-bitmap - (%freeimage-load image-format (string->pointer filename)))) - -(define-foreign %freeimage-unload void "FreeImage_Unload" '(*)) + (%freeimage-load image-format (string->pointer filename) 0))) (define (freeimage-unload bitmap) (%freeimage-unload (unwrap-freeimage-bitmap bitmap))) -- cgit v1.2.3