lispgames / cl-sdl2-mixer

Bindings for SDL2_mixer
MIT License
12 stars 11 forks source link

:wave argument is not recognized on sdl2-mixer:init #6

Open ghost opened 5 years ago

ghost commented 5 years ago

Documentations mentions sdl2-mixer:init with :wave as an argument but the function returns a warning

WARNING: Unknown mask symbol :WAVE, treated as 0; expected one of:
  (:FLAC :FLUIDSYNTH :MOD :MODPLUG :MP3 :OGG)

All the functions work however. Even loading of .wav files is successfull despite :wave not being passed as an argument to the sdl2-mixer:init function

fitzsim commented 3 months ago

Can you test this and see if it works for you?

diff --git a/src/general.lisp b/src/general.lisp
index baa44d8..3cde390 100644
--- a/src/general.lisp
+++ b/src/general.lisp
@@ -10,12 +10,10 @@ defun linked-version
   (c-let ((version sdl2-ffi:sdl-version :from (mix-linked-version)))
     (values (version :major) (version :minor) (version :patch))))

-(autowrap:define-bitmask-from-enum (init-flags sdl2-ffi:mix-init-flags))
-
 (defun init (&rest flags)
-  "Initialize the SDL mixer specifying the formats you wish to use. Must be one
-of these values or a combination thereof :ogg, :wave, :mod, :mp3"
-  (mix-init (mask-apply 'init-flags flags)))
+  "Initialize the SDL mixer.  Arguments are ignored for now."
+  (declare (ignore flags))
+  (mix-init 0))

 (defun quit ()
   "Cleans up SDL Mixer"

The examples still work fine for me with this, so we might as well ignore the flags, I think.

I was having issues with needing to special-case the MIX_InitFlags symbol anyway, to get this to work (see comments on #13):

(autowrap:define-bitmask-from-enum (init-flags sdl2-ffi:mix-init-flags))